[rear-users] Restoring mdadm system to a single-disk destination fails
dag at wieers.com
Tue Jul 24 16:37:06 CEST 2012
On Tue, 24 Jul 2012, Cal Sawyer wrote:
> On 24/07/12 14:44, Dag Wieers wrote:
> PS If you are interested in what steps are executed after recovery,
> feel free to dig into the 'finalize' stage (usr/share/rear/finalize).
> Using 'rear -s recover' you can look what exact finalize scripts are
> being run on your system:
> [root at moria ~]# rear -s recover | grep finalize
> Source layout/prepare/default/55_finalize_script.sh
> Source finalize/default/01_prepare_checks.sh
> Source finalize/default/10_populate_dev.sh
> Source finalize/GNU/Linux/15_migrate_disk_devices_layout.sh
> Source finalize/GNU/Linux/15_migrate_uuid_tags.sh
> Source finalize/Fedora/i386/17_rebuild_initramfs.sh
> Source finalize/Linux-i386/21_install_grub.sh
> Source finalize/Linux-i386/22_install_grub2.sh
> Source finalize/GNU/Linux/30_create_mac_mapping.sh
> Source finalize/GNU/Linux/41_migrate_udev_rules.sh
> Source finalize/GNU/Linux/42_migrate_network_configuration_files.sh
> Source finalize/default/88_check_for_mount_by_id.sh
> Source finalize/default/89_finish_checks.sh
> Source finalize/default/90_remount_sync.sh
> As you can see from that, we already migrate devices, rebuild the
> ramdisk and reinstall the bootloader (in case it is GRUB or GRUB2)
> How can one introduce a user-defined finalize script in the workflow? I
> think it would solve my fstab and grub modification needs for this
> very-corner case.
Just add the script in the correct directory. The number (and
name) influences the order in which it is being run. However I prefer if
you share exactly the case at hand so we can fix it not just for you.
In your case I would expect the following procedure:
- boot rescue image
- modify disklayout.conf to remove the md devices, and replace by sd devices
- rear recover
- remove the remaining mdadm stuff (this should be automated in Rear)
If we want to make it possible to have the interactive process to allow
for mapping md devices to sd devices, we will have to analyse what is
needed for this and Jeroen will have to give a green light.
If we want to make it possible to allow these mappings before making the
rescue image, we have to analyse what would be needed for this and Jeroen
will have to give a green light.
Jeroen is best placed to assess if this is something we would want to do
and what the impact is on the current layout engine (he wrote).
-- dag wieers, dag at wieers.com, http://dag.wieers.com/
-- dagit linux solutions, info at dagit.net, http://dagit.net/
[Any errors in spelling, tact or fact are transmission errors]
More information about the rear-users