我有一个全新的 Ubuntu 20.04,使用默认设置安装了 50GB 磁盘大小。
现在我没有任何剩余空间了/dev/mapper/ubuntu--vg-ubuntu--lv
。
df -h
Filesystem Size Used Avail Use% Mounted on
udev 951M 0 951M 0% /dev
tmpfs 199M 1.2M 198M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 24G 24G 0 100% /
tmpfs 994M 0 994M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 994M 0 994M 0% /sys/fs/cgroup
/dev/sda2 976M 199M 711M 22% /boot
/dev/loop1 56M 56M 0 100% /snap/core18/1988
/dev/loop0 55M 55M 0 100% /snap/core18/1880
/dev/loop2 70M 70M 0 100% /snap/lxd/19188
/dev/loop3 71M 71M 0 100% /snap/lxd/19647
/dev/loop5 30M 30M 0 100% /snap/snapd/8542
/dev/loop4 33M 33M 0 100% /snap/snapd/11107
/dev/mapper/vg_tor-lvm_tor 5.0T 3.6T 1.2T 76% /mnt/tor
192.168.255.116:/transit 20T 14T 6.9T 66% /mnt/transit
tmpfs 199M 0 199M 0% /run/user/1000
我尝试了以下步骤
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
和
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
我收到以下错误
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 7
resize2fs: Permission denied to resize filesystem
和
sudo 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 = 4, new_desc_blocks = 7
resize2fs: Permission denied to resize filesystem
我在这里做错了什么?
有关 lvms 的更多信息。
lv显示器
--- Logical volume ---
LV Path /dev/ubuntu-vg/ubuntu-lv
LV Name ubuntu-lv
VG Name ubuntu-vg
LV UUID QYE7ld-fwnU-pm8J-jmag-W4H0-6Pjv-af9OIw
LV Write Access read/write
LV Creation host, time ubuntu-server, 2021-03-13 15:30:58 +0000
LV Status available
# open 1
LV Size <49.00 GiB
Current LE 12543
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
显示
--- Volume group ---
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size <49.00 GiB
PE Size 4.00 MiB
Total PE 12543
Alloc PE / Size 12543 / <49.00 GiB
Free PE / Size 0 / 0
VG UUID h01gbA-v0mW-bPqM-GADT-e7oZ-VBtL-8HtVdt
光伏显示器
--- Physical volume ---
PV Name /dev/sda3
VG Name ubuntu-vg
PV Size <49.00 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 12543
Free PE 0
Allocated PE 12543
PV UUID k6Xr9q-XSeB-35id-DMOp-bAWH-tVNC-PgCVNW
答案1
我下载了 systemresc cdhttps://www.system-rescue.org/然后我执行了之前的命令。它成功了,现在我有了 50GB 的磁盘空间。