** Mark Rogers mark@quarella.co.uk [2009-08-14 15:07]:
I have a server which has 1 drive holding the O/S, and 4-off 500GB drives as two pairs of RAID1 (mdraid) arrays.
I want to replace the 500GB drives with 1TB drives.
What is the best way to do this?
Ideally I'd do it offline, just copy (and resize) the partitions across and then put the disks back into the machine and boot it. But I don't know if there's any software that would allow me to do that.
So all suggestions welcome.
(I don't recall now why I have 2-off RAID1 arrays; a single RAID 5 array might be a better use of the drives, in which case the same question arises: how do I migrate to that configuration?)
** end quote [Mark Rogers]
I did this a while back and it was quite straightforward with the RAID mirrors I use. In simple terms the process was this:
o I dropped one of the drives out of the mirror and fitted the first of the new drives (that gave me an instantly safe backup for the process) o Then I partitioned the drive using the same layout as the original, but with the new partition sizes (each of equal or larger size than the originals) o Next I resynced all the partitions so I had the same setup on one old drive and one new drive (wasting for the time being the extra space o Once this had completed safely I dropped the second old drive out of the mirror and fitted the second new drive in its place o Then, as with the first, I partitioned using the same layout, but with the new partition sizes o Next it was a case of syncing the drives so that I now had the exact same setup as before on the new drives, but with wasted space on the partitions
Now comes the 'clever' bit:
o First you need to grow the RAID to use the extra space available in the partition with something like: mdadm --grow /dev/md5 --size=max o Next unmount the partition and use e2fsck -f to check it o Then you can resize the file system on the raid with something like: resize2fs /dev/md5 o Finally mount the drive again.
Of course I was luck in that I didn't need to resize /var, but I did clash with doing this to /, and I think I used a boot CD to do this from, although my notes seem to be missing that bit for some reason!
Of course the I should finish with the disclaimer that this worked fine for me, but make sure you have backups, make sure you understand what is happening as you go along and do so at your own risk :)
I would assume that the same process could be used with other RAID formats, but I've not played with migrating between RAID types, which I would suspect would be more complex given the differing nature of the layout of data on the disks used.