Ask Your Question
0

Invalid root fs hooks in initramfs after cloning system

asked 2015-01-30 07:17:00 -0600

nxxy gravatar image

My aim is to be able to backup a running Fedora system to a separate hard disk and be able to boot it in case my current hard disk fails. I imagine using LVM2 to create snapshots, which I can backup while the system is running. My central problem is in reassigning the root system hooks for the backup system. I can edit /etc/fstab and the grub2 entry to use the backup logical volume, which works fine. The problem is that the cloned initramfs seems to still have invalid root fs hooks. Booting the backup will only work if the source hard drive is still operational. Otherwise I get: dracut-initqueue: /dev/[source] does not exist while booting. I need to run dracut --regenerate-all --force within the backup in order to untie it from the source. How can I achieve this without having to boot the backup first?

I found ties in the initramfs here: ./usr/lib/dracut/hooks/ ./etc/systemd/system/

Note that if I would get dracut to ignore the boot error this would actually suffice. I tested this by creating an empty dummy filesystem with the required id on the backup hard drive.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-02-02 04:37:07 -0600

nxxy gravatar image

updated 2015-02-03 03:48:58 -0600

The solution is to disable the hostonly option (which is surprisingly "on" by default), either by modifying it in /usr/lib/dracut/dracut.conf.d/01-dist.conf or by using the --no-hostonly as a command line argument for dracut.

An initramfs generated without the "hostonly" mode, does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image.

from Dracut Doc

As a side note: make sure you edit /etc/default/grub -> GRUB_CMDLINE_LINUX to include rd.auto=1 and rd.lvm=1.

Related reading: [1] [2]

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-01-30 07:17:00 -0600

Seen: 696 times

Last updated: Feb 03 '15