我前段时间创建了一个 btrfs 快照,现在我想删除它,因为它似乎占用了很大的空间。
当我列出快照时,我得到:
11:59:16::root@pounamu::/mnt
↪ btrfs subvolume list /
ID 257 gen 99338 top level 5 path @
ID 258 gen 99338 top level 5 path @home
ID 263 gen 99315 top level 5 path @home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29
我相信我想要删除的快照是最后一个,所以我运行:
11:58:29::root@pounamu::/mnt
↪ btrfs subvolume delete /home/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29/
Delete subvolume '/home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29'
ERROR: cannot delete '/home/.ecryptfs/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29' - Device or resource busy
不幸的是,它显示“设备或资源繁忙”。这让我非常我很紧张,因为这让我觉得我可能删除了一些不该删除的东西。尽管如此,我还是尝试以其他用户身份登录以释放设备。不幸的是,当用户未登录时,目录(快照)不存在,因为未安装加密目录!这感觉就像一个主要缓存 22:登录时我无法删除它,因为它很忙;注销时我无法删除它,因为它不存在!
我确信我的所有麻烦都是因为我尝试使用带有 btrfs 的加密主目录。有人能帮我 1) 确认我没有删除应该保留的内容,以及 2) 弄清楚如何删除快照吗?
答案1
在 btrfs IRC 频道上进行了非常富有成效的对话后,我们得以修复此问题。据我了解,解决方案是:
1. 将根(顶级)子卷重新挂载到新的挂载点(这会将其移出工作目录)
mount -o subvol=/ /dev/sda6 /mnt/
2.删除快照
btrfs subvolume delete /home/mlissner/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxu4dgX.2jUELJL22wpV94oU--/ECRYPTFS_FNEK_ENCRYPTED.FWa8iOdaTukmNEROkGj4b5OZHZ0bKOqrvAQxHunTlBS-30iHyukjeY9-EE--/root_post_install_2014-04-29/
3. 卸载根子卷。
umount /mnt