Using the lvextend command
128 words
To extend a regular ext3 filesystem on-line you’d use lvextend
&
resize2fs
[root@foohost]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-root
9.7G 2.5G 6.8G 27% /
/dev/mapper/vg00-var 9.7G 1.6G 7.7G 18% /var
/dev/mapper/vg00-foohost
49G 44G 2.3G 96% /var/foohost
...
[root@foohost]# lvextend -l 2400 /dev/mapper/vg00-foohost
Extending logical volume foohost to 75.00 GB
Logical volume foohost successfully resized
lvextend -l +100%FREE /dev/mapper/vg00-barhost resize2fs /dev/mapper/vg00-barhost
[root@foohost]# resize2fs /dev/mapper/vg00-foohost
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/vg00-foohost is mounted on
/var/foohost; on-line resizing required
Performing an on-line resize of /dev/mapper/vg00-foohost to
19660800 (4k) blocks.
The filesystem on /dev/mapper/vg00-foohost is now 19660800 blocks
long.
[root@foohost]# df -h -l
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-root
9.7G 2.5G 6.8G 27% /
/dev/mapper/vg00-var 9.7G 1.6G 7.7G 18% /var
/dev/mapper/vg00-foohost
73G 44G 26G 64% /var/foohost