LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Software RAID1 + Grow Partitions (http://www.linuxquestions.org/questions/linux-server-73/software-raid1-grow-partitions-773774/)

morphix 12-06-2009 05:44 AM

Software RAID1 + Grow Partitions
 
Hi,

Currently i have a server that is setup with 2 discs in RAID1.

Now, 1 disk is 80GB the other is 200GB, and so only 80GB is really being used.

As i am personally relatively new to linux software RAID, i need some assistance.

I am wanting to both replace the 80GB drive with 200GB drive (to match the other drives size) and then grow the last RAID MD (MD4 for eg.) to the rest of the drive (roughly 120gb).

Can someone please advise me the best way and quickest, preferably the quickest to have the system back up and running but both add new drive and grow a RAID partition all at the same time.

The system is using SATA2.

janoszen 12-06-2009 05:06 PM

LVM?
 
mdadm has a --grow option. After using it, you _MUST_ resize the filesystem as well. Note that I have never done this myself.

If I were you, I'd take the following steps (according to the manual):
  • Back up ALL data
  • Test if the boot loader is installed on both drives
  • Fail the 80 gb part of all md devices.
  • Remove the 80 gb disk and try to boot with only one disk.
  • Insert the new disk
  • Resize the MD partition
  • Use mdadm --resize to resize the RAID set
  • Resize the filesystem on the raid set
  • Copy the partition table to the new disk
  • Add the new drives to the raid
  • Install boot loader to the new drive
  • Wait for the resync to finish

You might want to read this: http://www.howtoforge.com/how-to-res...-software-raid

morphix 12-06-2009 08:10 PM

Is there anyway to do this on a running system?

What is required when replacing the 80gb disc to 200gb disc?
Do i need to partition the new drive?

morphix 12-06-2009 09:13 PM

I have tried to follow availabe guides but it doesnt seem to work.

Can someone explain to me how i go about using the free space left on the 200GB drive (about 120gb free) to resize the last partition to take up the remainder of free space?

Currently when i do resize and such, the partition size stays identical :(

janoszen 12-07-2009 12:22 AM

Part table
 
It is possible you need to resize your partition table first. Otherwise I'm out of guesses since I'm lucky enough to have RAID controllers in my boxes.

morphix 12-07-2009 05:00 PM

And how would i go about doing that without screwing up the contents of the drive?

redhat00 12-07-2009 05:21 PM

Quote:

Originally Posted by morphix (Post 3781566)
Hi,

Currently i have a server that is setup with 2 discs in RAID1.

Now, 1 disk is 80GB the other is 200GB, and so only 80GB is really being used.

As i am personally relatively new to linux software RAID, i need some assistance.

I am wanting to both replace the 80GB drive with 200GB drive (to match the other drives size) and then grow the last RAID MD (MD4 for eg.) to the rest of the drive (roughly 120gb).

Can someone please advise me the best way and quickest, preferably the quickest to have the system back up and running but both add new drive and grow a RAID partition all at the same time.

The system is using SATA2.


If you know LVM, it's very easy to do using the commands vgextend,pvmove, and vgreduce.

morphix 12-09-2009 08:19 PM

The system i need to do this on, does not use LVM.

Its just Software RAID-1 with ext3 on 5 partitions and 1 being swap space.

I have managed to correctly grow and shrink primary partitions fine, can someone advise me how i would shrink or grow an extended partition on software raid?

morphix 12-10-2009 10:24 PM

no updates?


All times are GMT -5. The time now is 04:57 PM.