* [gentoo-user] Process to resize ext3 file system at the command line?
@ 2011-11-17 17:01 Mark Knecht
2011-11-17 17:25 ` Neil Bothwick
0 siblings, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-17 17:01 UTC (permalink / raw
To: Gentoo User
Hi,
I've got a 3-disk 250GB RAID-1 that I use for short term, on the
machine backups. It's normally not mounted unless I'm doing a quick
save. Unfortunately it's a bit too small these days so I'm therefore
going to convert it to a 3-disk RAID-5 which will double it's size.
I'm pretty sure I've got the command set right to do the RAID-1 to
RAID-5 conversion, but once it's done I believe the file system itself
will still be 250GB so I'll need to resize the file system. In the
past I've done this with gparted, which seems to work fine, but this
time I was considering doing it at the command line. Does anyone know
of a good web site that goes through how to do that? I've browsed
around and found different pages that talk about it but my reading
looks like they all have minor differences which leaves me a bit
worried.
Note that the status of the backup is currently good but if I
happen to lose the data on that partition it won't likely be a big
problem. I'm just trying to get to the end of the process without
losing it if possible.
Thanks,
Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 17:01 [gentoo-user] Process to resize ext3 file system at the command line? Mark Knecht
@ 2011-11-17 17:25 ` Neil Bothwick
2011-11-17 18:29 ` Mark Knecht
2011-11-23 14:02 ` J. Roeleveld
0 siblings, 2 replies; 16+ messages in thread
From: Neil Bothwick @ 2011-11-17 17:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
On Thu, 17 Nov 2011 09:01:46 -0800, Mark Knecht wrote:
> I'm pretty sure I've got the command set right to do the RAID-1 to
> RAID-5 conversion, but once it's done I believe the file system itself
> will still be 250GB so I'll need to resize the file system. In the
> past I've done this with gparted, which seems to work fine, but this
> time I was considering doing it at the command line. Does anyone know
> of a good web site that goes through how to do that? I've browsed
> around and found different pages that talk about it but my reading
> looks like they all have minor differences which leaves me a bit
> worried.
Using cfdisk or fdisk, delete the partition and recreate it, USING THE
SAME START BLOCK at a larger size.
Then "resize2fs /dev/sdwhatever" will resize the filesystem to fill the
partition.
--
Neil Bothwick
I just took an IQ test. The results were negative.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 17:25 ` Neil Bothwick
@ 2011-11-17 18:29 ` Mark Knecht
2011-11-17 18:43 ` Michael Mol
2011-11-23 14:02 ` J. Roeleveld
1 sibling, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-17 18:29 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 9:25 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Thu, 17 Nov 2011 09:01:46 -0800, Mark Knecht wrote:
>
>> I'm pretty sure I've got the command set right to do the RAID-1 to
>> RAID-5 conversion, but once it's done I believe the file system itself
>> will still be 250GB so I'll need to resize the file system. In the
>> past I've done this with gparted, which seems to work fine, but this
>> time I was considering doing it at the command line. Does anyone know
>> of a good web site that goes through how to do that? I've browsed
>> around and found different pages that talk about it but my reading
>> looks like they all have minor differences which leaves me a bit
>> worried.
>
> Using cfdisk or fdisk, delete the partition and recreate it, USING THE
> SAME START BLOCK at a larger size.
>
> Then "resize2fs /dev/sdwhatever" will resize the filesystem to fill the
> partition.
>
>
>
> --
> Neil Bothwick
Really? Delete the partition? Sounds scary! (But actually makes sense.
The data is still there.)
I'm not sure how this works in the case of a RAID though. Here's the
current partition table for sda where sda6, sdb6 & sdc6 are part of
the RAID-1::
c2stable ~ # fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8b45be24
Device Boot Start End Blocks Id System
/dev/sda1 * 63 112454 56196 83 Linux
/dev/sda2 112455 8514449 4200997+ 82 Linux swap / Solaris
/dev/sda3 8594775 113467094 52436160 fd Linux raid autodetect
/dev/sda4 113467095 976768064 431650485 5 Extended
/dev/sda5 113467158 218339414 52436128+ fd Linux raid autodetect
/dev/sda6 481933935 976768064 247417065 83 Linux
/dev/sda7 218339478 481933871 131797197 fd Linux raid autodetect
Partition table entries are not in disk order
c2stable ~ #
It's not that I want to change the partition size of the 3 pieces of
the RAID-1, it's that after I convert the RAID-1 to RAID-5 I want it
to be 500GB.
I asked some questions on the Linux RAID list and putting together
info from a couple of people here's how I'm thinking I proceed with
the conversion:
1) First, fail one disk and clean it up for later:
umount /dev/md6
mdadm --stop /dev/md6
mdadm /dev/md6 --fail /dev/sdc6 --remove /dev/sdc6
mdadm --zero-superblock /dev/sdc6
At this point the RAID-1 is still 3-drives but one is marked 'failed'.
The failed drive is at this point like a new drive as it has no
superblock. (I think...)
2) Now I convert the 3-drive RAID1 to a 2-drive RAID-1:
mdadm --grow /dev/md6 --raid-devices=2
3) Create a 2-drive RAID-5:
mdadm has an 'instantaneous' conversion of RAID-1 to RAID-5 for the
2-drive case because parity of a single drive is just the data itself.
/dev/sdb6 is now 'parity' instead of 'data'.
mdadm /dev/md6 --grow --level=5
4) Add a 3rd drive to the RAID-5:
mdadm /dev/md6 --add /dev/sdc6
mdadm /dev/md6 --grow --raid-devices=3
At this point I was told:
"Now, resize your filesystem to use the additional space."
So, if at this point the end-block of sda6 isn't 976768064 but, let's
say, 700000000 because mdadm set it to something new, then using your
suggestion I guess I'd set it back to 976768064? I'm not comfortable
however that if I do that that whatever is out there beyond 700000000
is really formatted as ext3 and 'empty' as I don't know what the mdadm
conversion has done to it.
Thanks,
Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 18:29 ` Mark Knecht
@ 2011-11-17 18:43 ` Michael Mol
2011-11-17 18:59 ` Mark Knecht
0 siblings, 1 reply; 16+ messages in thread
From: Michael Mol @ 2011-11-17 18:43 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 1:29 PM, Mark Knecht <markknecht@gmail.com> wrote:
> On Thu, Nov 17, 2011 at 9:25 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
>> On Thu, 17 Nov 2011 09:01:46 -0800, Mark Knecht wrote:
>>
>>> I'm pretty sure I've got the command set right to do the RAID-1 to
>>> RAID-5 conversion, but once it's done I believe the file system itself
>>> will still be 250GB so I'll need to resize the file system. In the
>>> past I've done this with gparted, which seems to work fine, but this
>>> time I was considering doing it at the command line. Does anyone know
>>> of a good web site that goes through how to do that? I've browsed
>>> around and found different pages that talk about it but my reading
>>> looks like they all have minor differences which leaves me a bit
>>> worried.
>>
>> Using cfdisk or fdisk, delete the partition and recreate it, USING THE
>> SAME START BLOCK at a larger size.
>>
>> Then "resize2fs /dev/sdwhatever" will resize the filesystem to fill the
>> partition.
>>
>>
>>
>> --
>> Neil Bothwick
>
> Really? Delete the partition? Sounds scary! (But actually makes sense.
> The data is still there.)
>
> I'm not sure how this works in the case of a RAID though. Here's the
> current partition table for sda where sda6, sdb6 & sdc6 are part of
> the RAID-1::
>
> c2stable ~ # fdisk -l /dev/sda
>
> Disk /dev/sda: 500.1 GB, 500107862016 bytes
> 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x8b45be24
>
> Device Boot Start End Blocks Id System
> /dev/sda1 * 63 112454 56196 83 Linux
> /dev/sda2 112455 8514449 4200997+ 82 Linux swap / Solaris
> /dev/sda3 8594775 113467094 52436160 fd Linux raid autodetect
> /dev/sda4 113467095 976768064 431650485 5 Extended
> /dev/sda5 113467158 218339414 52436128+ fd Linux raid autodetect
> /dev/sda6 481933935 976768064 247417065 83 Linux
> /dev/sda7 218339478 481933871 131797197 fd Linux raid autodetect
>
> Partition table entries are not in disk order
> c2stable ~ #
>
> It's not that I want to change the partition size of the 3 pieces of
> the RAID-1, it's that after I convert the RAID-1 to RAID-5 I want it
> to be 500GB.
>
>
> I asked some questions on the Linux RAID list and putting together
> info from a couple of people here's how I'm thinking I proceed with
> the conversion:
>
> 1) First, fail one disk and clean it up for later:
>
> umount /dev/md6
> mdadm --stop /dev/md6
> mdadm /dev/md6 --fail /dev/sdc6 --remove /dev/sdc6
> mdadm --zero-superblock /dev/sdc6
>
> At this point the RAID-1 is still 3-drives but one is marked 'failed'.
> The failed drive is at this point like a new drive as it has no
> superblock. (I think...)
>
> 2) Now I convert the 3-drive RAID1 to a 2-drive RAID-1:
>
> mdadm --grow /dev/md6 --raid-devices=2
>
> 3) Create a 2-drive RAID-5:
>
> mdadm has an 'instantaneous' conversion of RAID-1 to RAID-5 for the
> 2-drive case because parity of a single drive is just the data itself.
> /dev/sdb6 is now 'parity' instead of 'data'.
>
> mdadm /dev/md6 --grow --level=5
>
> 4) Add a 3rd drive to the RAID-5:
>
> mdadm /dev/md6 --add /dev/sdc6
> mdadm /dev/md6 --grow --raid-devices=3
>
>
>
> At this point I was told:
>
> "Now, resize your filesystem to use the additional space."
>
> So, if at this point the end-block of sda6 isn't 976768064 but, let's
> say, 700000000 because mdadm set it to something new, then using your
> suggestion I guess I'd set it back to 976768064? I'm not comfortable
> however that if I do that that whatever is out there beyond 700000000
> is really formatted as ext3 and 'empty' as I don't know what the mdadm
> conversion has done to it.
Your resize would be applied not to /dev/sd?, but to /dev/md?. You
don't need to worry about what that means on /dev/sd*; the filesystem
you want to poke is on /dev/md*.
file -s /dev/sd* /dev/md*
--
:wq
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 18:43 ` Michael Mol
@ 2011-11-17 18:59 ` Mark Knecht
2011-11-17 19:13 ` Michael Mol
2011-11-17 19:47 ` Neil Bothwick
0 siblings, 2 replies; 16+ messages in thread
From: Mark Knecht @ 2011-11-17 18:59 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 10:43 AM, Michael Mol <mikemol@gmail.com> wrote:
> On Thu, Nov 17, 2011 at 1:29 PM, Mark Knecht <markknecht@gmail.com> wrote:
<SNIP>
>> At this point I was told:
>>
>> "Now, resize your filesystem to use the additional space."
>>
>> So, if at this point the end-block of sda6 isn't 976768064 but, let's
>> say, 700000000 because mdadm set it to something new, then using your
>> suggestion I guess I'd set it back to 976768064? I'm not comfortable
>> however that if I do that that whatever is out there beyond 700000000
>> is really formatted as ext3 and 'empty' as I don't know what the mdadm
>> conversion has done to it.
>
> Your resize would be applied not to /dev/sd?, but to /dev/md?. You
> don't need to worry about what that means on /dev/sd*; the filesystem
> you want to poke is on /dev/md*.
>
> file -s /dev/sd* /dev/md*
>
> --
> :wq
Yes, resize would be done to /dev/md?. I agree. However I don't
believe that I'd use Neil's suggestion of fdisk block numbers on
/dev/md, right? That doesn't make sense to me and I don't beleieve
Neil was suggesting anything like that.
I'm thinking that possibly the mdadm way to change the _size_ of a
RAID is to once again use the grow option:
<quote>
-G, --grow
Change the size or shape of an active array.
<quote>
I've not yet found any instructions that I trust to do it though, and
being that the instructions above came from, among others, Neil Brown
who manages mdadm I'm hesitant to go in my own direction. I'm just
looking before I leap.
And fortunately, if I decided to just blow away all three disks and
start from scratch I have very little at risk that way, and very
little risk as I will do backups of the RAID-1 onto an external USB
drive before I start this process anyway.
- Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 18:59 ` Mark Knecht
@ 2011-11-17 19:13 ` Michael Mol
2011-11-17 19:44 ` Mark Knecht
2011-11-17 19:47 ` Neil Bothwick
1 sibling, 1 reply; 16+ messages in thread
From: Michael Mol @ 2011-11-17 19:13 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 1:59 PM, Mark Knecht <markknecht@gmail.com> wrote:
> On Thu, Nov 17, 2011 at 10:43 AM, Michael Mol <mikemol@gmail.com> wrote:
>> On Thu, Nov 17, 2011 at 1:29 PM, Mark Knecht <markknecht@gmail.com> wrote:
> <SNIP>
>>> At this point I was told:
>>>
>>> "Now, resize your filesystem to use the additional space."
>>>
>>> So, if at this point the end-block of sda6 isn't 976768064 but, let's
>>> say, 700000000 because mdadm set it to something new, then using your
>>> suggestion I guess I'd set it back to 976768064? I'm not comfortable
>>> however that if I do that that whatever is out there beyond 700000000
>>> is really formatted as ext3 and 'empty' as I don't know what the mdadm
>>> conversion has done to it.
>>
>> Your resize would be applied not to /dev/sd?, but to /dev/md?. You
>> don't need to worry about what that means on /dev/sd*; the filesystem
>> you want to poke is on /dev/md*.
>>
>> file -s /dev/sd* /dev/md*
>>
>> --
>> :wq
>
> Yes, resize would be done to /dev/md?. I agree. However I don't
> believe that I'd use Neil's suggestion of fdisk block numbers on
> /dev/md, right? That doesn't make sense to me and I don't beleieve
> Neil was suggesting anything like that.
>
> I'm thinking that possibly the mdadm way to change the _size_ of a
> RAID is to once again use the grow option:
>
> <quote>
> -G, --grow
> Change the size or shape of an active array.
> <quote>
>
> I've not yet found any instructions that I trust to do it though, and
> being that the instructions above came from, among others, Neil Brown
> who manages mdadm I'm hesitant to go in my own direction. I'm just
> looking before I leap.
>
> And fortunately, if I decided to just blow away all three disks and
> start from scratch I have very little at risk that way, and very
> little risk as I will do backups of the RAID-1 onto an external USB
> drive before I start this process anyway.
Ok, I thought you had it clear how you were going to resize the raid,
and needed help resizing the filesystem that already existed on top of
the RAID. I interpreted Mark's instructions as operating under that
impression, too.
Are you saying you don't already have a partition table sitting on top
of /dev/md? ?
--
:wq
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 19:13 ` Michael Mol
@ 2011-11-17 19:44 ` Mark Knecht
2011-11-17 19:51 ` Michael Mol
0 siblings, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-17 19:44 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 11:13 AM, Michael Mol <mikemol@gmail.com> wrote:
> On Thu, Nov 17, 2011 at 1:59 PM, Mark Knecht <markknecht@gmail.com> wrote:
<SNIP>
> Ok, I thought you had it clear how you were going to resize the raid,
> and needed help resizing the filesystem that already existed on top of
> the RAID. I interpreted Mark's instructions as operating under that
> impression, too.
>
> Are you saying you don't already have a partition table sitting on top
> of /dev/md? ?
>
OK, I'm getting a little confused because I am Mark. Maybe you meant Neil above?
Anyway, yes, my question in the title is still the question. If, as I
understand reading between the lines, that the mdadm conversion from
RAID-1 to RAID-5 leaves me with a 250GB RAID-5 then how do I make it a
500GB RAID-5? My assumption right now is that mdadm won't change the
partition sizing so what I need to do is just resize the filesystem
and (I think) what I want are the right commands to run with something
like resize2fs, where you check, then resize, then check again:
e2fsck -f /dev/md6
resize2fs /dev/md6
e2fsck -f /dev/md6
However one site I found said to convert it to ext2 first - removing
the journal - and then adding the journal back in later.
- Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 18:59 ` Mark Knecht
2011-11-17 19:13 ` Michael Mol
@ 2011-11-17 19:47 ` Neil Bothwick
2011-11-17 20:34 ` Mark Knecht
1 sibling, 1 reply; 16+ messages in thread
From: Neil Bothwick @ 2011-11-17 19:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
On Thu, 17 Nov 2011 10:59:06 -0800, Mark Knecht wrote:
> Yes, resize would be done to /dev/md?. I agree. However I don't
> believe that I'd use Neil's suggestion of fdisk block numbers on
> /dev/md, right? That doesn't make sense to me and I don't beleieve
> Neil was suggesting anything like that.
Yes I was. /dev/md? is still a block device, and its blocks correspond to
physical blocks on the component drives.
--
Neil Bothwick
There are only two tragedies in life: one is not getting what one wants;
and the other is getting it. - Oscar Wilde (1854-1900)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 19:44 ` Mark Knecht
@ 2011-11-17 19:51 ` Michael Mol
0 siblings, 0 replies; 16+ messages in thread
From: Michael Mol @ 2011-11-17 19:51 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 2:44 PM, Mark Knecht <markknecht@gmail.com> wrote:
> On Thu, Nov 17, 2011 at 11:13 AM, Michael Mol <mikemol@gmail.com> wrote:
>> On Thu, Nov 17, 2011 at 1:59 PM, Mark Knecht <markknecht@gmail.com> wrote:
> <SNIP>
>> Ok, I thought you had it clear how you were going to resize the raid,
>> and needed help resizing the filesystem that already existed on top of
>> the RAID. I interpreted Mark's instructions as operating under that
>> impression, too.
>>
>> Are you saying you don't already have a partition table sitting on top
>> of /dev/md? ?
>>
> OK, I'm getting a little confused because I am Mark. Maybe you meant Neil above?
Ok, yeah, I'm totally confused myself. I'm going to split my
concentration fewer ways for a bit and not try to write emails while a
test suite runs. :)
--
:wq
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 19:47 ` Neil Bothwick
@ 2011-11-17 20:34 ` Mark Knecht
2011-11-17 23:59 ` Neil Bothwick
0 siblings, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-17 20:34 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 11:47 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Thu, 17 Nov 2011 10:59:06 -0800, Mark Knecht wrote:
>
>> Yes, resize would be done to /dev/md?. I agree. However I don't
>> believe that I'd use Neil's suggestion of fdisk block numbers on
>> /dev/md, right? That doesn't make sense to me and I don't beleieve
>> Neil was suggesting anything like that.
>
> Yes I was. /dev/md? is still a block device, and its blocks correspond to
> physical blocks on the component drives.
>
>
> --
> Neil Bothwick
OK, so returning to your original response, you suggest increasing the
size of each physical partition and then resizing each of the physical
partitions independently? (/dev/sdwhatever instead of /dev/md6
directly?)
Is there a reason or personal experience you have to not to resize the
RAID-5 directly? I completely trust you as to date I cannot remember
anything you suggested I do that wasn't a good way to do it but doing
/dev/sdwhatever seems problematic if it had been an 8-drive RAID-1
becoming a RAID-5, etc.
- Mark
<quote>
Using cfdisk or fdisk, delete the partition and recreate it, USING THE
SAME START BLOCK at a larger size.
Then "resize2fs /dev/sdwhatever" will resize the filesystem to fill the
partition.
</quote>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 20:34 ` Mark Knecht
@ 2011-11-17 23:59 ` Neil Bothwick
2011-11-18 0:13 ` Mark Knecht
0 siblings, 1 reply; 16+ messages in thread
From: Neil Bothwick @ 2011-11-17 23:59 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 882 bytes --]
On Thu, 17 Nov 2011 12:34:14 -0800, Mark Knecht wrote:
> OK, so returning to your original response, you suggest increasing the
> size of each physical partition and then resizing each of the physical
> partitions independently? (/dev/sdwhatever instead of /dev/md6
> directly?)
>
> Is there a reason or personal experience you have to not to resize the
> RAID-5 directly?
Do you have separately partitioned drives with those partitions arranged
into single-partition arrays, or do you have one RAID device that is then
partitioned?
If the latter, you should certainly work with the md device.
I prefer to avoid all this confusion by creating a large, single
partition array that I use an an LVM physical volume.
--
Neil Bothwick
"You know how dumb the average person is? Well, statistically, half of
them are even dumber than that" - Lewton, P.I.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 23:59 ` Neil Bothwick
@ 2011-11-18 0:13 ` Mark Knecht
2011-11-18 0:21 ` Neil Bothwick
0 siblings, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-18 0:13 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 3:59 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Thu, 17 Nov 2011 12:34:14 -0800, Mark Knecht wrote:
>
>> OK, so returning to your original response, you suggest increasing the
>> size of each physical partition and then resizing each of the physical
>> partitions independently? (/dev/sdwhatever instead of /dev/md6
>> directly?)
>>
>> Is there a reason or personal experience you have to not to resize the
>> RAID-5 directly?
>
> Do you have separately partitioned drives with those partitions arranged
> into single-partition arrays, or do you have one RAID device that is then
> partitioned?
>
> If the latter, you should certainly work with the md device.
>
> I prefer to avoid all this confusion by creating a large, single
> partition array that I use an an LVM physical volume.
Separately partitioned drives arranged into RAID arrays.
I don't do LVM. Every time I look at the instructions for setting it
up I fall asleep. Also, I have varying needs in terms of space, speed
& redundancy, so I'm not clear that a single RAID of any type with LVM
on top would have met my needs.
- Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-18 0:13 ` Mark Knecht
@ 2011-11-18 0:21 ` Neil Bothwick
2011-11-18 0:33 ` Mark Knecht
0 siblings, 1 reply; 16+ messages in thread
From: Neil Bothwick @ 2011-11-18 0:21 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
On Thu, 17 Nov 2011 16:13:09 -0800, Mark Knecht wrote:
> > Do you have separately partitioned drives with those partitions
> > arranged into single-partition arrays, or do you have one RAID device
> > that is then partitioned?
> >
> > If the latter, you should certainly work with the md device.
> >
> > I prefer to avoid all this confusion by creating a large, single
> > partition array that I use an an LVM physical volume.
>
> Separately partitioned drives arranged into RAID arrays.
So you have three partitions arranged into a single RAID5 partition,
say /dev/md1?
In that case, the size of /dev/md1 should already be correct and you only
need to resize the filesystem and you should ignore my witterings about
fdisk that filed to take into account your use of RAID.
resize2fs /dev/md1 should be all you need, you shouldn't even need to
unmount the filesystem.
--
Neil Bothwick
Top Oxymorons Number 12: Plastic glasses
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-18 0:21 ` Neil Bothwick
@ 2011-11-18 0:33 ` Mark Knecht
2011-11-24 9:00 ` J. Roeleveld
0 siblings, 1 reply; 16+ messages in thread
From: Mark Knecht @ 2011-11-18 0:33 UTC (permalink / raw
To: gentoo-user
On Thu, Nov 17, 2011 at 4:21 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Thu, 17 Nov 2011 16:13:09 -0800, Mark Knecht wrote:
>
>> > Do you have separately partitioned drives with those partitions
>> > arranged into single-partition arrays, or do you have one RAID device
>> > that is then partitioned?
>> >
>> > If the latter, you should certainly work with the md device.
>> >
>> > I prefer to avoid all this confusion by creating a large, single
>> > partition array that I use an an LVM physical volume.
>>
>> Separately partitioned drives arranged into RAID arrays.
>
> So you have three partitions arranged into a single RAID5 partition,
> say /dev/md1?
>
> In that case, the size of /dev/md1 should already be correct and you only
> need to resize the filesystem and you should ignore my witterings about
> fdisk that filed to take into account your use of RAID.
> resize2fs /dev/md1 should be all you need, you shouldn't even need to
> unmount the filesystem.
>
I have 3 partitions which were previously RAID-1. I've already failed
one drive so at this moment it's a 2-drive RAID-1. I'm attempting to
get those two remaining 2 partitions converted to RAID-5 the command
suggested on the RAID list for doing that isn't working for me.
Once the 250GB RAID-1 is converted to RAID-5 i have to add a new drive
back in to become a 3-drive RAID-5. The drive I add will be the drive
I just failed.
c2stable ~ # mdadm --grow /dev/md6 --level=5
mdadm: /dev/md6: could not set level to raid5
c2stable ~ #
c2stable ~ # mdadm -D /dev/md6
/dev/md6:
Version : 1.1
Creation Time : Thu Apr 15 10:45:35 2010
Raid Level : raid1
Array Size : 247416933 (235.96 GiB 253.35 GB)
Used Dev Size : 247416933 (235.96 GiB 253.35 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Thu Nov 17 13:27:20 2011
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : c2stable:6 (local to host c2stable)
UUID : 249c7331:a8203540:c8f3b020:fb30a66b
Events : 1039
Number Major Minor RaidDevice State
0 8 6 0 active sync /dev/sda6
1 8 22 1 active sync /dev/sdb6
c2stable ~ #
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-17 17:25 ` Neil Bothwick
2011-11-17 18:29 ` Mark Knecht
@ 2011-11-23 14:02 ` J. Roeleveld
1 sibling, 0 replies; 16+ messages in thread
From: J. Roeleveld @ 2011-11-23 14:02 UTC (permalink / raw
To: gentoo-user
On Thu, November 17, 2011 6:25 pm, Neil Bothwick wrote:
> On Thu, 17 Nov 2011 09:01:46 -0800, Mark Knecht wrote:
>
>> I'm pretty sure I've got the command set right to do the RAID-1 to
>> RAID-5 conversion, but once it's done I believe the file system itself
>> will still be 250GB so I'll need to resize the file system. In the
>> past I've done this with gparted, which seems to work fine, but this
>> time I was considering doing it at the command line. Does anyone know
>> of a good web site that goes through how to do that? I've browsed
>> around and found different pages that talk about it but my reading
>> looks like they all have minor differences which leaves me a bit
>> worried.
>
> Using cfdisk or fdisk, delete the partition and recreate it, USING THE
> SAME START BLOCK at a larger size.
>
> Then "resize2fs /dev/sdwhatever" will resize the filesystem to fill the
> partition.
This would only be relevant when the raid-device itself is partitioned.
If the filesystem spans the entire block-device, this can be achieved by
the following:
resize2fs /dev/whatever
--
Joost
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Process to resize ext3 file system at the command line?
2011-11-18 0:33 ` Mark Knecht
@ 2011-11-24 9:00 ` J. Roeleveld
0 siblings, 0 replies; 16+ messages in thread
From: J. Roeleveld @ 2011-11-24 9:00 UTC (permalink / raw
To: gentoo-user
On Fri, November 18, 2011 1:33 am, Mark Knecht wrote:
> On Thu, Nov 17, 2011 at 4:21 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
>> On Thu, 17 Nov 2011 16:13:09 -0800, Mark Knecht wrote:
>>
>>> > Do you have separately partitioned drives with those partitions
>>> > arranged into single-partition arrays, or do you have one RAID device
>>> > that is then partitioned?
>>> >
>>> > If the latter, you should certainly work with the md device.
>>> >
>>> > I prefer to avoid all this confusion by creating a large, single
>>> > partition array that I use an an LVM physical volume.
>>>
>>> Separately partitioned drives arranged into RAID arrays.
>>
>> So you have three partitions arranged into a single RAID5 partition,
>> say /dev/md1?
>>
>> In that case, the size of /dev/md1 should already be correct and you
>> only
>> need to resize the filesystem and you should ignore my witterings about
>> fdisk that filed to take into account your use of RAID.
>> resize2fs /dev/md1 should be all you need, you shouldn't even need to
>> unmount the filesystem.
>>
>
> I have 3 partitions which were previously RAID-1. I've already failed
> one drive so at this moment it's a 2-drive RAID-1. I'm attempting to
> get those two remaining 2 partitions converted to RAID-5 the command
> suggested on the RAID list for doing that isn't working for me.
>
> Once the 250GB RAID-1 is converted to RAID-5 i have to add a new drive
> back in to become a 3-drive RAID-5. The drive I add will be the drive
> I just failed.
>
> c2stable ~ # mdadm --grow /dev/md6 --level=5
> mdadm: /dev/md6: could not set level to raid5
> c2stable ~ #
>
> c2stable ~ # mdadm -D /dev/md6
> /dev/md6:
> Version : 1.1
> Creation Time : Thu Apr 15 10:45:35 2010
> Raid Level : raid1
> Array Size : 247416933 (235.96 GiB 253.35 GB)
> Used Dev Size : 247416933 (235.96 GiB 253.35 GB)
> Raid Devices : 2
> Total Devices : 2
> Persistence : Superblock is persistent
>
> Update Time : Thu Nov 17 13:27:20 2011
> State : clean
> Active Devices : 2
> Working Devices : 2
> Failed Devices : 0
> Spare Devices : 0
>
> Name : c2stable:6 (local to host c2stable)
> UUID : 249c7331:a8203540:c8f3b020:fb30a66b
> Events : 1039
>
> Number Major Minor RaidDevice State
> 0 8 6 0 active sync /dev/sda6
> 1 8 22 1 active sync /dev/sdb6
> c2stable ~ #
I have never had to change a RAID-1 to RAID-5, but I would do it as follows:
1) Fail 2 drives from the RAID-1
2) Remove those 2 drives from the RAID-1
3) Create a new RAID-5 (with failed disk) using the 2 removed drives
4) Copy the data over from the RAID-1 to the RAID-5
5) Remove the RAID-1
6) Add the third drive to the RAID-5 and let it rebuild.
I don't know the commands for the above from memory, but I'm sure some of
this is in the man-page.
--
Joost
>
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-11-24 9:01 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 17:01 [gentoo-user] Process to resize ext3 file system at the command line? Mark Knecht
2011-11-17 17:25 ` Neil Bothwick
2011-11-17 18:29 ` Mark Knecht
2011-11-17 18:43 ` Michael Mol
2011-11-17 18:59 ` Mark Knecht
2011-11-17 19:13 ` Michael Mol
2011-11-17 19:44 ` Mark Knecht
2011-11-17 19:51 ` Michael Mol
2011-11-17 19:47 ` Neil Bothwick
2011-11-17 20:34 ` Mark Knecht
2011-11-17 23:59 ` Neil Bothwick
2011-11-18 0:13 ` Mark Knecht
2011-11-18 0:21 ` Neil Bothwick
2011-11-18 0:33 ` Mark Knecht
2011-11-24 9:00 ` J. Roeleveld
2011-11-23 14:02 ` J. Roeleveld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox