| View previous topic :: View next topic |
| Author |
Message |
clytle374 Apprentice

Joined: 01 Aug 2006 Posts: 153
|
Posted: Mon Mar 03, 2008 12:09 am Post subject: Resizing software raid0 partitions, ext3[solved] |
|
|
I have 3 drives with a raid0 partition on each, making up my root array /dev/md1
Each drive has a unused partition behind the main, that i want to incorporate into my main.
I booted to the live CD, with fdisk I deleted each and recreated them with the same start point.
Machine would not reboot saying no superblock on each partition. I then tried using mdadm off the live CD, tried forcing, scanning, and everything else.
I figured I lost it all, but using fdisk again remade them back to the original sizes and it works fine. So fdisk doesn't destroy and data.
How do I tell mdadm to find the superblocks and rebuild the array? _________________ NooB since RedHat 6.1
Last edited by clytle374 on Mon Mar 03, 2008 10:09 pm; edited 1 time in total |
|
| Back to top |
|
 |
BradN Advocate


Joined: 19 Apr 2002 Posts: 2270 Location: Wisconsin (USA)
|
Posted: Mon Mar 03, 2008 1:40 am Post subject: |
|
|
| Just create a new array using the same settings and it'll work fine. I had to do this for a raid-5 that got 2 drives de-synced once. |
|
| Back to top |
|
 |
clytle374 Apprentice

Joined: 01 Aug 2006 Posts: 153
|
Posted: Mon Mar 03, 2008 1:44 am Post subject: |
|
|
| BradN wrote: | | Just create a new array using the same settings and it'll work fine. I had to do this for a raid-5 that got 2 drives de-synced once. |
That won't kill the data? _________________ NooB since RedHat 6.1 |
|
| Back to top |
|
 |
BradN Advocate


Joined: 19 Apr 2002 Posts: 2270 Location: Wisconsin (USA)
|
Posted: Mon Mar 03, 2008 1:54 am Post subject: |
|
|
| Nope. For the redundancy based RAID levels, it will synchronize the data (ie, a parity disk will be overwritten with calculated data from the other disks), but it won't make any effort to erase the data. |
|
| Back to top |
|
 |
clytle374 Apprentice

Joined: 01 Aug 2006 Posts: 153
|
Posted: Mon Mar 03, 2008 2:38 am Post subject: |
|
|
| BradN wrote: | | Nope. For the redundancy based RAID levels, it will synchronize the data (ie, a parity disk will be overwritten with calculated data from the other disks), but it won't make any effort to erase the data. |
This is not redundant, it is RAID 0
So your saying delete and recreate my partitions as before, same start point, and new end point?
And then | Code: | | mdadm --create --level=0 --raid-devices=3 /dev/md1 /dev/hdb2 /dev/sda2 /dev/sdb2 |
And it will still work?
Thanks _________________ NooB since RedHat 6.1 |
|
| Back to top |
|
 |
BradN Advocate


Joined: 19 Apr 2002 Posts: 2270 Location: Wisconsin (USA)
|
Posted: Mon Mar 03, 2008 5:29 am Post subject: |
|
|
Make sure the devices are in the exact same order. Other than that, it should work fine. I'm not 100% sure about changing the size this way, but I can't imagine how it wouldn't work (since the metadata is stored at the end, and garbage after the partition won't be a problem). After it's created, you should be able to resize the ext3.
If in doubt, try it out on a dummy raid made up of loop devices or extra partitions on another hard drive. |
|
| Back to top |
|
 |
clytle374 Apprentice

Joined: 01 Aug 2006 Posts: 153
|
Posted: Mon Mar 03, 2008 6:21 am Post subject: |
|
|
| BradN wrote: | Make sure the devices are in the exact same order. Other than that, it should work fine. I'm not 100% sure about changing the size this way, but I can't imagine how it wouldn't work (since the metadata is stored at the end, and garbage after the partition won't be a problem). After it's created, you should be able to resize the ext3.
If in doubt, try it out on a dummy raid made up of loop devices or extra partitions on another hard drive. |
The same order physically? Or in the --create line?
Any sure way to resize? _________________ NooB since RedHat 6.1 |
|
| Back to top |
|
 |
BradN Advocate


Joined: 19 Apr 2002 Posts: 2270 Location: Wisconsin (USA)
|
Posted: Mon Mar 03, 2008 9:37 pm Post subject: |
|
|
The same order in the --create line.
Like I said, you can experiment with a dummy array to get the feel for it, but as long as the start positions, device order, and the chunk size are the same (if you don't specify it, the defaults should be the same), it should work fine.
Also note that since the metadata is added at the end of the partitions, you should be able to read only mount the raid and investigate it without worrying about trashing the data, since it shouldn't be modified in any case.
Now, if this were a linear raid (append style), then you would have the extra problem of making sure the device sizes are the exact same as it wants, or the filesystem driver will explode when it tries to deal with something not on the first device...
As far as resizing, the only sure-fire way is copying the data to something else, making a new raid of the desired size, then copying it back. |
|
| Back to top |
|
 |
clytle374 Apprentice

Joined: 01 Aug 2006 Posts: 153
|
Posted: Mon Mar 03, 2008 10:08 pm Post subject: |
|
|
Well it works, I recreated the partitions, created the array, and ran resize2fs on it.
All is well thanks. _________________ NooB since RedHat 6.1 |
|
| Back to top |
|
 |
|