Re: Difference between pivot_root and chroot?

Patrick Albuquerque <[email protected]> Sat, 25 Dec 2004 16:02:34 -0600
Newsgroups gmane.linux.debian.devel.3com-pilot
Message-ID <20041225220234.GI4281__18382.1200546392$1104011984$gmane$org@albuquerque.ca>
On Sat, Dec 25, 2004 at 05:35:10AM -0600, Klaus Weidner wrote:
> 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.
> 
> -Klaus
> 

Thanks, that is very helpful.

Happy Holidays,
Patrick.
--