[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Difference between pivot_root and chroot?

On Fri, Dec 24, 2004 at 01:54:15PM -0600, Patrick Albuquerque wrote:
> Would you be able to explain the difference between pivot_root and chroot?  
> Sorry, it is not clear to me, from reading the man pages, or google.

The main difference is that pivot_root is intended to switch the complete
system over to a new root directory and remove dependencies on the old
one, so that you would be able to unmount the original root directory and
proceed as if it had never been in use. chroot is intended to apply for
the lifetime of a single process, with the rest of the system continuing
to run in the old root dir, and the system being unchanged when the
chrooted process exits.

The difference is shrinking now that Linux has per-process namespaces
anyway. If you "chroot" a single init-type process that never exits and
don't care about unmounting the original root, it's the same for
practical purposes.


Reply to: