Fix fstab for btrfs filesystem

This commit is contained in:
Jeremy Gardais 2020-10-19 18:12:22 +02:00
parent 695012520f
commit a58cff12bd
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 7 additions and 3 deletions

10
debian/chroot.install vendored
View File

@ -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