Feed on
Posts
Comments

so a couple of weeks ago, i decided to upgrade the hard drives in my server.  previously, i had two 160 GB drives mirrored in a RAID 1 array.  there were several partitions in the array.

after an impulse newegg buy (curse you and your sales newegg!), i had two 750 GB drives i endeavored to install.  things got tricky though: if i wanted to make use of the extra 590 GB of storage, i could:

  • a) copy over the existing partitions and expand one of them to make use of the extra space.
  • b) copy over the existing partitions and then make a new partition to occupy the new space.

since a) looked more complicated, i chose b).  here’s how to do it:

  1. tell mdadm that you are about to remove a hard drive by failing its partitions.
    • sudo mdadm /dev/md0 -f /dev/hdd1 -r /dev/hdd1
    • repeat for each partition
  2. remove the hard drive you just failed.
  3. physically install the new drive where you took the old one from.
  4. copy over your present partition setup:
    • sfdisk -d /dev/hda | sfdisk /dev/sda
  5. add those new partitions to your RAID:
    • mdadm –manage /dev/md0 –add /dev/sda1
  6. create your new partition using cfdisk /dev/sda
    • (note that you want to use a linux RAID autodetect logical filesystem)
  7. now, add the partition to your RAID using mdadm -add
  8. update fstab and create a new directory to mount your new partition at.
  9. reboot
  10. you may have to now make the new filesystem:
    • sudo /sbin/mkfs -t ext3 /dev/md3
  11. return to step 1) and fail the other old hard drive.
  12. install the second new hard drive.
  13. repeat steps 4) and 5).

note that you may also have to install GRUB on the new drives to make the new RAID 1 array bootable.  here’s how to install GRUB.


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

One Response to “increase drive capacity in a raid 1 filesystem setup”

  1. [...] recently installed some massive hard drives in my server box.  given all that space, i thought it’d be perfect to have the mac’s [...]

Did I get this wrong? Let me know!

Trackback URI | Comments RSS