1

I have a chrooted env. made with debootstrap and i would like to pass only Certain USB devices to it. (not all the devices mounted on the host system).

I know you could pass all USB devices by using

$ sudo mount --bind /dev chroot/dev

$ sudo mount --bind /sys chroot/sys

But i would like to have more control to allow passing only certain USB devices. I thought about writing some script with FUSE that achieves what mnt --bind does but with more control over what to mirror and what to leave out.

But i wanted to ask to see if there are available tools that do this.

many thanks!

0

If there are apps running under the root user in your chroot, everything you're doing is pointless, as root can create device nodes. In case you don't have them, you could simply

sudo cp -a /dev chroot

and then delete the devices files you don't want to have in the chroot. After all /dev devices are just special files cp can perfectly work with.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.