Discussion:
[linux-lvm] filesystem does not reflect new LV size
Vladimir G. Ivanovic
2002-06-06 16:39:02 UTC
Permalink
I must be doing something wrong on my Red Hat 7.3 system with a stock
2.4.18-4 kernel.

I created a logical volume on one physical disk, /dev/hde1, added it to
a (new) volume group, and I mounted it. No problems so far.

# df /dev/ds/lvol1
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/ds/lvol1 156882796 90418200 58495420 61% /mnt/ds

I then created another physical volume on another physical drive

# pvcreate /dev/hda1

and then extended my volume group with the new physical volume

# vgextend ds /dev/hda1

Then I extended the logical volume to it's maximum size on both physical
volumes.

# lvextend -l +168 /dev/ds/lvol1 /dev/hde1
# lvextend -l +14308 /dev/ds/lvol1 /dev/hda1

I don't see any errors when I query the volume group (appended below).
But I can't get the mounted file system to recognize the new size.

# df /dev/ds/lvol1
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/ds/lvol1 156882796 90418200 58495420 61% /mnt/ds

I've dismounted /dev/ds/lvol1 and remounted it. Still no change.

What am I missing?

Thanks.

--- Vladimir

--------
Vladimir G. Ivanovic http://leonora.org/~vladimir
2770 Cowper St. ***@acm.org
Palo Alto, CA 94306-2447 +1 650 678 8014

--------
# vgdisplay -v
--- Volume group ---
VG Name ds
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 1
Open LV 1
MAX LV Size 255.99 GB
Max PV 256
Cur PV 2
Act PV 2
VG Size 208.55 GB
PE Size 4 MB
Total PE 53388
Alloc PE / Size 53388 / 208.55 GB
Free PE / Size 0 / 0
VG UUID uYpJV8-FqdY-n7sW-il1A-v8Np-dvhk-yDCuPp

--- Logical volume ---
LV Name /dev/ds/lvol1
VG Name ds
LV Write Access read/write
LV Status available
LV # 1
# open 1
LV Size 208.55 GB
Current LE 53388
Allocated LE 53388
Allocation next free
Read ahead sectors 1024
Block device 58:0


--- Physical volumes ---
PV Name (#) /dev/hde1 (1)
PV Status available / allocatable
Total PE / Free PE 39080 / 0

PV Name (#) /dev/hda1 (2)
PV Status available / allocatable
Total PE / Free PE 14308 / 0



_______________________________________________
Valhalla-list mailing list
Valhalla-***@redhat.com
https://listman.redhat.com/mailman/listinfo/valhalla-list



--- Vladimir

--------
Vladimir G. Ivanovic http://leonora.org/~vladimir
2770 Cowper St. ***@acm.org
Palo Alto, CA 94306-2447 +1 650 678 8014
Joe Thornber
2002-06-06 17:00:03 UTC
Permalink
Resizing is always done in two steps, these steps are done in a
different order depending whether you are extending or reducing.

Extending:

i) Resize the LV (lvextend)
ii) Resize the filesystem (eg, ext2resize, resize_reiserfs)

Reducing:

i) Resize filesystem.
ii) Resize the LV (lvreduce)


There is a tool called e2fsadm provided in LVM1 which performs both of
these steps iff you are using an ext2 filesystem.

- Joe
Tim
2002-06-06 17:09:01 UTC
Permalink
Hey, out of curiosity, are there folks out there who have mounted an
ext3 filesystem as ext2, resized it, rebuilt the journal, and had good
success with the process? At one point I was twiddling with this, but
instead I spec'd a great big RAID to migrate to and cp'ed it directly.
Unfortunately now that one is filling up and it's as big as Promise
currently makes, so I kind of have to make me a decision...

I'd hate to convert my monster volumes to XFS for this sort of thing
(and AFAIK, ReiserFS is not totally stable with NFS, so that's out of
the question -- anyways, I don't want to take it down if I needn't).
Mostly though, ext3 has been good to us, and I know RedHat will support
both ext3 and LVM in a pinch. Since we use RedHat this is a big plus.

Thanks for any input,

