From a58cff12bd3832f974684a0f85651c46dffed960 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 19 Oct 2020 18:12:22 +0200 Subject: [PATCH] Fix fstab for btrfs filesystem --- debian/chroot.install | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/chroot.install b/debian/chroot.install index 867699d..3e39a70 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -125,13 +125,12 @@ mkswap -L sw01 -- /dev/mapper/"${vgname}"-swap || exit 4 ### Root mkdir -p -- /target mountpoint -q /target || mount -- /dev/mapper/"${vgname}"-root /target -### Prepare an fstab file -printf '%b\n' "/dev/mapper/${vgname}-root / ext4 defaults 0 0" > /tmp/target.fstab ### boot - grub mkdir -p -- /target/boot mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot -printf '%b\n' "${hdd}1 /boot ext3 defaults 0 0" >> /tmp/target.fstab +### Prepare an fstab file +printf '%b\n' "${hdd}1 /boot ext3 defaults 0 0" > /tmp/target.fstab ### Prepare the base system tree according to the expected file system if [ "${manage_btrfs}" -eq 0 ]; then @@ -139,7 +138,12 @@ if [ "${manage_btrfs}" -eq 0 ]; then wget -O /tmp/part.btrfs.sh "https://git.101010.fr/gardouille-dotfiles/scripts/raw/master/debian/part.btrfs.sh" #### Create several subvolumes chmod +x /tmp/part.btrfs.sh && /tmp/part.btrfs.sh + + #### root + grep "btrfs" /etc/mtab >> /tmp/target.fstab else ### Or for ext4, create mountpoint and mount LV + #### root + printf '%b\n' "/dev/mapper/${vgname}-root / ext4 defaults 0 0" >> /tmp/target.fstab #### home LV mkdir -p -- /target/home mountpoint -q /target/home || mount -- /dev/mapper/"${vgname}"-home /target/home