Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Production Server HDD Upgrade (SoftwareRaid)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
zark
n00b
n00b


Joined: 27 Mar 2004
Posts: 74
Location: Belgium

PostPosted: Thu Mar 20, 2008 10:50 am    Post subject: Production Server HDD Upgrade (SoftwareRaid) Reply with quote

Hello

I've finally received my new WD 500gb hdd's, which is a good thing because free space is down to 1gb ^^

So my setup is :

gentoo with software mirror raid on 2 Wd 200Gb hdd's

Code:
britney etc # cat raidtab
raiddev         /dev/md0
raid-level      1
nr-raid-disks   2
chunk-size      32
persistent-superblock   1
device          /dev/sda1
raid-disk       0
device          /dev/sdb1
raid-disk       1

raiddev         /dev/md1
raid-level      1
nr-raid-disks   2
chunk-size      32
persistent-superblock   1
device          /dev/sda3
raid-disk       0
device          /dev/sdb3
raid-disk       1


Upgrade procedure

What i was thinking :

* Shutdown the server, remove one of the hdd's and replace with a new one ; boot on live-cd.

* a little e2fsck on the old disk, to make sure data integrity is okay

* format the new hdd with one boot, one main, and one swap partition

* Then, mount both disks

* Then ... copy from one disk to another .. i'm reading different opinions on this one, dump/restore sounds like a good util, but i doubt it's on the livecd :(
some people say cp -a doesn't copy dotted file .. then theres the tar pipe option, and the rsync ... i need opinons for this step?

* Once all data is copied, shutdown the server, remove old disk .. put second new disk in ... boot on liveCD again ... fdisk the second disk to make sure they are the same partitions ... make sure fstab is okay, install grub on both disks.

* Reboot server and cross fingers ...



Right ... last time i set the software raid and put the old disk on usb and copied straight into the final software mirror raid ...
but this time there's 200gb of data, with usb2, i'm scared it might take an awfull long time ...


I need opinions with this ... i'm aiming at minimum downtime ..
I'm actually thinking of copying over everything, except the one website which has 160gb of data. Putting the server backonline, then copying over the website from a usbhdd, that way the server is backonline asap, minimum downtime for mail, dns, and most websites, and the big data will copy overnight or something.
Back to top
View user's profile Send private message
ecosta
Guru
Guru


Joined: 09 May 2003
Posts: 477
Location: Brussels,BE

PostPosted: Thu Mar 20, 2008 10:29 pm    Post subject: Reply with quote

Hello,

I would use rsync to do the job. Works like a charm.

I think you might be missing a point. Your description doesn't seem to mention brub/lilo. Make sure you get the boot record back onto the mbr of both new disks. You might also have to create a degraded software RAID on the new disk and add the second new disk to the raid once the data has been copied. Does your box not have space for 3 disks?

Hope this helps.
-Ed
_________________
Linux user #201331
A8N-SLI Delux / AMD64 X2 3800+ / 1024 MB RAM / 5 x 250 GB SATA RAID 1/5 / ATI Radeon X700 256MB.
Back to top
View user's profile Send private message
zark
n00b
n00b


Joined: 27 Mar 2004
Posts: 74
Location: Belgium

PostPosted: Thu Mar 20, 2008 10:36 pm    Post subject: Reply with quote

thanks for your opinion on using rsync :)


i did mention grub, in my before-last step ^^

and unfortunately, my box is a 1U with only 2 hdd space :(
Back to top
View user's profile Send private message
ecosta
Guru
Guru


Joined: 09 May 2003
Posts: 477
Location: Brussels,BE

PostPosted: Thu Mar 20, 2008 10:42 pm    Post subject: Reply with quote

:oops: blame it on the fact it's almost midnight ;)
Best of luck!
-Ed
_________________
Linux user #201331
A8N-SLI Delux / AMD64 X2 3800+ / 1024 MB RAM / 5 x 250 GB SATA RAID 1/5 / ATI Radeon X700 256MB.
Back to top
View user's profile Send private message
HeissFuss
Guru
Guru


Joined: 11 Jan 2005
Posts: 414

PostPosted: Fri Mar 21, 2008 2:19 am    Post subject: Reply with quote

Since you're already running mirrored partitions, couldn't you set one of the drives up as a mirror, sync it online, then extend the partition/file system and add the second new disk?
Back to top
View user's profile Send private message
zark
n00b
n00b


Joined: 27 Mar 2004
Posts: 74
Location: Belgium

PostPosted: Fri Mar 21, 2008 8:15 am    Post subject: Reply with quote

HeissFuss wrote:
Since you're already running mirrored partitions, couldn't you set one of the drives up as a mirror, sync it online, then extend the partition/file system and add the second new disk?


MMh, don't know if the software raid manager will appreciate mirroring a 200gb partition to a 500gb partition ..
resize2fs only resizes the filesystem and not the partition, unless i could resize the partition after ...

ah okay,
i get it

using PARTED ?

so i'd format my new hdd with same partition scheme as existing hdd, sync it with the old hdd, once synced, i resize the partition and the filesystem, then put the second new disk in, and have it sync, and i'm back online ?

why not ... machine won't be down much, i'd be doing a couple of back&forth to the datacenter though, but better than staying 5hr in there :s
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Sat Mar 22, 2008 4:34 pm    Post subject: Reply with quote

Quote:
Since you're already running mirrored partitions, couldn't you set one of the drives up as a mirror, sync it online, then extend the partition/file system and add the second new disk?


I have done that a few times. Just make sure you get the booting working and all will be well. What I mean about booting is you need to install grub on both the original drives before the swap.

Then when it boots off one old drive with the second new installed. Create a new partition with fdisk on the new drive to be the rest of the disk. Then use mdadm to add the new drive to the old array and let it sync.

Then install grub on the new drive and reboot with only the new drive installed.

Then install the second new drive and use sfdisk to make the partition tables the same on both new drives. Something like:

Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb


Then use mdadm --grow to expand the raid array to the full size of both members.

Then use resize2fs.

Then install grub on the second drive.

I guess this is a lot more steps then I initially thought but I have done this a few times so it becomes very easy...
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum