Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Note that this question is prompted by the circumstances detailed by me (as Xl1NntniNH7F) in http://www.linuxquestions.org/questions/linux-desktop-74/boot-failure-upon-updating-e2fsprogs-in-ubuntu-10-10-a-947328/. Thus if you could address the underlying cause of the boot failure, I would very much appreciate it.

I'm trying to replicate the environment in my ubuntu installation (where the home folder is on a separate partition) in order to run make uninstall. I'm using a live cd.

How to mount a dir in one partition into a directory on another mounted partition? I did chroot /mnt/sda2 but I don't know how to mount sda3 to /home, and my various attempts didn't work. As I am unfamiliar with chroot, my approach could be wrong, so it would be great if you could suggest what I should do, given my circumstances.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I bind mounts a lot with chroots, so I tend to have scripts set up which check to see if the chroot has certain dirs bind mounted already and if not, to set them up before chrooting.

For example, I have /dev set up as a tmpfs with mdev and /dev/pts mounted as a devpts filesystem:

$ mount | grep /dev
devpts /dev/pts devpts rw 0 0
mdev /dev tmpfs rw,nosuid 0 0

Then in my script I do:

d=/mnt/chroot
for m in dev dev/pts ; do
    grep -sq $d/$m /proc/mounts || mount --bind /$m $d/$m
done
exec chroot $d /bin/bash

With the current SVN Busybox trunk, it seems /dev is mounted twice at /mnt/chroot/dev and /mnt/chroot/dev/pts instead of /dev at /mnt/chroot/dev and /dev/pts at /mnt/chroot/dev/pts

share|improve this answer
add comment

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.