我正在运行 Ubuntu 24.04.2 LTS。
由于我的根文件系统严重拥堵,我正在寻找将快照移动到其他文件系统(例如我的主文件夹)的方法。我找到了这个帖子,并决定尽我有限的能力,按照其中的提示操作(我知道,我应该多做些研究……)。不幸的是,这个帖子似乎没有合适的答案——而且,我在操作过程中还犯了一些错误——包括:
- 移动错误的 snap 文件夹;
- 创建错误的符号链接;以及
- 尝试随后扭转这一过程,
……这导致我的文件系统更加臃肿。现在,我的 snap 文件都不能用了。我请求帮助来解决这个问题。
这是我所做事情的日志:
d@boom:~$ sudo mv /var/snap ~/snap
[sudo] password for d:
d@boom:~$ cd /var
d@boom:/var$ ls
backups cache crash lib local lock log mail metrics opt run spool tmp
d@boom:/var$ sudo ln -s ~/snap /snap
d@boom:/var$ ls -la
total 56
drwxr-xr-x 13 root root 4096 4月 7 19:52 .
drwxr-xr-x 23 root root 4096 4月 7 19:19 ..
drwxr-xr-x 2 root root 4096 4月 7 08:04 backups
drwxr-xr-x 23 root root 4096 2月 17 17:41 cache
drwxrwsrwt 2 root whoopsie 4096 4月 6 14:49 crash
drwxr-xr-x 77 root root 4096 3月 6 18:29 lib
drwxrwsr-x 2 root staff 4096 4月 22 2024 local
lrwxrwxrwx 1 root root 9 8月 27 2024 lock -> /run/lock
drwxrwxr-x 17 root syslog 4096 4月 7 08:22 log
drwxrwsr-x 2 root mail 4096 8月 27 2024 mail
drwxrwsrwt 2 root whoopsie 4096 8月 27 2024 metrics
drwxr-xr-x 2 root root 4096 8月 27 2024 opt
lrwxrwxrwx 1 root root 4 8月 27 2024 run -> /run
drwxr-xr-x 8 root root 4096 7月 18 2017 spool
drwxrwxrwt 16 root root 4096 4月 7 19:38 tmp
-rw-r--r-- 1 root root 208 8月 27 2024 .updated
d@boom:/var$ sudo ls -la
total 56
drwxr-xr-x 13 root root 4096 4月 7 19:52 .
drwxr-xr-x 23 root root 4096 4月 7 19:19 ..
drwxr-xr-x 2 root root 4096 4月 7 08:04 backups
drwxr-xr-x 23 root root 4096 2月 17 17:41 cache
drwxrwsrwt 2 root whoopsie 4096 4月 6 14:49 crash
drwxr-xr-x 77 root root 4096 3月 6 18:29 lib
drwxrwsr-x 2 root staff 4096 4月 22 2024 local
lrwxrwxrwx 1 root root 9 8月 27 2024 lock -> /run/lock
drwxrwxr-x 17 root syslog 4096 4月 7 08:22 log
drwxrwsr-x 2 root mail 4096 8月 27 2024 mail
drwxrwsrwt 2 root whoopsie 4096 8月 27 2024 metrics
drwxr-xr-x 2 root root 4096 8月 27 2024 opt
lrwxrwxrwx 1 root root 4 8月 27 2024 run -> /run
drwxr-xr-x 8 root root 4096 7月 18 2017 spool
drwxrwxrwt 16 root root 4096 4月 7 19:38 tmp
-rw-r--r-- 1 root root 208 8月 27 2024 .updated
d@boom:/var$ ls
backups cache crash lib local lock log mail metrics opt run spool tmp
d@boom:/var$ ls -ln
total 44
drwxr-xr-x 2 0 0 4096 4月 7 08:04 backups
drwxr-xr-x 23 0 0 4096 2月 17 17:41 cache
drwxrwsrwt 2 0 109 4096 4月 6 14:49 crash
drwxr-xr-x 77 0 0 4096 3月 6 18:29 lib
drwxrwsr-x 2 0 50 4096 4月 22 2024 local
lrwxrwxrwx 1 0 0 9 8月 27 2024 lock -> /run/lock
drwxrwxr-x 17 0 102 4096 4月 7 08:22 log
drwxrwsr-x 2 0 8 4096 8月 27 2024 mail
drwxrwsrwt 2 0 109 4096 8月 27 2024 metrics
drwxr-xr-x 2 0 0 4096 8月 27 2024 opt
lrwxrwxrwx 1 0 0 4 8月 27 2024 run -> /run
drwxr-xr-x 8 0 0 4096 7月 18 2017 spool
drwxrwxrwt 16 0 0 4096 4月 7 19:38 tmp
d@boom:/var$ sudo mv ~/snap /var/snap
mv: error writing '/var/snap/thunderbird/common/.thunderbird/3ie11tn2.default/ImapMail/mail.da.info/INBOX.sbd/Drafts': No space left on device
mv: cannot create directory '/var/snap/thunderbird/684': No space left on device
mv: cannot create directory '/var/snap/mattermost-desktop': No space left on device
mv: cannot create directory '/var/snap/chromium': No space left on device
mv: cannot create directory '/var/snap/snap': No space left on device
mv: cannot create directory '/var/snap/metadata-cleaner': No space left on device
后来,为了清理空间,我重新启动了
sudo rm -r /var/snap
如果它有任何用处,这就是我得到的snap list
:
Name Version Rev Tracking Publisher Notes
bare 1.0 5 latest/stable canonical✓ base
chromium - 3084 latest/stable canonical✓ broken
core 16-2.61.4-20240607 17200 latest/stable canonical✓ core
core20 20241206 2496 latest/stable canonical✓ base
core22 20250210 1802 latest/stable canonical✓ base
core24 20241217 739 latest/stable canonical✓ base
cups 2.4.11-3 1079 latest/stable openprinting✓ -
ffmpeg-2204 7.0 126 latest/stable snapcrafters✪ -
ffmpeg-2404 7.1.1 59 latest/stable snapcrafters✪ -
firefox 136.0.3-1 5947 latest/stable mozilla✓ -
firmware-updater 0+git.22198be 167 1/stable/… canonical✓ -
gnome-42-2204 0+git.38ea591 202 latest/stable/… canonical✓ -
gnome-46-2404 0+git.7d0cf36 77 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable/… canonical✓ -
gtk2-common-themes 0.1 13 latest/stable canonical✓ -
hunspell-dictionaries u16.04-20180902+pkg-8e08 21 latest/stable brlin -
kf6-core24 6.8.2-6.11.0-6.2.5-24.12.3 22 latest/stable kde✓ -
mattermost-desktop 5.11.2 778 latest/stable snapcrafters✪ -
mesa-2404 24.2.8 495 latest/stable canonical✓ -
metadata-cleaner 2.5.4 58 latest/stable soumyadghosh✪ -
snap-store 0+git.90575829 1270 2/stable/… canonical✓ -
snapd 2.67.1 23771 latest/stable canonical✓ snapd
snapd-desktop-integration 0.9 253 latest/stable canonical✓ -
thunderbird 128.8.1esr-1 684 latest/stable canonical✓ -
我删除了 Chromium,试图释放硬盘空间。Thunderbird 或 Firefox 等快照的快捷方式仍然出现在我的系统中,但我无法打开它们。我所有的用户数据似乎都安全地保存在我的主文件夹中——我只是不知道如何开始清理和修复……