User Tools

Site Tools


ubuntu-raid1-conversion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu-raid1-conversion [2009/10/29 18:27] snargubuntu-raid1-conversion [2009/10/30 17:46] (current) snarg
Line 24: Line 24:
 Command (m for help): p Command (m for help): p
  
-Disk /dev/sdb: 500.1 GB, 500107862016 bytes +Disk /dev/sdb: 40.1 GB, 40020664320 bytes 
-255 heads, 63 sectors/track, 60801 cylinders+255 heads, 63 sectors/track, 4865 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes Units = cylinders of 16065 * 512 = 8225280 bytes
 Disk identifier: 0xeea1cf79 Disk identifier: 0xeea1cf79
Line 214: Line 214:
 </code> </code>
 Now go back to the original terminal window and type: Now go back to the original terminal window and type:
 +<code>
 sudo nano /mnt/temp-newroot/etc/fstab sudo nano /mnt/temp-newroot/etc/fstab
 </code> </code>
Line 229: Line 230:
 Use CTRL+W to save the fstab and exit nano text file editor. Use CTRL+W to save the fstab and exit nano text file editor.
  
-==12. Adjust UUID in /boot/grub/menu.lst to point to the new arrays==+==12. Adjust UUID in /boot/grub/menu.lst to point to the new root array==
 This step will cause the bootloader to load up using the raid array (/dev/md0) instead of the old drive (/dev/sda1). This change is only temporary, as we are editting the file on the OLD root partition. We will fix this to be permanent once we reboot into the new system. This step will cause the bootloader to load up using the raid array (/dev/md0) instead of the old drive (/dev/sda1). This change is only temporary, as we are editting the file on the OLD root partition. We will fix this to be permanent once we reboot into the new system.
 <code> <code>
Line 315: Line 316:
 Also a one-liner: Also a one-liner:
 <code> <code>
-sudo mdadm --manage /dev/md1 --add /dev/sda2+sudo mdadm --manage /dev/md1 --add /dev/sda5
 </code> </code>
-==17. Watch some rebuild stats. - all done.== +==17. Watch some rebuild stats. Dont forget the important last step.==
-Voila!+
  
 Type "cat /proc/mdstat"  to get an idea of how the resync of both RAID-1 arrays is going. You can run this command as many times as you like, to monitor the progress. At the end of the resync, both arrays should show "[UU]" instead of "[U_]" Type "cat /proc/mdstat"  to get an idea of how the resync of both RAID-1 arrays is going. You can run this command as many times as you like, to monitor the progress. At the end of the resync, both arrays should show "[UU]" instead of "[U_]"
Line 336: Line 336:
 </code> </code>
  
 +==18. Final update to the bootloader to account for the first drive being changed.==
 +Use nano to edit your /boot/grub/device.map
 +<code>
 +sudo nano /boot/grub/device.map
 +</code>
 +And make sure it looks like this: (note this should be the same as your bios hard disk boot order)
 +<code>
 +(hd0)   /dev/sda
 +(hd1)   /dev/sdb
 +</code>
 +Type this to finalise the bootloader config and Master Boot Record on both hard disks:
 +<code>
 +sudo update-grub
 +sudo grub-install /dev/sda
 +sudo grub-install /dev/sdb
 +</code>
 +\\
 +ALL DONE!!
 +\\
 +update- 20091030 - Please note that at time of writing there is a bug in GRUB 1.97 which causes a boot delay of about 10-20 seconds for boot partitions on RAID-1. This is a known problem and is being worked on. Please see: [[https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/396564]]
ubuntu-raid1-conversion.1256812060.txt.gz · Last modified: 2009/10/29 18:27 by snarg