On 06/07/12 07:24, Alan Chandler wrote:
On 05/07/12 23:10, Tom H wrote:Reading the man page for this doesn't say how it finds out where the root filesystem is. Thats the bit that is confusing me.On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler <alan@chandlerfamily.org.uk> wrote:I am trying to figure out how to move my current rootfs to raid1 (its just apartition at the moment).The plan is to make a a raid device, copy the current root fs in to it - butI then need to tell grub to set up this up as the root for the boot.grub-install /dev/sdXI currently have a root filesystem on /dev/sdb1. I am not sure which disk contains the mbr - but it boots and then loads the root from there.I have created a partially degraded mdadm raid array /dev/md0 comprising /dev/sda1 and an empty slot. My desire is to install grub on both /dev/sda and /dev/sdb to boot up from /dev/md0. When that is working I will retire /dev/sdb1 and add it as the second component of /dev/md0.The magic appears to be in grub-mkconfig (wrapped with update-grub). But I am also confused as to whether I need to do anything about an initramfs.I want to achieve the mimimum of downtime on the machine I am trying to make this work on, and am worried that if I go too far without properly understanding what would happen I may end up with an unbootable system.
I think the answer might be here. http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive I have some other things to do right now, but I will try this out later.It looks as though update-grub and/or grub-install use the current root. So by chrooting into where you want to be you get them all set up.
-- Alan Chandler http://www.chandlerfamily.org.uk