ask user if the install drive is a ssd and set the btrfs ssd option accordingly

remove space_cache mount option because btrfs-progs uses Free Space Tree (space_cache=v2) since version 5.15 by default. see: https://wiki.tnonline.net/w/Btrfs/Space_Cache
This commit is contained in:
fenris 2021-12-09 17:59:48 +01:00
parent afbacbe3c2
commit 48dc88b0c5
2 changed files with 19 additions and 3 deletions

View File

@ -74,9 +74,9 @@ 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 ${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 subvol=@var /dev/mapper/ROOT /mnt/var
}
if [[ "${DISK}" == "nvme" ]]; then

View File

@ -90,6 +90,20 @@ Please select key board layout from this list
read -p "Your key boards layout:" keymap
echo "keymap=$keymap" >> setup.conf
}
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
}
diskpart () {
lsblk
echo -ne "
@ -103,6 +117,8 @@ Please enter disk to work on: (example /dev/sda):
"
read option
echo "DISK=$option" >> setup.conf
drivessd
}
userinfo () {
echo -ne "Please enter username: "