在我的 Ubuntu 桌面上,该命令fdisk -l
显示 /dev/loopX up to /dev/loop23
. 我在 Ubuntu 18.04 LTS 上使用 gnome-fallback。
我想知道这些可能对操作系统的性能和稳定性产生什么影响,如果它们只是多余的,我该如何删除它们?
root@pc5:~# fdisk -l
...
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop15: 3.7 MiB, 3821568 bytes, 7464 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/loop16: 54.6 MiB, 57274368 bytes, 111864 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/loop17: 140.7 MiB, 147501056 bytes, 288088 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/loop18: 14.8 MiB, 15462400 bytes, 30200 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/loop19: 42.8 MiB, 44879872 bytes, 87656 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/loop20: 54.5 MiB, 57151488 bytes, 111624 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/loop21: 4.2 MiB, 4403200 bytes, 8600 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/loop22: 153.5 MiB, 160935936 bytes, 314328 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/loop23: 140.7 MiB, 147501056 bytes, 288088 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
输出df
:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8128184 0 8128184 0% /dev
tmpfs 1630464 3716 1626748 1% /run
/dev/sda2 229184876 63255488 154217748 30% /
tmpfs 8152300 142672 8009628 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8152300 0 8152300 0% /sys/fs/cgroup
/dev/loop2 160512 160512 0 100% /snap/gnome-3-28-1804/110
/dev/loop3 4352 4352 0 100% /snap/gnome-calculator/544
/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/111
/dev/loop4 91264 91264 0 100% /snap/core/8039
/dev/loop1 1024 1024 0 100% /snap/gnome-logs/81
/dev/loop6 87936 87936 0 100% /snap/shotcut/55
/dev/loop5 406528 406528 0 100% /snap/redis-desktop-manager/332
/dev/loop8 91264 91264 0 100% /snap/core/8213
/dev/loop7 406656 406656 0 100% /snap/redis-desktop-manager/335
/dev/loop9 15104 15104 0 100% /snap/gnome-characters/367
/dev/loop11 157184 157184 0 100% /snap/chromium/949
/dev/loop12 87808 87808 0 100% /snap/shotcut/53
/dev/loop13 1024 1024 0 100% /snap/gnome-logs/73
/dev/loop14 45312 45312 0 100% /snap/gtk-common-themes/1353
/dev/loop16 55936 55936 0 100% /snap/core18/1279
/dev/loop15 3840 3840 0 100% /snap/gnome-system-monitor/107
/dev/loop10 159872 159872 0 100% /snap/gnome-3-28-1804/91
/dev/loop17 144128 144128 0 100% /snap/gnome-3-26-1604/97
/dev/sda1 523248 6232 517016 2% /boot/efi
/dev/loop18 15104 15104 0 100% /snap/gnome-characters/359
/dev/loop19 43904 43904 0 100% /snap/gtk-common-themes/1313
/dev/loop20 55936 55936 0 100% /snap/core18/1265
/dev/loop21 4352 4352 0 100% /snap/gnome-calculator/536
/dev/loop22 157184 157184 0 100% /snap/chromium/958
/dev/loop23 144128 144128 0 100% /snap/gnome-3-26-1604/98
/dev/sdb1 492127240 409174612 57930932 88% /home
tmpfs 1630460 16 1630444 1% /run/user/121
tmpfs 1630460 140 1630320 1% /run/user/1001
tmpfs 1630460 0 1630460 0% /run/user/0
编辑
sudo fdisk -l
今天的问题发生了变化,所以这里是如何删除额外的输出而不需要删除所有快照并且没有计算器等等:
由于这可能很难记住,您可以在您的
~/.bashrc
:然后只需
fdsk
在命令行中键入并在出现提示时输入您的密码。正如评论
/dev/loop99
中提到的,这里描述的快照文件系统图像:假设您不想卸载所有快照,则下一个最佳选择是通过附加
| grep -v ^/dev/loop
. 例如:您所有的循环安装设备似乎都是snap。如果(如您所指出的)您真的不希望其中任何一个引用
man snap
.以下是相关摘录:
和一个例子:
snap remove --purge gphoto2
如手册页所述,
--purge
开关删除快照而不保存其数据的快照。如本评论中所述,您可能希望找到这些快照应用程序的非快照替代品。Ubuntu 包搜索页面可能有助于您搜索具有相应功能的 deb 包。
注意:正如这个答案中提到的,虽然您可以卸载目录并删除核心快照,但这样做会破坏所有已安装的快照,因此系统将使您很难做到这一点。
作为旁注,重要的是要了解 snap 包的优点和缺点是相同的,并且围绕这些包的许多批评与赞誉相同。根据您的要求,快照的自动更新既讨厌又喜欢。只读循环安装的按扣对某些人来说是一种恩惠,而对另一些人来说则是一种烦恼。您可以在https://en.wikipedia.org/wiki/Snappy_(package_manager)找到更多相关信息
维基百科文章中引用的许多文章也值得一读。