1. Filesystem / Volume vergrößern
# pvscan
PV /dev/sdb1 VG oravg lvm2 [8.00 GB / 4.00 GB free]
PV /dev/sda2 VG VolGroup00 lvm2 [5.88 GB / 0 free]
Total: 2 [13.87 GB] / in use: 2 [13.87 GB] / in no VG: 0 [0 ]
-- Volume um 100MB vergrößern
# lvextend -L +100M /dev/oravg/u01
Extending logical volume u01 to 4.10 GB
Logical volume u01 successfully resized
-- Filesystem hat noch gleiche größe.
# df -k /u01
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/oravg-u01 4128448 3091588 827148 79% /u01
# pvscan
PV /dev/sdb1 VG oravg lvm2 [8.00 GB / 3.90 GB free]
PV /dev/sda2 VG VolGroup00 lvm2 [5.88 GB / 0 free]
Total: 2 [13.87 GB] / in use: 2 [13.87 GB] / in no VG: 0 [0 ]
-- Mount Point wird jetzt vergrößert.
# resize2fs -p /dev/oravg/u01 resize2fs 1.39 (29-May-2006) Filesystem at /dev/oravg/u01 is mounted on /u01; on-line resizing required
Performing an on-line resize of /dev/oravg/u01 to 1074176 (4k) blocks. The filesystem on /dev/oravg/u01 is now 1074176 blocks long.
-- Fertig mit den vergrößern.
# df -k /u01
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/oravg-u01 4228792 3091588 922372 78% /u01
2. Filesystem / Volume verkleinern.
# pvscan
PV /dev/sdb1 VG oravg lvm2 [8.00 GB / 2.90 GB free]
PV /dev/sda2 VG VolGroup00 lvm2 [5.88 GB / 0 free]
Total: 2 [13.87 GB] / in use: 2 [13.87 GB] / in no VG: 0 [0 ]
# df -m /TEST
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/oravg-vlTEST 1008 34 924 4% /TEST
# cd /TEST
# df -k > TEST.log
# ls -l
-rw-r--r-- 1 root root 520 Sep 29 15:42 TEST.log
- Mountpoint muss unmount durchgeführt werden.
# umount /TEST # e2fsck -f /dev/mapper/oravg-vlTEST e2fsck 1.39 (29-May-2006) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information TEST: 12/131072 files (8.3% non-contiguous), 12646/262144 blocks
-- Filesystem wird verkleinert.
# resize2fs /dev/mapper/oravg-vlTEST 800M
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/mapper/oravg-vlTEST to 204800 (4k) blocks.
The filesystem on /dev/mapper/oravg-vlTEST is now 204800 blocks long.
-- Volume wird verkleinert.
# lvreduce -L 800M /dev/oravg/vlTEST WARNING: Reducing active logical volume to 800.00 MB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce vlTEST? [y/n]: y Reducing logical volume vlTEST to 800.00 MB Logical volume vlTEST successfully resized
# mount /dev/mapper/oravg-vlTEST /TEST
# df -m /TEST
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/oravg-vlTEST 786 34 721 5% /TEST
# cd /TEST
# ls -la
-rw-r--r-- 1 root root 520 Sep 29 15:42 TEST.log
# pvscan
PV /dev/sdb1 VG oravg lvm2 [8.00 GB / 3.12 GB free]
PV /dev/sda2 VG VolGroup00 lvm2 [5.88 GB / 0 free]
Total: 2 [13.87 GB] / in use: 2 [13.87 GB] / in no VG: 0 [0 ]