Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have home server (Ubuntu Server 10.04) which boots from single 80Gb HDD drive, now I want to make it boot from 2x500Gb RAID-1. I've already successfully created it through MDADM.

But how can I move system to this array so that it can boot?

I've seen some guides in the internet about adding second hdd and making RAID1, but this is not my case...

share|improve this question
    
Awesome question!! It would be really good to know how to move a system to a RAID-1 array. –  sebikul Mar 21 '11 at 1:14

2 Answers 2

up vote 2 down vote accepted

Briefly:

  1. make a backup of anything important

  2. make a boot cd or usb stick and test it

  3. make the mirror pair and a partition on it

  4. (optional) make an lvm pv on the partition, then a logical volume on that

  5. dd your existing root filesystem onto that new lv

  6. resize2fs it to grow it to use the new space

  7. reboot, interrupt grub, and set the root= parameter to point to one of your new disks

  8. you should now be up using the new disk; now reinstall grub onto the boot sector of one of the mirrored disks, pointing at the new system

  9. change the machine's bios to boot from one of the mirrored disks

There is some risk these rearrangements will leave your system temporarily unbootable so you should only start on this if you're reasonably confident doing low-level rearrangements and/or you have a second machine you can use to ask for help.

Ask if you need more help on any of these points. If none of them make any sense, you should probably just do a fresh install onto the new disks, unless you have a big appetite for adventure. ;-)

share|improve this answer

Clone the first disk with dd and then restore it on the raid solution.

http://www.backuphowto.info/linux-backup-hard-disk-clone-dd

share|improve this answer
    
I afraid it would not be bootable then. –  BarsMonster Mar 22 '11 at 5:13
    
Because? It's a 100% copy... –  mount.cifs Mar 22 '11 at 5:59
    
Because mdadm stores metadata on the underlying physical device. –  BarsMonster Mar 22 '11 at 8:49
    
Ah, you're using software raid. Then it would be quite hard... –  mount.cifs Mar 22 '11 at 11:14
    
Maybe just copy the files traditionally and then install a bootloader? –  mount.cifs Mar 22 '11 at 11:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.