Re: [SLUG] chroot syntax

From: Bill Triplett (btt@nethouse.com)
Date: Sat Nov 10 2001 - 20:35:09 EST


On Sat, Nov 10, 2001 at 06:03:00PM -0500, Mario Lombardo wrote:
> Thanks for sending that, Russell.
>
> I'm good now, but I'd still like to know how to successfully use chroot.
>
> My scenario was, I booted with a drive to fix another that was having
> boot problems, so I wanted my root to change so my changes would reflect
> on the drive I wanted to fix. I couldn't get chroot to commit. Is it
> possible to do what I was trying to do? Is that what chroot was
> designed for (sort of)?

I don't know if it was designed for that or not, but it sure beats
having to be careful about relative paths when you're stomping around
in a root filesystem that is mounted non-root.

   chroot /new/root/dir /bin/sh

note that the /bin/sh is relative to what the new root will be after
the chroot... not what it is before.

I think you need to have shared libraries and a populated /dev
directory in the new root, otherwise madness will reign. Debian has a
package called 'sash' which is a statically linked shell with some
useful admin tools built in (eg. for mounting and unmount
filesystems, killing procs, etc). it is great in a pinch.

Good luck...



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:35:02 EDT