更多内容,请查看博客原文 解决ubuntu上回环设备-dev-loop0占用100-的问题
当前ubuntu环境
cat /etc/issue
Ubuntu 19.04 \n \l
当我们查看文件系统占用情况时,发现有/dev/loop0至/dev/loop7占用率为100%。
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 796M 1.9M 794M 1% /run
/dev/sda1 20G 18G 1.1G 95% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 15M 15M 0 100% /snap/gnome-characters/254
/dev/loop2 90M 90M 0 100% /snap/core/6673
/dev/loop1 3.8M 3.8M 0 100% /snap/gnome-system-monitor/77
/dev/loop3 152M 152M 0 100% /snap/gnome-3-28-1804/31
/dev/loop4 36M 36M 0 100% /snap/gtk-common-themes/1198
/dev/loop7 1.0M 1.0M 0 100% /snap/gnome-logs/61
/dev/loop6 54M 54M 0 100% /snap/core18/941
/dev/loop5 4.2M 4.2M 0 100% /snap/gnome-calculator/406
tmpfs 796M 36K 795M 1% /run/user/1000
/dev/loopn这些设备在Linux下被称为回环设备。
可以通过执行losetup
命令查看所有回环设备。
losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 1 1 /var/lib/snapd/snaps/gnome-system-monitor_77.snap 0 512
/dev/loop6 0 0 1 1 /var/lib/snapd/snaps/core18_941.snap 0 512
/dev/loop4 0 0 1 1 /var/lib/snapd/snaps/gtk-common-themes_1198.snap 0 512
/dev/loop2 0 0 1 1 /var/lib/snapd/snaps/core_6673.snap 0 512
/dev/loop0 0 0 1 1 /var/lib/snapd/snaps/gnome-characters_254.snap 0 512
/dev/loop7 0 0 1 1 /var/lib/snapd/snaps/gnome-logs_61.snap 0 512
/dev/loop5 0 0 1 1 /var/lib/snapd/snaps/gnome-calculator_406.snap 0 512
/dev/loop3 0 0 1 1 /var/lib/snapd/snaps/gnome-3-28-1804_31.snap 0 512
我们可以把xxx.iso镜像文件挂载到一个目录下。
mount -o loop xxx.iso /media
等同于执行:
losetup /dev/loop0 xxx.iso
mount /dev/loop0 /media
清理方法
更多内容,请查看博客原文 解决ubuntu上回环设备-dev-loop0占用100-的问题