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.

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 askubuntu.com/questions/405735/… –  kenn Feb 20 at 15:37
add comment

1 Answer 1

up vote 2 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: http://linux.die.net/man/8/pivot_root

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 at 21:43
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.