Install the modified multipath-tools' binary packages; the initramfs is updated with the changes.
Reboot. The system booted successfully; good.
Notice:
- unmodified kernel cmdline
- root filesystem mounted from the 'by-uuid/multipath-<UUID>' symlink
- it points to a device-mapper virtual block device
- the symlink is unique (no other devices claim it).
(initramfs) ls -l /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667
lrwxrwxrwx 1 10 /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667 -> ../../dm-3
Now, make things wrong:
(initramfs) multipath -F
(initramfs) ls -l /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667
ls: /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667: No such file or directory
(initramfs) exit
~10 seconds for wait-for-root timeout...
The informative message is displayed; good; the failure hook is OK.
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
If you don't try to fix anything and exit, the good and old 'root device not found' message appears, normally.
...
Gave up waiting for root device. Common problems:
...
ALERT! /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667 does not exist. Dropping to a shell!
....
Verify the failure hook again, but now let's fix things:
(repeat steps above)
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
(initramfs) multipath -v0
(initramfs) exit
The initramfs continued on, and the system booted successfully:
$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667 31483800 2375308 27486120 8% /
$ udevadm info -q path /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667
/devices/virtual/block/dm-6
Finally, verify the failure hook again, using the 'TIP (not recommended)' steps.
It boots from the fake symlink (points to underlying/single-path device), so you get the usual errors about device-mapper failing to get the underlying because it's locked (root filesystem mountpoint), plus some "waiting" delays.
(repeat steps above)
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667 31483800 2386948 27474480 8% /
$ udevadm info -q path /dev/disk/by-uuid/multipath-7fec6766-3166-4395-982a-555ecce92667
/devices/vio/71000002/host0/target0:0:1/0:0:1:0/block/sdb/sdb2
$ ls -1 /run/udev/links/*by-uuid*multipath-7fec6766-3166-4395-982a-555ecce92667
ls: cannot access /run/udev/links/*by-uuid*multipath-7fec6766-3166-4395-982a-555ecce92667: No such file or directory
(i.e., the fake symlink is expectedly not maintained by udev, which is part of why this is not recommended :)
If you remove the UUID option from GRUB, it doesn't touch anything:
The test-cases performed with the patch:
Install the modified multipath-tools' binary packages; the initramfs is updated with the changes.
Reboot. The system booted successfully; good. multipath- <UUID>' symlink
Notice:
- unmodified kernel cmdline
- root filesystem mounted from the 'by-uuid/
- it points to a device-mapper virtual block device
- the symlink is unique (no other devices claim it).
$ cat /proc/cmdline /boot/vmlinux- 3.19.0- 9-generic root=UUID= 7fec6766- 3166-4395- 982a-555ecce926 67 ro
BOOT_IMAGE=
$ df / by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 31483800 2374984 27486444 8% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/disk/
$ udevadm info -q path /dev/disk/ by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 virtual/ block/dm- 4
/devices/
$ ls -1 /run/udev/ links/* by-uuid* multipath- 7fec6766- 3166-4395- 982a-555ecce926 67
b252:4
Verify the failure hook. top,post- multipath' .
Reboot with 'break=
Reduce the wait-for-root timeout for debugging purposes. )=[0-9] \+:\1=10: ' -i /scripts/local
(initramfs) sed 's:\(ARCHDELAY\
(initramfs) exit
Check the expected root device: /boot/vmlinux- 3.19.0- 9-generic root=UUID= 7fec6766- 3166-4395- 982a-555ecce926 67 ro break=top, post-multipath
(initramfs) cat /proc/cmdline
BOOT_IMAGE=
Initially, things are alright:
(initramfs) ls -l /dev/disk/ by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 -> ../../dm-3
lrwxrwxrwx 1 10 /dev/disk/
Now, make things wrong:
(initramfs) multipath -F by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67: No such file or directory
(initramfs) ls -l /dev/disk/
ls: /dev/disk/
(initramfs) exit
~10 seconds for wait-for-root timeout...
The informative message is displayed; good; the failure hook is OK.
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
If you don't try to fix anything and exit, the good and old 'root device not found' message appears, normally. by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 does not exist. Dropping to a shell!
...
Gave up waiting for root device. Common problems:
...
ALERT! /dev/disk/
....
Verify the failure hook again, but now let's fix things:
(repeat steps above)
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
(initramfs) multipath -v0
(initramfs) exit
The initramfs continued on, and the system booted successfully:
$ cat /proc/cmdline /boot/vmlinux- 3.19.0- 9-generic root=UUID= 7fec6766- 3166-4395- 982a-555ecce926 67 ro break=top, post-multipath
BOOT_IMAGE=
$ df / by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 31483800 2375308 27486120 8% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/disk/
$ udevadm info -q path /dev/disk/ by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 virtual/ block/dm- 6
/devices/
Finally, verify the failure hook again, using the 'TIP (not recommended)' steps. single- path device), so you get the usual errors about device-mapper failing to get the underlying because it's locked (root filesystem mountpoint), plus some "waiting" delays.
It boots from the fake symlink (points to underlying/
(repeat steps above)
...
WARNING: the root device is supposed to be a multipath device,
but it doesn't look like one: it doesn't have a multipath-UUID
symlink, but it does have a non-multipath (normal) UUID symlink.
...
(initramfs) uuid=7fec6766- 3166-4395- 982a-555ecce926 67 by-uuid/ multipath- $uuid && exit
(initramfs) ln -s $uuid /dev/disk/
... ..x2dpart3. device (37s / 1min 30s)
Starting LSB: multipath daemon...
[...] device-mapper: table: 252:4: multipath: error getting device
[...] device-mapper: table: 252:4: multipath: error getting device
...
A start job is running for dev-mapp.
...
$ cat /proc/cmdline /boot/vmlinux- 3.19.0- 9-generic root=UUID= 7fec6766- 3166-4395- 982a-555ecce926 67 ro break=top, post-multipath
BOOT_IMAGE=
$ df / by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 31483800 2386948 27474480 8% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/disk/
$ udevadm info -q path /dev/disk/ by-uuid/ multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 vio/71000002/ host0/target0: 0:1/0:0: 1:0/block/ sdb/sdb2
/devices/
$ ls -1 /run/udev/ links/* by-uuid* multipath- 7fec6766- 3166-4395- 982a-555ecce926 67 links/* by-uuid* multipath- 7fec6766- 3166-4395- 982a-555ecce926 67: No such file or directory
ls: cannot access /run/udev/
(i.e., the fake symlink is expectedly not maintained by udev, which is part of why this is not recommended :)
If you remove the UUID option from GRUB, it doesn't touch anything:
# GRUB_DISABLE_ LINUX_UUID= true update-grub 3.19.0- 9-generic root=/dev/ mapper/ mpath1- part2 ro 3.19.0- 9-generic root=/dev/ mapper/ mpath1- part2 ro 3.19.0- 9-generic root=/dev/ mapper/ mpath1- part2 ro recovery nomodeset /boot/vmlinux- 3.19.0- 9-generic root=/dev/ mapper/ mpath1- part2 ro
...
# grep root= /boot/grub/grub.cfg
linux /boot/vmlinux-
linux /boot/vmlinux-
linux /boot/vmlinux-
...
# reboot
...
$ cat /proc/cmdline
BOOT_IMAGE=
$ df / mpath1- part2 31483800 2387108 27474320 8% /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/
So, I believe these tests cover all the functionality added.
Good to go?