[CentOS] Re: extending ext3 filesystem on logical volume

Fri Aug 18 01:05:48 UTC 2006
William L. Maltby <BillsCentOS at triad.rr.com>

On Thu, 2006-08-17 at 20:08 -0400, James Marcinek wrote:
> do you use resize2fs to do this. If so can you give an example so I make 
> sure I do the syntax properly (man page doesn't show)

<snip>

Including some notes from my last use of this. Change the notes to suit
your particular scenario!

I used the "not really" parameter to make some test runs first. This
allowed me to build and refine a script witout actually doing any real
work (my "Wally" mode).  ;-)

  WARNING! YOU MUST ADD THE -n PARAMETER WITH THE -F SINCE THIS IS LIVE!
  IF YOU FORGET THE -n "WOE BE UNTO THEE"! FORGETTING THE -F is "GLEE BE
  UNTO THEE"!

The new file system size is specified as the number of blocks. I don't
remember if that is just because of my way or needed. "man xxx" to fill
in the blanks.

Per the resize2fs program request, an e2fsck pass is first made.

I suggest specify a value slightly smaller than you think you can
squeeze in and then expand. I was working on making cross-backup on
different HDs, so you'll need to ignore/change the VG and LV names to
suit. These are just examples.

# A "Wally" run here.
# mke2fs -n -F -j -b 4096 -N 410048 /dev/VolGroupAA/lvol0

# Looks good enough
# e2fsck -f /dev/VolGroup00/LogVol00

# no unit on new size (K/M/G...) defaults to the file block size
# resize2fs -p /dev/VolGroup00/LogVol00 2441216 # -p=show activity

Below, it was only NG because my desired size was not as close as I
wanted. Syntactically and semantically, all was good.

# confirm things by running the mke2fs against this and comparing
# ACK! THAT'S ABSOLUTELY NG!
# mke2fs -n -j -b 4096 -N 410048 /dev/VolGroup00/LogVol00

Real run here. A significant note is the "no size on...". It means that
if you don't give a size param to resize2fs, it uses all the space it
can get in the LV. Since my vg/lv setups do not auto-allocate, this is
good.

  # no size on new defaults to all available.
  # e2fsck -f /dev/VolGroup00/LogVol00
  # resize2fs -p /dev/VolGroup00/LogVol00 # -p=show activity

HTH
-- 
Bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20060817/08e40221/attachment-0005.sig>