Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Most of the time I use the chroot to rescue an existing installation from usb.

When I chroot into another system I have to manually bind-mount proc, sys, dev and dev/pts by issuing for example:

mount --bind /proc proc/

Is there an easy way allready implemented in a standard Ubuntu install?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

See the schroot package. Man Page

As an alternative, you can shorthand the bind mounting with:

for f in proc sys dev ; do mount --bind /$f /mnt/$f ; done
share|improve this answer
1  
You could add references to the manual page and provide examples. –  Lekensteyn Mar 28 '11 at 17:42
    
well... that's kindof why I asked about the standard Ubuntu install. Of course there exist tools that do that. But is it as simple as sudo apt-get install schroot && schroot /dest ? –  turbo Mar 28 '11 at 17:54
1  
@turbo in that case, no. One thing that can help save some typing though is rather than issue 3 separate bind mount commands, you can just do "for f in /sys /proc /dev ; do mount --bind $f /mnt/$f ; done" –  psusi Mar 28 '11 at 19:16
3  
@turbo, @psusi --bind only mounts the specific named filesystem; it won't include pts or for that matter shm. However if you use mount --rbind it will work. –  poolie Apr 12 '11 at 2:33
1  
@psusi, you'll probably need to manually umount the things inside it before you can unmount /dev. If that doesn't work, yes, it's a bug. screen would be an example of something that needs a pseudoterminal from /dev/pts, though it might fall back to putting them just under /dev/. –  poolie Apr 13 '11 at 0:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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