是否有一种方法可以在自定义目录或分区中安装自己的空闲容器?我认为容器安装的主要大小(卷)属于这样的目录:
/home/phablet/.cache/libertine-container/my-container/rootfs当然,了解自己容器的其他文件位置列表会有帮助,如:
~/.local/share/libertine/ContainersConfig.json
~/.cache/libertine-container/my-container
~/.cache/my-container
~/.local/share/libertine-container/user-data/my-container
~/.local/share/libertine-container/user-data/my-container/.cach/libertine-container/my-container我现在看到了使用mount --bind..的唯一方法,但在这样做时,在这里/etc/fstab编辑或使用/etc/rc.local或新贵脚本在设备启动时自动启动有几个问题。
因此,第二个问题是:如果我不时地使用mount --bind..来手动绑定/home/phablet/.cache/libertine-container/my-container/rootfs,那么我是否会在正确的就像这里描述的那样工作上遇到麻烦?
发布于 2016-12-03 09:42:50
在我们采取行动之前,我们应该有带有ext2/3/4分区的SD卡。在Ubuntu中,它可以表示为/dev/mmcblk1p2 (在我的例子中)。如果我们想永久安装,我们不能使用/etc/fstab/,但我们可以使用/lib/init/fstab作为我在那里指出答案。在Ubuntu中永久安装SD是不方便和不稳定的。有时,由于ext2分区上的文件系统出错,我在Ubuntu的引导上遇到了问题。也许,设备的击落不能正确地执行拆卸操作。因此,我决定安装SD卡,并不时使用解放集装箱。
首先,我在内部磁盘空间中创建了名为sd-container的新容器:/home/phablet/.cache/libertine-container/sd-container。然后,我使用以下命令在SD上挂载了ext2分区:
sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro然后,我创建了目录/home/phablet/mnt/sd/sd-container/,并将SD容器的rootfs复制到SD上的ext2分区:
cd /home/phablet/.cache/libertine-container/sd-container
rsync -aAXvH ./ /home/phablet/mnt/sd/sd-container/在此准备之后,我编写了脚本来在SD上挂载ext2分区并绑定rootfs (sdgo.sh):
#!/bin/sh
sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro
sudo mount --bind /home/phablet/mnt/sd/sd-container/rootfs /home/phablet/.cache/libertine-container/sd-container/rootfs
restart unity8-dash以及停止玩这个(sdstop.sh)的脚本:
#!/bin/sh
sudo umount /home/phablet/.cache/libertine-container/sd-container/rootfs
sudo umount /dev/mmcblk1p2
restart unity8-dash最后,在我运行sdgo.sh unity8-破折号之后,我可以看到新的SD容器范围及其在桌面应用程序范围下的应用程序。我可以像往常一样运行或安装新的应用程序。但是这个容器的根位于SD卡上!当我想停止时,我运行sdstop.sh和SD-容器范围消失。并且小的原始rootfs (隐藏在这个绑定中)保持在内部磁盘空间上,没有改变。
结论: SD卡上有“解放”容器的根部,可以在需要时打开或关闭它及其范围。
https://askubuntu.com/questions/844266
复制相似问题