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

Re: ext3 + raid, is resize2fs neccessary?

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
> I have not done this before and I'm leary about Step 11 which is resizing
> the filesystem after doing a mkraid command.  This howto lacks any ext3
> documentation.  Some questions I have are:
> 1. Should I convert back to ext2 on all my filesystems before I do a mkraid?
> 2. If I leave the system at ext3, will the mkraid conflict with the journal?
> Is resize2fs even neccessary now-a-days?
> 3. If so, in the future, can ext3 compensate for a potential raid situation
> (reserving that meta-block) so that e2fsck and resize2fs won't be
> neccessary.
> Basically, Step 11 scares the hell out of me which is why I haven't done
> this on a live system.

This "HOWTO" is dangeous and incorrect.  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.  You can use it like:

	resize2fs <device> <new_size>

where <size> is current size rounded down to a multiple of 64kB, less 64kB, so

	new_size = (current_size_in_kb & ~63 - 64)
	new_size = (current_size_in_kb / 64 * 64 - 64), "/" is integer divide

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.

Also, I don't use MD RAID, but creating the MD devices with both disks active
is IMHO risky.  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.

As always, you are strongly encouraged to have a backup.  Assume everything
will blow up and then if it doesn't you've saved yourself a restore.

Cheers, Andreas
Andreas Dilger

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