导航摘要
root@jack:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 948M 0 948M 0% /dev
tmpfs 199M 1.1M 198M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 9.8G 4.2G 5.1G 45% /
tmpfs 992M 0 992M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 992M 0 992M 0% /sys/fs/cgroup
/dev/loop0 62M 62M 0 100% /snap/core20/1328
/dev/loop1 68M 68M 0 100% /snap/lxd/21835
/dev/sda2 1.5G 110M 1.3G 8% /boot
/dev/loop2 44M 44M 0 100% /snap/snapd/14978
tmpfs 199M 0 199M 0% /run/user/0
root@jack:~#
root@jack:~# fdisk -l
Disk /dev/loop0: 61.93 MiB, 64917504 bytes, 126792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 67.25 MiB, 70508544 bytes, 137712 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 43.6 MiB, 45703168 bytes, 89264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 58535BBF-9B80-4893-8549-607CF682F850
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 3149823 3145728 1.5G Linux filesystem
/dev/sda3 3149824 41940991 38791168 18.5G Linux filesystem
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@jack:~#
lvextend -L 20G /dev/mapper/ubuntu--vg-ubuntu--lv //增大或减小至20G
lvextend -L +20G /dev/mapper/ubuntu--vg-ubuntu--lv //增加20G
lvreduce -L -20G /dev/mapper/ubuntu--vg-ubuntu--lv //减小20G
lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv //按百分比扩容
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv //执行调整
root@jack:~# lvextend -L 18.5G /dev/ubuntu-vg/ubuntu-lv
Insufficient free space: 10 extents needed, but only 9 available
root@jack:~#
root@jack:~# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 3
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 4848640 (4k) blocks long.
root@jack:~#
温馨提示:1、本内容转载于网络,版权归原作者所有!2、本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。3、本内容若侵犯到你的版权利益,请联系我们,会尽快给予删除处理!