Remove "target" occurences in future fstab file

This commit is contained in:
Jeremy Gardais 2020-10-21 09:37:22 +02:00
parent e8951c437b
commit 637d61b44f
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 5 additions and 0 deletions

View File

@ -142,6 +142,7 @@ if [ "${manage_btrfs}" -eq 0 ]; then
#### root #### root
grep "btrfs" /etc/mtab >> /tmp/target.fstab grep "btrfs" /etc/mtab >> /tmp/target.fstab
else ### Or for ext4, create mountpoint and mount LV else ### Or for ext4, create mountpoint and mount LV
#### root #### root
printf '%b\n' "/dev/mapper/${vgname}-root / ext4 defaults 0 0" >> /tmp/target.fstab printf '%b\n' "/dev/mapper/${vgname}-root / ext4 defaults 0 0" >> /tmp/target.fstab
@ -172,6 +173,10 @@ else ### Or for ext4, create mountpoint and mount LV
printf '%b\n' "/dev/mapper/${vgname}-var /var ext4 defaults 0 0" >> /tmp/target.fstab printf '%b\n' "/dev/mapper/${vgname}-var /var ext4 defaults 0 0" >> /tmp/target.fstab
fi fi
### Ensure to remove any occurence to /target mountpoint
sed -i 's;target/;;' /tmp/target.fstab
sed -i 's;target;;' /tmp/target.fstab
if [ "${manage_extra_lv}" -eq 0 ]; then if [ "${manage_extra_lv}" -eq 0 ]; then
### Extra bkp LV ### Extra bkp LV
mkdir -p -- /target/srv/backup mkdir -p -- /target/srv/backup