Merge pull request #146 from fhanrath/fix/btrfs

Fix/btrfs
This commit is contained in:
Chris Titus 2022-01-06 11:29:01 -06:00 committed by GitHub
commit df8f4bedcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

View File

@ -74,10 +74,10 @@ createsubvolumes () {
}
mountallsubvol () {
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/ROOT /mnt/home
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@tmp /dev/mapper/ROOT /mnt/tmp
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots
mount -o subvol=@var /dev/mapper/ROOT /mnt/var
mount -o ${mountoptions},subvol=@home /dev/mapper/ROOT /mnt/home
mount -o ${mountoptions},subvol=@tmp /dev/mapper/ROOT /mnt/tmp
mount -o ${mountoptions},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots
mount -o ${mountoptions},subvol=@var /dev/mapper/ROOT /mnt/var
}
if [[ "${DISK}" =~ "nvme" ]]; then
if [[ "${FS}" == "btrfs" ]]; then
@ -101,7 +101,7 @@ if [[ "${DISK}" =~ "nvme" ]]; then
createsubvolumes
umount /mnt
# mount @ subvolume
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/ROOT /mnt
mount -o ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt
# make directories home, .snapshots, var, tmp
mkdir -p /mnt/{home,var,tmp,.snapshots}
# mount subvolumes
@ -125,7 +125,7 @@ else
createsubvolumes
umount /mnt
# mount all the subvolumes
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/ROOT /mnt
mount -o ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt
# make directories home, .snapshots, var, tmp
mkdir -p /mnt/{home,var,tmp,.snapshots}
# mount subvolumes

View File

@ -107,6 +107,21 @@ read -p "Your key boards layout:" keymap
set_option KEYMAP $keymap
}
drivessd () {
echo -ne "
Is this an ssd? yes/no:
"
read ssd_drive
case $ssd_drive in
y|Y|yes|Yes|YES)
echo "mountoptions=noatime,compress=zstd,ssd,commit=120" >> setup.conf;;
n|N|no|NO|No)
echo "mountoptions=noatime,compress=zstd,commit=120" >> setup.conf;;
*) echo "Wrong option. Try again";drivessd;;
esac
}
# selection for disk type
diskpart () {
# show disks present on system
@ -121,6 +136,9 @@ echo -ne "
Please enter full path to disk: (example /dev/sda):
"
read option
echo "DISK=$option" >> setup.conf
drivessd
set_option DISK $option
}
userinfo () {