Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

resize2fs

686 views
Skip to first unread message

Rick Pasotto

unread,
Jan 9, 2008, 10:30:11 PM1/9/08
to
I would like to increase the size of my /var partition. It is a logical
volume so I made it bigger with lvexpand. I then ran resize2fs, which
according to the man page works on mounted file systems with kernels
after 2.6 and my kernel is 2.6.22-3-k7. However, this is the output of
the command:

resize2fs 1.40.3 (05-Dec-2007)
Filesystem at /dev/vg0/var is mounted on /var; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 2
resize2fs: Filesystem does not support online resizing

The mount command gives:

/dev/mapper/vg0-var on /var type ext3 (rw)

Is online resizing a compile time flag that debian doesn't set?

lvdisplay now gives:

--- Logical volume ---
LV Name /dev/vg0/var
VG Name vg0
LV UUID SnuTgs-0Lvs-2BmS-TqQ8-Onj0-3xss-SrMjPS
LV Write Access read/write
LV Status available
# open 1
LV Size 25.00 GB
Current LE 6400
Segments 3
Allocation inherit
Read ahead sectors 0
Block device 254:2

but df still gives:

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg0-var 15G 12G 2.1G 86% /var

Has the file system been expanded or not? Do I need to reboot to get
things in sync? I can't unmount/mount /var since many processes use it.

--
"Experience is that marvelous thing that enables you recognize a mistake
when you make it again." -- Franklin P. Jones
Rick Pasotto ri...@niof.net http://www.niof.net


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Andrew Reid

unread,
Jan 9, 2008, 11:10:10 PM1/9/08
to
On Wednesday 09 January 2008 22:26, Rick Pasotto wrote:
> I would like to increase the size of my /var partition. It is a logical
> volume so I made it bigger with lvexpand. I then ran resize2fs, which
> according to the man page works on mounted file systems with kernels
> after 2.6 and my kernel is 2.6.22-3-k7. However, this is the output of
> the command:
>
> resize2fs 1.40.3 (05-Dec-2007)
> Filesystem at /dev/vg0/var is mounted on /var; on-line resizing required
> old desc_blocks = 1, new_desc_blocks = 2
> resize2fs: Filesystem does not support online resizing

I ran into this a while ago also, I have no explanation.
But I know the next one:

>
> lvdisplay now gives:
>
> --- Logical volume ---
> LV Name /dev/vg0/var

> ...
> LV Size 25.00 GB
> ...


>
> but df still gives:
>
> Filesystem Size Used Avail Use% Mounted on
> /dev/mapper/vg0-var 15G 12G 2.1G 86% /var
>
> Has the file system been expanded or not?

No, the file system has not been resized yet, only the
(virtual) device on which it resides has been resized.
Rebooting in and of itself won't change this.

It may be possible to reboot with init=/bin/sh, which
will not start many processes, and resize it from that
environment. You may have to manually activate the lv
before you can talk to it.

Possibly somebody else has a less drastic suggestion?

-- A.
--
Andrew Reid / rei...@bellatlantic.net

Daniel Burrows

unread,
Jan 10, 2008, 12:50:12 AM1/10/08
to
On Wed, Jan 09, 2008 at 10:26:54PM -0500, Rick Pasotto <ri...@niof.net> was heard to say:

> I would like to increase the size of my /var partition. It is a logical
> volume so I made it bigger with lvexpand. I then ran resize2fs, which
> according to the man page works on mounted file systems with kernels
> after 2.6 and my kernel is 2.6.22-3-k7. However, this is the output of
> the command:
>
> resize2fs 1.40.3 (05-Dec-2007)
> Filesystem at /dev/vg0/var is mounted on /var; on-line resizing required
> old desc_blocks = 1, new_desc_blocks = 2
> resize2fs: Filesystem does not support online resizing

AIUI this means you didn't create the filesystem with "-O resize_inode",
so you can't do online resizing. Unfortunately there's no way to change
this after the filesystem is created (see bug #351720), so you're stuck
booting into single-user mode and unmounting /var, or making a boot disk
and running resize2fs from there.

Daniel

Theodore Tso

unread,
Jan 10, 2008, 8:40:08 AM1/10/08
to
On Wed, Jan 09, 2008 at 09:45:30PM -0800, Daniel Burrows wrote:
> > resize2fs: Filesystem does not support online resizing
>
> AIUI this means you didn't create the filesystem with "-O resize_inode",
> so you can't do online resizing. Unfortunately there's no way to change
> this after the filesystem is created (see bug #351720), so you're stuck
> booting into single-user mode and unmounting /var, or making a boot disk
> and running resize2fs from there.

Well, there *is*, but you have to run an off-line program once
(ext2prepare, in the ext2resize package first). The reason why that
program hasn't been integrated into e2fsprogs is because I looked at
the source code, and it was too scary for me to support. I used to
tell people though that while *I* was too chicken to support it, as
far as I knew no one had ever reported data loss, they'd have to
decide on their own whether they felt comfortable using it.

Unfortunately, a few months ago someone actually told me about
ext2prepare corrupting their filesystem, so I can't say that anymore.
I don't know whether the *single* report was due to hardware errors
(and the person getting unlucky), or filesystem corruption that had
been lurking on the filesystem that interacted extremely tragically
with ext2prepare. So use ext2prepare at your own risk. YMMV. Past
results do not indicate future returns, etc.

If you only need to resize your filesystem once, you're better just
doing an offline resize.

- Ted

P.S. New versions of e2fsprogs request the online resizing inode, so
you don't need to specify -O resize_inode. In fact, which features
are enabled by default can be found in /etc/mke2fs.conf.

Douglas A. Tutty

unread,
Jan 10, 2008, 11:50:11 AM1/10/08
to
On Wed, Jan 09, 2008 at 10:26:54PM -0500, Rick Pasotto wrote:
> I would like to increase the size of my /var partition. It is a logical
> volume so I made it bigger with lvexpand. I then ran resize2fs, which
> according to the man page works on mounted file systems with kernels
> after 2.6 and my kernel is 2.6.22-3-k7. However, this is the output of
> the command:
>

If this is an old filesystem (with out the rsize bit [I forget what that
is called] set) and you may want to resize in the future and on-line
resizing is important to you, it may be better to recreate the
filesystem.

This is easy if you have enough free space. Create a temporary LV the
same size the current one, put a new filesystem on it (with the correct
resize option if necessary), then copy the data over using a method that
doesn't change ownership, mtime, (and possibly atime if any scripts rely
on that re cleaning out or backing up stuff). See the multi-disk HOWTO
for some options. There's tar, rsync, cp -a (?).

Once this is done and the system is running on the new filesystem and
the old is unmounted, delete the old LV and extend the new one and
resize the filesystem.

Doug.

0 new messages