--Tim
Post by Joe Thornber
Resizing is always done in two steps, these steps are done in a
different order depending whether you are extending or reducing.
i) Resize the LV (lvextend)
ii) Resize the filesystem (eg, ext2resize, resize_reiserfs)
i) Resize filesystem.
ii) Resize the LV (lvreduce)
There is a tool called e2fsadm provided in LVM1 which performs both of
these steps iff you are using an ext2 filesystem.
- Joe
_______________________________________________
linux-lvm mailing list
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
--
This is supposed to be a happy occasion.
Let's not bicker and argue about who killed who.
Wolfgang Weisselberg
2002-06-07 01:16:02 UTC
Permalink
Hi, Tim!
Post by Tim
Hey, out of curiosity, are there folks out there who have mounted an
ext3 filesystem as ext2, resized it, rebuilt the journal, and had good
success with the process?
Why would you *mount* a filesystem and resize it, when it's
safer and easier done unmounted?

Simply umount, resize2fs (use e2fsadm as a wrapper, if you are
LVMming), mount it and off you go. To ext2, .journal is but
another file, AFAIK, and if you umounted cleanly, nothing will
have to be played back, AFAIK.

Works well enough for me, when I use it.

-Wolfgang

Vladimir G. Ivanovic
2002-06-06 17:06:02 UTC
Permalink
Post by Joe Thornber
Resizing is always done in two steps, these steps are done in a
different order depending whether you are extending or reducing.
i) Resize the LV (lvextend)
ii) Resize the filesystem (eg, ext2resize, resize_reiserfs)
i) Resize filesystem.
ii) Resize the LV (lvreduce)
There is a tool called e2fsadm provided in LVM1 which performs both of
these steps iff you are using an ext2 filesystem.
Thanks! I assume that ext2resize also works for ext3 filesystems. Do I
have to do anything special about the journal file, which is a hidden
inode.

--- Vladimir

--------
Vladimir G. Ivanovic http://leonora.org/~vladimir
2770 Cowper St. ***@acm.org
Palo Alto, CA 94306-2447 +1 650 678 8014
Vladimir G. Ivanovic
2002-06-06 17:12:02 UTC
Permalink
Actually, my question should have been about resize2fs because that's
what I have on my system.

--- Vladimir

--------
Vladimir G. Ivanovic http://leonora.org/~vladimir
2770 Cowper St. ***@acm.org
Palo Alto, CA 94306-2447 +1 650 678 8014
Post by Joe Thornber
Resizing is always done in two steps, these steps are done in a
different order depending whether you are extending or reducing.
i) Resize the LV (lvextend)
ii) Resize the filesystem (eg, ext2resize, resize_reiserfs)
i) Resize filesystem.
ii) Resize the LV (lvreduce)
There is a tool called e2fsadm provided in LVM1 which performs both of
these steps iff you are using an ext2 filesystem.
VGI> Thanks! I assume that ext2resize also works for ext3 filesystems. Do I
VGI> have to do anything special about the journal file, which is a hidden
VGI> inode.
Vladimir G. Ivanovic
2002-06-06 19:02:02 UTC
Permalink
Well, I ran with the bit between my teeth.... (/dev/ds/lvol1 is my LV)

# tune2fs -O ^has_journal /dev/ds/lvol1
# fsck.ext2 -f /dev/ds/lvol1
# resize2fs /dev/ds/lvol1
# tune2fs -j /dev/ds/lvol1
# mount /dev/ds/lvol1 /mnt/ds
# df /mnt/ds

--- Vladimir

--------
Vladimir G. Ivanovic http://leonora.org/~vladimir
2770 Cowper St. ***@acm.org
Palo Alto, CA 94306-2447 +1 650 678 8014
Jason L Tibbitts III
2002-06-06 19:09:02 UTC
Permalink
VGI> Well, I ran with the bit between my teeth....

I didn't have problems running resize2fs (actually e2fsadm to change
both the LV and filesystem in one go) on plain ext3 without playing
with the journal. You have to unmount it as ext2online doesn't work,
but I was able to grow and shrink an umounted ext3 filesystem
containing data with no problems. Was I just lucky?

- J<
Loading...