[libvirt-users] Reg: Difference between chroot & pivot_root

Daniel P. Berrange berrange at redhat.com
Tue Sep 13 13:11:45 UTC 2011


On Tue, Sep 13, 2011 at 03:05:32PM +0200, Guido Winkelmann wrote:
> Am Dienstag, 6. September 2011, 19:02:14 schrieb Alphonse Hansel Anthony:
> > Hi,
> >    What is the difference between chroot & pivot_root.
> 
> As far as I know, chroot changes only the effective root for one newly started 
> process and all the child processes it will start in the future, leaving all 
> other processes unaffected, while pivot_root changes the root for the entire 
> system, killing all other processes.

In the context of LXC, the pivot_root is done after switching into a
private filesystem namespace (CLONE_NEWNS), so only the process doing
the pivot and its children are affected, not the system as a whole.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvirt-users mailing list