Ubuntu在docker pull ** 时报错:/var/lib/docker/tmp/GetImageBlob***: no space left on device
程序员文章站
2022-05-11 15:42:47
...
1.df -h查看磁盘使用情况
[email protected]:/usr/local/docker/tomcat/ROOT# df -h
Filesystem Size Used Avail Use% Mounted on
udev 451M 0 451M 0% /dev
tmpfs 97M 1.2M 96M 2% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 3.9G 3.8G 0 100% /
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/loop0 91M 91M 0 100% /snap/core/6350
/dev/sda2 976M 143M 767M 16% /boot
tmpfs 97M 0 97M 0% /run/user/0
/dev/loop1 89M 89M 0 100% /snap/core/7396
发现/dev/mapper/ubuntu–vg-ubuntu–lv磁盘满了
2.扩容(LVM)磁盘
1.显示存在的卷组
sudo vgdisplay
[email protected]:/usr/local/docker/tomcat/ROOT# sudo vgdisplay
--- Volume group ---
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
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 <19.00 GiB
PE Size 4.00 MiB
Total PE 4863
Alloc PE / Size 1024 / 4.00 GiB
Free PE / Size 3839 / <15.00 GiB
VG UUID 0wPFbX-c5cC-Cg1R-9H6K-zL5X-8cC0-NmjN63
Alloc PE / Size 1024 / 4.00 GiB
Free PE / Size 3839 / <15.00 GiB
第一个是 /dev/mapper/ubuntu–vg-ubuntu–lv 这个磁盘
第二个是 这个磁盘可以扩容的大小
2.开始扩容
sudo lvextend -L 10G /dev/mapper/ubuntu–vg-ubuntu–lv
扩容10G
3.重新计算磁盘大小
sudo resize2fs /dev/mapper/ubuntu–vg-ubuntu–lv
成功
[email protected]:/usr/local/docker/tomcat/ROOT# sudo vgdisplay
--- 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 <19.00 GiB
PE Size 4.00 MiB
Total PE 4863
Alloc PE / Size 2560 / 10.00 GiB
Free PE / Size 2303 / <9.00 GiB
VG UUID 0wPFbX-c5cC-Cg1R-9H6K-zL5X-8cC0-NmjN63
[email protected]:/usr/local/docker/tomcat/ROOT# df -h
Filesystem Size Used Avail Use% Mounted on
udev 451M 0 451M 0% /dev
tmpfs 97M 1.2M 96M 2% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 9.8G 3.8G 5.6G 41% /
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/loop0 91M 91M 0 100% /snap/core/6350
/dev/sda2 976M 143M 767M 16% /boot
tmpfs 97M 0 97M 0% /run/user/0
/dev/loop1 89M 89M 0 100% /snap/core/7396