1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| $ lvcreate -L 1g -n lv_test VG_TEST Logical volume "lv_test" created.
$ lvdisplay /dev/VG_TEST/lv_test --- Logical volume --- LV Path /dev/VG_TEST/lv_test LV Name lv_test VG Name VG_TEST LV UUID MbYfcB-0D9l-rm2E-LhRw-t5Nz-nVru-r5RzBY LV Write Access read/write LV Creation host, time linux130, 2024-02-22 15:26:22 +0800 LV Status available LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2 $ lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_test VG_TEST -wi-a----- 1.00g $ lvscan ACTIVE '/dev/VG_TEST/lv_test' [1.00 GiB] inherit
$ mkfs.ext4 /dev/VG_TEST/lv_test $ mkdir /test $ mount /dev/VG_TEST/lv_test /test $ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VG_TEST-lv_test 976M 2.6M 907M 1% /test
$ lvextend -L +500M /dev/VG_TEST/lv_test Size of logical volume VG_TEST/lv_test changed from 1.00 GiB (256 extents) to <1.49 GiB (381 extents). Logical volume VG_TEST/lv_test successfully resized.
$ df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/VG_TEST-lv_test ext4 976M 2.6M 907M 1% /test
$ resize2fs /dev/VG_TEST/lv_test resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/VG_TEST/lv_test is mounted on /test; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/VG_TEST/lv_test is now 390144 blocks long.
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VG_TEST-lv_test 1.5G 3.0M 1.4G 1% /test
|