[kwlug-disc] Swapping drives on server

john at netdirect.ca john at netdirect.ca
Fri Jan 15 17:14:12 EST 2010

kwlug-disc-bounces at kwlug.org wrote on 01/15/2010 04:48:25 PM:
> From: "Insurance Squared Inc." <gcooke at insurancesquared.com>
> OK, so lets say I make this swap. the last upgrade I'd like to do is
> my hard drives. 
> Does anyone have experience with upgrading the HD's in a linux raid?
> I've got a 73 gig with the OS installed in it, and 2 73gigs running 
> raid with my /home directory running on it.  I want to make those 2 
> 73 gig hd's actually be my two 135gig hd's. 
> Can I just pull drive 3 and install a 135 gig, wait for the rebuild,
> the pull drive 2, install a second 135 gig,wait for the rebuild, and
> done?  then when things settle down go into my config utility and 
> resize the drives?
> that's the way it's supposed to work right?  that's why I've got 
> raid running on my production servers?  or should I forget about 
> upgrading my hard drives and go back to sleep? 

There are going to be three issues. First you want to move the data from 
the 72GB set to the 135GB set, then you need to expand the file system, 
then you need to set the boot sectors.

Resizing the partitions is easy if you are using Logical Volumes and a 
file system that can be resized online like a ext3. You're home directory 
can be resized by taking it off-line first. Root file system needs online 
(or boot into a live CD.) /usr and /var can be tricky too.

Linux RAID is configured for partitions and so it doesn't mirror the boot 
sector information. This is something you would have to change as well.

I'm pretty sure you can create a three or four set mirror so you can 
mirror your data to the new disk set. Then remove the 73GB disks from the 
mirror. You still have to fix the boot sectors though.

Once idea is to use something like mkcdrec or mondo and create a rescue 
set. You would need a large enough off-line storage to accommodate, like a 
series of DVDs. Then put the new disks in and run the rescue. The benefit 
of this is that you have an easy back-out plan. If something doesn't work 
just put the old disks in. Mkcdrec and mondo would be useful for your 
system disks. Your data disks can be done by manually moving data.

This type of scenario is a little scary. I rarely do something like this 
that doesn't require a rescue disk and some serious grub-install or mdadm 
work. That might just be because I don't read the instructions. Or it 
could be because there are many ways to configure disks and file systems 
that there isn't a one-size-fits-all solution.

I learned a long time ago how to fix non-booting Unix/Linux systems and it 
has removed much stress in my life. It's reasonably simple and it's made 
failed upgrades and disk migrations like this nothing more than a 
nuisance. Are my presentation slides on on this topic on KWLUG?

John Van Ostrand
Net Direct Inc.
564 Weber St. N. Unit 12
Waterloo, ON N2L 5C6
john at netdirect.ca
Ph: 866-883-1172
Linux Solutions / IBM Hardware
Fx: 519-883-8533

More information about the kwlug-disc mailing list