Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raid5 question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Rustylinux
Apprentice
Apprentice


Joined: 17 Jun 2006
Posts: 154

PostPosted: Thu Aug 23, 2007 9:02 pm    Post subject: Raid5 question Reply with quote

Hello,

I currently have a server with a hardware raid controller in it and 3 80GB drives setup as a raid 5 for my data. My question is how would I go about expanding this array? After i put the 4th new drive in and set it up in the raid controller how do i setup the file allocation tables in the linux os to expand the raid 5 onto the new drive / volume. Or what do I have to do to get that new 4th drive part of the other raid 5 volume?

To better explain my question in windows after you add the new drive to the raid5 configuration on the raid controller you would extend the raid 5 volume onto the new unallocated space. How would i accomplish this with gentoo / linux ?
Back to top
View user's profile Send private message
Rob1n
l33t
l33t


Joined: 29 Nov 2003
Posts: 714
Location: Cambridge, UK

PostPosted: Thu Aug 23, 2007 9:34 pm    Post subject: Reply with quote

Is it a true hardware RAID controller (megaraid, 3ware, etc)?

If so, you'll need to expand the array in the controller config (if it supports expansion - some older controllers don't). This'll then show up as a larger disk under Linux (try "fdisk -l /dev/sda" - it should show the disk size at the top). You can then either create a new partition or extend the existing partition. To increase the size of a partition just delete it using fdisk and recreate it with the same starting point but a larger size. You can then extend the filesystem using resize2fs, resize_reiserfs or whatever.

If it's a firmware RAID controller then you'll be using dmraid I guess - I've no idea how to expand that I'm afraid.

And if it's a software RAID array then mdadm will allow you to grow the array. You'll then need to expand the partition and filesystem as above.
Back to top
View user's profile Send private message
Rustylinux
Apprentice
Apprentice


Joined: 17 Jun 2006
Posts: 154

PostPosted: Thu Aug 23, 2007 9:39 pm    Post subject: Reply with quote

Hello,

Thanks for the post. The raid controller is a 3com and it does allow for the expansion of a raid 5 howerver it was the software part after that which is what i was unsure about. In the process you layed out with using fdisk -l and removing and readding the partion I would loose data with that process wouldn't I ?? the extension has to be done with out loosing data. Will this work without losing any data?
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Aug 23, 2007 9:56 pm    Post subject: Reply with quote

I think the least scary option is gparted - It's basically Partition Magic for Linux :)

Alternatives:
If you have LVM, there is a way to extend the LVM partition, then expand the ext3 filesystem with resize2fs to fill the new partition.

I'm using Linux software RAID5, and was a bit sneaky - I put my ext3 filesystem directly into /dev/md0, so if I ever expand the array I can just use
Code:
resize2fs
to frow the filesystem into the extra space without needing to partiton :mrgreen:

The fdisk option I've heard bandied around - fdisk doesn't wipe the diak data, just the partition table, so theoretically it's possible to delete the partiton, and re-create it in exactly the same place, only bigger, and then use resize2fs.
This is scary 'tho and I wouldn't dare do it without backing up first.

But then again if you can back up the whole partiton first, it's easier just to backup, wipe, recreate, restore...
Back to top
View user's profile Send private message
Rob1n
l33t
l33t


Joined: 29 Nov 2003
Posts: 714
Location: Cambridge, UK

PostPosted: Thu Aug 23, 2007 11:53 pm    Post subject: Reply with quote

Rustylinux wrote:
Hello,

Thanks for the post. The raid controller is a 3com and it does allow for the expansion of a raid 5 howerver it was the software part after that which is what i was unsure about. In the process you layed out with using fdisk -l and removing and readding the partion I would loose data with that process wouldn't I ?? the extension has to be done with out loosing data. Will this work without losing any data?

The partition data is stored separately from the filesystem so you can quite safely delete & recreate partitions. The only issue will be if you dont recreate it with the same starting point, in which case it will just fail to mount and you can retry (this is unlikely to happen though as partitions are usually created without any gaps, so the default start position will be immediately after the end of the last partition, which will also be the start position of the old partition). Just make sure you store the output of "fdisk -l -u" before doing anything so you can recreate the original partitions if needed.

As pointed out, gparted is another option (providing your array isn't too large - it seems to fail with > 2TB array) which does exactly the same thing behind the scenes but presents a more friendly face.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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