make_fs() {
mkfs.fat -F 32 -n EFI $(getDiskPart ${DISK_ROOT} 1)
mkfs.btrfs -L ROOT /dev/mapper/root
mount /dev/mapper/root /mnt
btrfs sub create /mnt/@
btrfs sub create /mnt/@snapshots #/.snapshots
btrfs sub create /mnt/@pkg #/var/cache/pacman/pkg
btrfs sub create /mnt/@log #/var/log
btrfs sub create /mnt/@tmp #/var/tmp
btrfs sub create /mnt/@cache #/var/cache
btrfs sub create /mnt/@flatpak #/var/lib/flatpak
btrfs sub create /mnt/@swap #/btrfs/@swap/swapfile
umount /mnt
mount -o noatime,compress-force=zstd,discard=async,commit=120,subvol=@ /dev/mapper/root /mnt
mkdir -p /mnt/{boot,btrfs,efi,home,root,.snapshots,var/cache,var/log,var/tmp,var/cache/pacman/pkg,var/lib/flatpak,var/lib/portables,var/lib/machines}
mount -o noatime,compress-force=zstd,discard=async,commit=120,subvolid=5 /dev/mapper/root /mnt/btrfs
btrfs filesystem mkswapfile --size ${SIZE_SWAP} /mnt/btrfs/@swap/swapfile
case ${HOME_FS} in
btrfs)
mkfs.btrfs -L HOME /dev/mapper/home
mount /dev/mapper/home /mnt/home
btrfs sub create /mnt/home/@home
btrfs sub create /mnt/home/@downloads #/home/${VUSER}/Downloads
btrfs sub create /mnt/home/@home-cache #/home/${VUSER}/.cache
btrfs sub create /mnt/home/@home-apps #/home/${VUSER}/.var/app
btrfs sub create /mnt/home/@steam #/home/${VUSER}/.local/share/Steam
umount /mnt/home
mount -o relatime,compress-force=zstd,discard=async,commit=120,subvol=@home /dev/mapper/home /mnt/home
mkdir -p /mnt/home/${VUSER}/{Downloads,.cache,.var/app,.local/share/Steam}
;;
ext4)
mkfs.ext4 -L HOME /dev/mapper/home
;;
esac
for DISK in "${!DISK_EXTRA[@]}"
do
mkdir /mnt/${DISK}
mkfs.ext4 -L ${DISK^^} /dev/mapper/${DISK}
done
umount -R /mnt
}
Does my filesystem setup look good?