Ubuntu 20.04 根目录扩容

root@master:~# lvs
  LV        VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <49.00g
root@master:~# vgs
  VG        #PV #LV #SN Attr   VSize   VFree
  ubuntu-vg   1   1   0 wz--n- <98.00g 49.00g
root@master:~# pvs
  PV         VG        Fmt  Attr PSize   PFree
  /dev/sda3  ubuntu-vg lvm2 a--  <98.00g 49.00g
root@master:~# lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0                       7:0    0  63.5M  1 loop /snap/core20/2015
loop1                       7:1    0 111.9M  1 loop /snap/lxd/24322
loop2                       7:2    0  63.4M  1 loop /snap/core20/1974
loop3                       7:3    0  53.3M  1 loop /snap/snapd/19457
loop4                       7:4    0  40.8M  1 loop /snap/snapd/20092
sda                         8:0    0   100G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     2G  0 part /boot
└─sda3                      8:3    0    98G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0    49G  0 lvm  /var/lib/containers/storage/overlay
                                                    /
sr0                        11:0    1  1024M  0 rom

root@master:~# lvextend -L +49G /dev/ubuntu-vg/ubuntu-lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from <49.00 GiB (12543 extents) to <98.00 GiB (25087 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.
root@master:~# df -Th
Filesystem                        Type     Size  Used Avail Use% Mounted on
tmpfs                             tmpfs    791M  3.3M  788M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4      48G   40G  6.4G  86% /
tmpfs                             tmpfs    3.9G     0  3.9G   0% /dev/shm
tmpfs                             tmpfs    5.0M     0  5.0M   0% /run/lock
/dev/sda2                         ext4     2.0G  251M  1.6G  14% /boot
tmpfs                             tmpfs    791M  4.0K  791M   1% /run/user/0


root@master:~# resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 25689088 (4k) blocks long.

root@master:~# df -Th
Filesystem                        Type     Size  Used Avail Use% Mounted on
tmpfs                             tmpfs    791M  3.3M  788M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4      97G   40G   53G  43% /
tmpfs                             tmpfs    3.9G     0  3.9G   0% /dev/shm
tmpfs                             tmpfs    5.0M     0  5.0M   0% /run/lock
/dev/sda2                         ext4     2.0G  251M  1.6G  14% /boot
tmpfs                             tmpfs    791M  4.0K  791M   1% /run/user/0
ext4 resize2fs

xfs  xfs_growfs 

你可能感兴趣的:(ubuntu,数据库,linux)