我使用schroot创建了chroot,下面的说明是:https://wiki.winehq.org/Building_Wine#Chroot
为了测试它,我做了:
$ sudo mkdir /TestA
$ echo abc |sudo tee /TestA/tst.txt
$ cat /TestA/tst.txt
abc
$ ls -ld /TestA /TestA/tst.txt
drwxr-xr-x 2 root root 4096 Sep 17 03:02 /TestA
-rw-r--r-- 1 root root 4 Sep 17 03:02 /TestA/tst.txt
$ sudo mkdir /srv/chroot/ubuntu_i386/TestB/
$ sudo mount -o bind /TestA/ /srv/chroot/ubuntu_i386/TestB/
$ mount |grep Test
/dev/mapper/MyLvmGroup-something on /srv/chroot/ubuntu_i386/TestB type ext4 (rw,relatime,errors=remount-ro)
$ schroot -c ubuntu_i386 -u root
$ ls -ld /TestB /TestB/tst.txt
ls: cannot access '/TestB/tst.txt': No such file or directory
drwxr-xr-x 2 root root 4096 Sep 17 06:10 /TestB
$ ls -l /TestB
total 0我还在一个非LVM分区中尝试过它作为绑定源,但它没有工作。
这是怎么回事?到处都说它有用,为什么它不在这里工作呢?我遗漏了什么?
ubuntu 20.04
发布于 2020-09-17 06:50:06
schroot实际上使用了/run/schroot/mount/ubuntu_i386-...,对于each上的新色度,它在ubuntu_i386-之后使用了一个新的巨大ID
只需使用:mount |grep ubuntu_i386检查已经在那里的自动挂载/绑定
因此,解决方案是:在运行schroot之后找到新的挂载目录,然后正确挂载ex.:sudo mount -o bind /TestA /run/schroot/mount/ubuntu_i386-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/TestB
https://unix.stackexchange.com/questions/609802
复制相似问题