[linux-lvm] LVM2: Problems with "lvextend" on device with mounted filesystem

Uli Heller uli at daemons-point.com
Fri Nov 28 08:21:02 UTC 2003

Hash: SHA1


I'm using LVM1 for quite a while now and it works fine with me.
This week, I tried to use linux-2.6.0-test11 so I had to move to
LVM2 and device mapper. It works - at least partially.

A) works OK for all existing LVs
B) online resizing does not work

At first, I thought that "reiserfs" might be responsible for
this. But after some tests, I don't think so any more.
Here is what i did to test:

1) Create a new logical volume:
~   lvcreate -L 100M -n ulilv systemvg
2) Display this new LV:
~   lvdisplay -c /dev/systemvg/ulilv
~     /dev/systemvg/ulilv:systemvg:3:1:-1:0:204800:25:-1:0:0:254:5
3) Try to write right behind the end of the LV:
~   dd if=/dev/zero of=/dev/systemvg/ulilv seek=204800 bs=512 count=5
~   dd: writing `/dev/systemvg/ulilv': No space left on device
~   1+0 records in
~   0+0 records out
~   --> This error message is OK
4) Extend the LV:
~   lvextend -L +100M /dev/systemvg/ulilv
5) Repeat step 3
~   dd if=/dev/zero of=/dev/systemvg/ulilv seek=204800 bs=512 count=5
~   5+0 records in
~   5+0 records out
~   --> OK, now the LV is large enough
6) Remove the LV
~   lvremove -f /dev/systemvg/ulilv

As expected - you might think.
Now a slight variation:

1 and 2) Like above
2.5)     Create and mount a file system on the LV:
~   mkreiserfs -f /dev/systemvg/ulilv
~   mount /dev/systemvg/ulilv /mnt
3,4,5)   Like above **BUT** step 5 now produces the same
~   error message as step 3! You have to "umount /mnt"
~   in order to be able to access the enlarged portion
~   of the LV.

I checked it with
- - linux-2.6.0-test11
- - linux-2.6.0-test5 (from SuSE-9.0)
and with "mkreiserfs" and with "mke2fs" on step 2.5).
Everything produces the same result.

With lvm1 and linux-2.4.21 from the rescue system
of SuSe-9.0 it works as expected (= no error message
on step 5).

I upgraded to
- - lvm2-2.00.08
- - device-mapper-1.00.07
but the error still exists.

Then I migrated to the new metadata format
with "vgconvert -M2 systemvg" but the error
still exists.

Thanks for any ideas/suggestions...

- --
Mit frohem Gruße, Uli Heller

daemons point, Gesellschaft für Datenverarbeitung mbH
Zahn-Nopper-Str. 1-3                 Phone: +49-711-806708-0
70435 Stuttgart                      Fax:   +49-711-806708-19
Version: GnuPG v1.0.7 (GNU/Linux)


More information about the linux-lvm mailing list