Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I would like to boot a testing Ubuntu release from a directory (which contains a debootstrap based install).

As far as I understand I just need someway to tell the boot process (initrd scripts?) that it should chroot() into the specified dir immediately after mounting the root partition, and then resume the regular upstart/init start.

Could someone provide some instructions on how to achieve this?

share|improve this question
Check out my working example of it here… – kenn Feb 20 '14 at 15:37

1 Answer 1

up vote 3 down vote accepted

You can boot a sub directory by replacing your sbin init with a script which uses pivot_root, the process is sketchy and various people have reported failure as much as sucesses. So try it and see, but keep a live cd handy in case your system becomes unbootable.

Details here:

What we could do with, is an automatic system for being able to boot multiple roots from the same drive. It should be programatically possible to do.

share|improve this answer
Rather than replace /sbin/init just add an /init script to root which does the pivot root. – Matt H Apr 22 '14 at 21:43

Your Answer


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.