grack.com

I spent a few hours this weekend converting my entire Fedora Core 3 system over to EVMS.  The advantage over using one of the other alternatives like the bdclaim patch is that EVMS can manage your root filesystem.  This lets you alter the underlying storage of your root filesystem, including “hotswapping” one storage device for another without having to boot to a shell.

It isn’t straightforward getting this working in Fedora Core.  You’ll need to do some initrd hacking to get it up and running. 

Here’s what you need to do.  Note that this assumes that you are running the same kernel that you’ll be booting:

  1. Mount the EVMS initrd as loopback under /tmp/initrd-loop.

    # mkdir /tmp/initrd
    # mount -o loop evms-initrd /tmp/initrd
    
  2. Delete the /sbin/modprobe symlink from the EVMS initrd and copy it from the Fedora system’s /sbin directory:

    # rm /tmp/initrd/sbin/modprobe
    # cp /sbin/modprobe /tmp/initrd/sbin
    
  3. Create a /lib/modules/`uname -r` directory in the initrd.

    # mkdir /tmp/initrd/lib/modules/`uname -r`
    
  4. Copy the device mapper kernel drivers from the root filesystem to the initrd.

    # cp /lib/modules/`uname -r`/drivers/md/* /tmp/initrd/lib/modules/`uname -r`
    
  5. Run depmod to get the proper modprobe data files.

    # depmod -b /tmp/initrd-loop
    
  6. In the “load modules” section of linuxrc, add “modprobe dm-mod”.
  7. Add the following lines to linuxrc, just before “Pivot-root to /sysroot”:

    # Mount a new tmpfs filesystem on the new system's /dev/ directory
    mount -t tmpfs none /sysroot/dev
    # Copy the evms and console devices to the new directory
    cp -a /dev/* /sysroot/dev/
    
Read full post