0

I created the chroot with schroot following these instructions: https://wiki.winehq.org/Building_Wine#Chroot

Then to test it I did:

$ 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

I tried it also in a non LVM partition as the bind source, and it did not work.

What is happening? everywhere ppl saying it works, why it is not working here? what am I missing?

ubuntu 20.04

Aquarius Power
  • 4,099
  • 5
  • 38
  • 56

1 Answers1

0

schroot actually uses /run/schroot/mount/ubuntu_i386-...
and for each new chroot on it, it uses a new huge ID after ubuntu_i386-

just check the auto mount/binds already there with:
mount |grep ubuntu_i386

So the solution is:
Find out the new mount directory after running schroot,
then mount properly ex.:
sudo mount -o bind /TestA /run/schroot/mount/ubuntu_i386-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/TestB

Aquarius Power
  • 4,099
  • 5
  • 38
  • 56