Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Note that this question is prompted by the circumstances detailed by me (as Xl1NntniNH7F) in 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
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:

for m in dev dev/pts ; do
    grep -sq $d/$m /proc/mounts || mount --bind /$m $d/$m
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .