[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: ext3 + raid, is resize2fs neccessary?



Andreas Dilger wrote:
> On Oct 15, 2003  10:17 -0400, Eric Wood wrote:
>> Consider this section:
>> http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.14

>> Basically, Step 11 scares the hell out of me which is why I haven't
>> done this on a live system.
>
> You should use resize2fs _before_ you create the MD RAID devices on the
> filesystem, or there is some (small) chance that you overwrite data on the
filesystem.

Yes, I thought resizing before doing the mkraid would make more sense.

> You can use it like:
> new_size = (current_size_in_kb / 64 * 64 - 64), "/" is integer divide
> resize2fs <device> <new_size>

> If you want, you can make your filesystems smaller than that by some
> margin and do the resize2fs afterwards to grow it to fill the full
> device again.
>

I'm still unclear about these questions:
1. Do you have to convert ext3 back to ext2 before resizing, or is resize2fs
"journal-aware"?
I assume "yes".
2. If you shrink the ext3/2 fs, will data occuping those tail-end blocks be
moved, assuming your fs is not full?
I assume "yes"
3. If you shrink your fs by a generous margin, create the raid, and then
re-grow your fs to fill the device again, will resize2fs step on the raid
superblock?
I assume "yes" because if the size parameter is blank, resize2fs "will
default to the size of the partition", therefore stepping no the raid
superblock.  So I'll have to manually figure out the size without stepping
on the last block or two.

I was just hoping that resize2fs would somehow auto-detect a special RAID
blocks and Journal blocks and not step on them.

> I recall that the safer way is to create
> the RAID devices in "degraded" mode with only the real device active,
> then add in the new mirror afterwards so that it guarantees the data
> goes from the real filesystem to the mirror.

Actually, the howto or another howto instructs you to boot with a rescue
disk and make these changes when the master root partition isn't really
active - only mounted.  The information I gather here will be compiled and
sent back to the howto maintainer.  So any insight from Stephen and Theodore
is much appreciated.

-eric wood




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]