How do I bind mount removable media to my 32 bit chroot 

Newsgroups:  gmane.linux.debian.ports.amd64
Date:        Wed, 16 Mar 2005 10:16:52 GMT
> I have openoffice running in a 32 bit chroot and things are working smoothly,
> except that it can't open files on removable media, because it only has bind
> mounts to /tmp and /home.
>
> I tried adding a bind mount for the directory in /media, but then I had
> trouble mounting and unmounting the removable media as an ordinary user.
>
> Any ideas - or is there something else I should be doing and not mucking about
> with this approach at all?

I had this problem running Cedega in a chroot, accesing CD-Roms etc.

What I did might work for you:

  1. comment out the mounts in /etc/fstab to do with whatever device you want mounted in the chroot. (and unmount if its already mounted)
  2. put entry similar to this in your /var/chroot/sid-ia32/etc/fstab (or whatever your chroot directory is):

    /dev/hdc        /mnt/cdrom      iso9660 ro,users,noauto 0       0

    ** make sure the mount point exists in the chroot (i.e. mine is /var/chroot/sid-ia32/mnt/cdrom )

  3. insert your media, and "mount /mnt/cdrom" when you're in your chroot (you should be able to do it as a user now, but you might need to set permissions of /dev/hdc and /mnt/cdrom — and I cant remember what these are.

Once you've done this, you should be able to mount/unmount from within the chroot fine. I used to have it set up as a bind, and it didnt work, but this worked for me.

James

How do I bind mount removable media to my 32 bit chroot 

> > Once you've done this, you should be able to mount/unmount from within
> > the chroot fine. I used to have it set up as a bind, and it didnt work,
> > but this worked for me.
>
> Maybe what you guys want is a rbind mount.

Thanks - rbind mount does the trick!

Robert King