#688325 [schroot] I can't mount usb key with schroot

Package:
schroot
Source:
schroot
Description:
Execute commands in a chroot environment
Submitter:
Guy Roussin
Date:
2014-07-15 21:33:05 UTC
Severity:
normal
#688325#5
Date:
2012-09-21 15:55:32 UTC
From:
To:
--- Please enter the report below this line. ---
Hi,

I can not mount a USB key under /media because
they belong to root.

How can i achieve this ?

Thank you,

Guy

guy@pcplat53:~$ grep media /etc/schroot/desktop/fstab
/media          /media          none    rw,bind         0       0

guy@pcplat53:~$ ls -al /media/
total 44
drwxr-xr-x  4 root root  4096 sept. 21 17:37 .
drwxr-xr-x 27 root root  4096 sept. 17 14:41 ..
drwx------  9 guy  guy  32768 janv.  1  1970 78AB-6034
lrwxrwxrwx  1 root root     6 août  12  2011 cdrom -> cdrom0
drwxr-xr-x  2 root root  4096 août  12  2011 cdrom0

guy@pcplat53:~$ schroot -c precise

(precise)guy@pcplat53:~$ ls -al /media
total 16
drwxr-xr-x  4 root root 4096 Sep 21 15:37 .
drwxr-xr-x 22 root root 4096 Sep 11 09:02 ..
drwx------  2 root root 4096 Sep 21 15:37 78AB-6034
lrwxrwxrwx  1 root root    6 Aug 12  2011 cdrom -> cdrom0
drwxr-xr-x  2 root root 4096 Aug 12  2011 cdrom0


Debian Release: wheezy/sid
  500 unstable        qgis.org
  500 unstable        ftp.fr.debian.org
  500 testing         ftp.fr.debian.org
  500 stable          dl.google.com
  500 stable          deb.opera.com
  500 squeeze         deb.playonlinux.com
  500 hts             www.lonelycoder.com
  200 unstable        www.deb-multimedia.org
  150 experimental    ftp.fr.debian.org
--- Package information. ---
Depends                                (Version) | Installed
================================================-+-==============
libboost-filesystem1.49.0          (>= 1.49.0-1) | 1.49.0-3.1
libboost-iostreams1.49.0           (>= 1.49.0-1) | 1.49.0-3.1
libboost-program-options1.49.0     (>= 1.49.0-1) | 1.49.0-3.1
libboost-regex1.49.0               (>= 1.49.0-1) | 1.49.0-3.1
libboost-system1.49.0              (>= 1.49.0-1) | 1.49.0-3.1
libc6                                   (>= 2.4) |
libgcc1                             (>= 1:4.1.1) |
liblockdev1                                      |
libpam0g                           (>= 0.99.7.1) |
libstdc++6                              (>= 4.6) |
libuuid1                               (>= 2.16) |
schroot-common                       (= 1.6.3-1) |


Package's Recommends field is empty.

Suggests              (Version) | Installed
===============================-+-===========
debootstrap                     | 1.0.42
lvm2                            | 2.02.95-4
btrfs-tools                     |
aufs-modules                    |
 OR unionfs-modules             |
qemu-user-static                |

#688325#10
Date:
2012-09-21 21:57:49 UTC
From:
To:
The same way as you would on the host system, especially since the
files under /dev/ are bind mounted from the host.  This is not, I
think, something that schroot itself should cater for.  Tools like
pmount and more recent tools used by common desktop environments
for mounting removable media should work inside the chroot as well;
particuarly when using the "desktop" profile.  If there's anything
we can add to that profile to make desktop removable media
support work better, then we can certainly look at adding that.


Regards,
Roger

#688325#15
Date:
2012-09-23 07:47:44 UTC
From:
To:
Thank you Roger,
But this is what i get with pmount (i use the desktop profile) :

guy@pcplat53:~$ pmount /dev/sdb1
guy@pcplat53:~$ pumount /dev/sdb1
guy@pcplat53:~$ schroot -c precise
(precise)guy@pcplat53:~$ pmount /dev/sdb1
Error: could not open fstab-type file: No such file or directory
(precise)guy@pcplat53:~$

This is ok with the host but not with the schroot

Guy

#688325#20
Date:
2014-07-15 21:30:22 UTC
From:
To:
Sorry for the long delay.  Did you ever find a solution to this problem?

Which file can't be opened?  (strace as root inside the chroot might
help.)

I suspect pmount needs something extra bind mounting into the chroot
to work, but I'm not sure what that would be or where it lives.


Regards,
Roger