5

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?

1

1 Answer 1

3

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.

1
  • 1
    Rather than replace /sbin/init just add an /init script to root which does the pivot root.
    – hookenz
    Apr 22, 2014 at 21:43

You must log in to answer this question.

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