Ubuntu 在我的 zfs 上创建了大量遗留文件系统,例如:
rpool/ROOT/ubuntu_j63w4a/var/lib/00bc09e20e8a08d6f3628e50ff5c4368414dd69c885c013b480adf8f388eb93f legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/02b5f66648be2b592edb4b298af1d8868cc79cef05822a7dfa7925855adcc110 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/03c608a85eb32b43649a38970c82229258bab93f8807210865ca10068dcfe5b6 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/0bcf8caa2a24b68bf2da42daf2a537a1a0f1e3667e1d03eb54bd956e06e1d858 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/0c34a821e05160cfd00dbe031e4abaa39ede6d8cbb4b166b33b923adc61cd03e legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/0d5a3f24ebb83ea0594f95da778876658a417b4e3ad054b3e6bbdd03cd83f37d legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/10fc4f16ad5f4f1f0f25c29caf551ba8d7c27d4c19eb149ec879af3a883ea41d legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/11d8125c69400b09361706f1ada27e68bd82d431075d53e89cff13b6b6f0e750 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/135ffcbc1e72118be5a78279722811442268d8d9b923a71d119b0dacb465006e legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/15722cd52cbe21eb45c2b4d81e40aaf284be6ee5b8eda713534d8a8262845721 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/167c5f05a757eddc9ba70dea6c1d70b8137fb854092efea5760270cde525e6d9 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/17fa82fcad86f148ddc8eb4e51138151ff459cfd05cae5fa7a66354109e6daad legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/190f5f0cc9a91b7ef1f2b54efbce9c5c69b46a1da469c55a2a4aafe1a3914195 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/20a7d51bdf82d552d7d813495d1109ac32bae8d329e39d6d0c2f1024169305d0 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/20a7d51bdf82d552d7d813495d1109ac32bae8d329e39d6d0c2f1024169305d0-init legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/217b868774016bc8e05f3508be5840e9548f042d1a65035edd47932e609cc771 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/2446dcc9feaa7e5ba1da5ecd8aaddfa7b2272d81754178e6342c935dd1bd026f legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/27ade05dc940be112f6fafe1efabb8abdae73d4f06cf773a6eda756cd90ac14e legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/29aaf28f10086319b61af06066db242d1e2cc3a3518978a523cd3ca41d2896a5 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/2a7b4cd7d792e5b4f0d06523bb6fdd4637751753b51bf96b9f57e6937acfb9df legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/2abf011b673672ed03efa0d624f7d39002ea6691b6732c3e9e08cd27fafa63db legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/3346e12816c3005285f803a0d91c3a5cc6e3eae5754c7bf9fba4e111035947bd legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/33ee1a2975282b88d032e5eb47de2e2f681df519bc8857c3581311c9a740bd2c legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/3485197e255e00633a1eca7d64bd07a3ff51a464ef3dffe70228717cae47a9be legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/34c4e148b8785a201cb217c5f0427fa59cb5fa4ca937aa72a92907b936199efc legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/350d82e60973b5ace6c7ea15a2c0497ec897577548fd33df07e323a02058613b legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/369e3387933e7c7119af51deaea4605f2cb512e9ca6a0385b69794ac396b489a legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/397d994e87f0c43494bc0094151cd3578e06e422a462100ef9a79cec858fe6c1 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/3d19d9108d22d8bef4722b06258367973e83ca783e3c097c9f67d5ad7ff4793a legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/3e1fc2832dc6748a5795484e69e6db88b586af9de43e46f2cf427151dbe17aac legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/40c7fc6d3ef5decd2674c2956ff1ee1954b8d2a7086b25183dd977ac4467de78 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/41066e5becfeaaee86a4b9bf4804f5cff2ff705ba40f965d19941c7ddcaa833d legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/4199c6fd27fc90d37f6ec42aa48e77d96346c859eda116022762df5e28d40d87 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/4344930246f7ed3fcbea63790b0a9d2f6c084633b9608010a89d0d1439e278d1 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/497b98b0660c24c852d18d5fea2b91e5105a63092a938d7a4fa1611fbd71e7d2 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/4e06fefcc428d158ec4c8fb1f58e57b226f64eab089829a65879edfbdf1ee6b7 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/516a05ffd057a78514ed2a3e1f9ce2fc0d4dff91ac438aec9e39c9ed66c69248 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/516a05ffd057a78514ed2a3e1f9ce2fc0d4dff91ac438aec9e39c9ed66c69248-init legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/51a30627d903ac71c8702f87a2ac5455579e884bb7e8a481dbb34a1be94726eb legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/53ea8518c38e617e8939e60c0225d3379cd28416b9b633fe3b96db3c1938cb2a legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/54fda1672135f851cd2b0c53d4f51b791888f6b41244fe04969b1d5fa685ac5b legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/55266cb3384b95a08c8a6c77fafd1c546a982c3edcca10b79a5ed934ba753071 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/553191cd132c848b267cdb314a912513f4ba2f2d84fbe522517e0dcf379caaae legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/5ba0d1d84b85a189d6faefd2e15d8611383a2717615c4d2e32f357902d59186b legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/5ecc80f59282256da619408635b2cf1a3743dbd93ec7991e30cdd75a2406664f legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/61fc229c5dc28696a8a034c56c95a163fb58ccbd37bfc8fc01c4210ca649513b legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/632775714a569c7b7c964c93949b1899b67311c127ff92efdc2df06bc49a476e legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/632775714a569c7b7c964c93949b1899b67311c127ff92efdc2df06bc49a476e-init legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/69b5c21df75cfcf35c0f749ac1565a233815a3815d57aff79bf1b2326cca68e4 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/6df9e46441e7b9570b292fbec8c76afc9a8abe5d49af683644199a5b59cbcc36 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/6f7009b64500e69d57f0b0e9336592a848fdc86bfcadc9c2be48876ced4cd197 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/6f963b70914cdcff5205dbe9e1669d4915b808995b317fc4c0306533ab31bf93 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/6fd14bbfa57e16a3a0d6cf79d94530e7ae6f903b50d9af42d3e68666f5811cbc legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/746ca4d145cdcc2a253e1f95ff3e589eb3912dd034e78ec849a87a34ec197104 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/75a1e3348fd14f31526bd44a7283f00b4167801c342565c4c49b2a9420fad1a5 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/797fa431a27bede705ce2a268a777406463347345abbee3a7c8f756d19b53601 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/7f76d8d3e9385da5289f74da7bbc6d866685bc60add4468bfc1096de4658ba96 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/8189c53acedfcfbcc38e65bd8691cf6e8fe15e821e615e8850ce4a53b6062195 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/83aab507bf84ac894cb777fbe1e591e734ee43c15b8d67f554d22685587d5c22 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/858fccd3ba80da879581aa4448e38bf70f75dc0528ebde7404e51166e4af3964 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/85d1342e41f59e19cbe6273578cb88fbbe3a1a4954179977cdd7b574149c5d1e legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/8ab4781fa0b5335d0b3db421a22fc1f8b7391401485af71292e70d6ac25ccc28 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/90ff53958014ad68942d2e3a6b7e589e42fc58659559685e7c2a17df2a92ed7f legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/94eb62eb4363fc58477088da5c8e29168128363e0827cf7d3ce763ccaf61236a legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/9c288293e707d4f8fd590d1f37ba9c53d7df0151cd57ae3296f0968f14cf5c19 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/9c784d081a5cceec68545bbbff0b63494a1019b5b756fa0857932763e49af305 legacy
rpool/ROOT/ubuntu_j63w4a/var/lib/9fb968163db063c3712e2cef6e86c529f8fe8f118963eb0935441c16281cbb94 legacy
为什么会这样?
移除它们安全吗?
答案1
我认为我已经在帖子中找到了有关您的问题的描述
带有 ZFS Rpool 的 Ubuntu 20.04 有数百个克隆文件系统。
那里的答案是这样的:
这不是 ubuntu,但可能您已安装 docker,它会为您创建它们。您应该删除 zfs 集成(不确定默认情况下这会带来什么,他们的 wiki 页面并没有真正列出好处: https://docs.docker.com/storage/storagedriver/zfs-driver/)。几周后,对 repo 中默认 ubuntu docker 包的修复将创建 rpool/var/lib/docker,以便它们在那里创建为持久数据集。(
rpool/var
并且rpool/var/lib
将具有 canmount=off)。如果您从我的测试中删除容器
docker rm
(包括已停止的容器),它们将被删除。请在 docker 本身上提交错误,以便用户可以调整,并且他们解释这会带来什么好处(也可以更改他们的默认分布以具有持久的 rpool/var/lib)。
此链接指向该帖子 zsysctl 返回错误 rpc 错误:代码 = DeadlineExceeded desc = 上下文截止日期已超过 #102,发帖者列出了他的解决方案:
我决定删除 rpool/ROOT/ubuntu_093s22/var/lib/ 中由 docker 创建的所有快照和文件系统。我将 rpool/docker 挂载到 /var/lib/docker,现在 zsys 又可以正常工作了。如果 docker.io 在 ZFS 文件系统中安装时能够自行创建文件系统并将其挂载到正确的位置,那就太好了。
后来又添加了以下内容:
事实上,我没有启用任何东西,只是在 ZFS 根文件系统上安装了 Docker。当我第二次重新安装 Docker 时,我添加了 ZFS 作为存储驱动程序,但行为是一样的。因此,如果 /var/lib/docker 位于 ZFS 文件系统上,Docker 似乎会选择 ZFS 作为存储驱动程序。
链中的下一个是帖子 docker ZFS 驱动程序创建了数百个数据集并且没有清理它们 #41055 这是提供的解决方案:
sudo zfs create -V 20G rpool/docker
sudo mkfs.ext4 /dev/rpool/docker
sudo mkdir -p /var/lib/docker
sudo mount /dev/rpool/docker /var/lib/docker
sudo tail -1 /etc/mtab | sudo tee -a /etc/fstab
对你的问题的主要回答是,删除这些数据集是安全的,但你最好安装 Docker 以避免它们再次返回。