/target/boot not getting mounted correctly during install

Robert Markula robert at markula.org
Tue Nov 6 17:21:18 CET 2018


Am 05.11.18 um 21:19 schrieb Robert Markula:
> What is keeping FAI from correctly mounting /dev/vda1 to /target/boot
> during install?

To answer my own question:

There seems to be a race condition in task_mountdisks for this specific
situation:

<snip fai.log>
Calling task_mountdisks
Mounting UUID=5fb71b06-e912-43c8-b6ec-06d39178b033 to /target/boot
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/home
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/opt
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/root
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/srv
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/tmp
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/usr/local
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/var
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/var/tmp
Mounting UUID=324068ad-fcd7-432b-adc0-9fe1bc473864 to /target/.snapshots
</snip>

Line 1: First, /dev/vda1 gets mounted to /target/boot
Line 2: then /dev/vgmain/root gets mounted to /target, rendering the
previous mount invalid.

Adding a new hook "hooks/extrbase.DEFAULT" solves this problem:

<snip>
echo "Re-mounting /boot"
if [ ! -d "$target/boot" ]; then
    mkdir $target/boot
fi

mount -vt ext4 /dev/vda1 /target/boot || exit 4
</snip>

Not very elegant, but it gets the job done.

Robert


More information about the linux-fai mailing list