I have a multi-boot, multi-drive system that I want to transfer onto 2 bigger drives.
Currently pc has 2x1TB drives with Fedora 19 running, using RAID0 drive mirroring, with LVM2 on top of the md. I want to transfer the entire md/lvm set of filesystems to a new pair of 2TB drives configured in the same raid0/lvm2 arrangement. In addition to Fedora, there are Windows 7 partitions, and other misc partitions to copy.
To make matters harder, the Fedora root filesystem exists in the md/lvm2 partition, so I need to bring up all this infrastructure. /boot is in a real primary partition.
So I'm able to install the 2 new drives at the same time the old drives are still installed, so it is basically a big copy task, but the details are the tricky part.
Using a GParted Live boot disk, I can go in and configure the new drives in a new raid0 and lvm2 vg called "pool2". The original vg is called "pool". I partition & mount up the new filesystems and tar/copy all the files from old to new. But now the two hard parts are biting me.
- Getting grub2 to install/boot the new copy of the Fedora partition.
- Getting Windows to boot on its new copy.
Actually never to go trying #2, so for #1, Here's details of what I tried, and where I got stuck.
After the copy, I disconnect the old drives and change new drives to sda and sdb. Booting back again with the boot iso, Then I have to manually start the raid0 with the commands:
mdadm -E --scan mdadm -A /dev/md0
No errors, /proc/mdstat shows the raid active with RAID0.
Then I have to manually start the vg with:
vgchange -a y pool2
Now to reinstall grub2 on the new partitions:
mount /dev/mapper/pool2-root /mnt/fedora mount /dev/sda1 /mnt/fedora/boot cd /mnt/fedora mount -o bind /dev dev mount -o bind /proc proc mount -o bind /sys sys mount -t tmpfs tmpfs tmp chroot /mnt/fedora grub2-install /dev/sda
Everything appears to go fine. But when I try to reboot from the new disk drives, I either get nothing as if grub2 isn't found, or I get the grub menu and it then fails during the boot very early, because it can't find the root filesystem.
What I think is happening is all the grub.cfg file is still full of the old references such as:
root=/dev/mapper/pool-root rd.lvm.lv=pool/root and probably UUIDs wrong.
(remember the new drives are on pool2). I also suspect maybe the initrd settings are incorrect for the new locations.
Manually changing these values in grub.cfg don't seem to help, so how can I get this working? I think I'm really close, but having to do a lot of manual md/lvm2/grub2 commands I'm no expert in, and am missing something.
update-grub
, but I'm not sure if Fedora uses the same mechanism. You can rungrub-mkconfig
to generate a newgrub.cfg
. – Gilles 'SO- stop being evil' Mar 30 '14 at 0:54