Re: Difference between pivot_root and chroot?

Patrick Albuquerque <[email protected]>
Newsgroups gmane.linux.debian.devel.handheld
Message-ID <[email protected]>
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.
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.