FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 12-23-2007, 02:16 PM
Tom Horsley
 
Default Complete chroot environment?

I've been experimenting with chroot to switch to an
alternate root partition and "do stuff" without
actually having to reboot to that alternate OS.

I see that none of the special filesystems seem to
be created as part of the ordinary chroot command, yet
things like the bind-chroot rpm does manage to create
a more complete environment for named to run in
(with populated /dev and /proc and wot-not).

Is there a handy tool somewhere to duplicate all the
special filesystems in a chroot environment?

Or should I just look at bind-chroot in more detail
and steal what it does?

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-23-2007, 07:17 PM
Jack Byers
 
Default Complete chroot environment?

Tom Horsley wrote

I've been experimenting with chroot to switch to an
alternate root partition and "do stuff" without
actually having to reboot to that alternate OS.

I see that none of the special filesystems seem to
be created as part of the ordinary chroot command, yet
things like the bind-chroot rpm does manage to create
a more complete environment for named to run in
(with populated /dev and /proc and wot-not).

Is there a handy tool somewhere to duplicate all the
special filesystems in a chroot environment?

Or should I just look at bind-chroot in more detail
and steal what it does?
----


Tom,
the following works for me; it may not be all you are looking for
re "complete"

before chrooting to /corni which holds an alternate old rh8 install
I run the following three-line script

[root@bootp ~]# cat mount_corni
#!/bin/bash
mount --bind /tmp /corni/tmp
xhost local:localhost

[root@bootp ~]#
that xhost line allows me to run X applications


a year or so ago there was an exchange on this llist
between me and Gilboa on this subject.
He had an alternateemethod for getting X to work

hope thiis helps
Jack

Jack Byers byersj@hotmail.com

__________________________________________________ _______________
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_dec

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-23-2007, 08:04 PM
Les Mikesell
 
Default Complete chroot environment?

Jack Byers wrote:

Tom Horsley wrote

I've been experimenting with chroot to switch to an
alternate root partition and "do stuff" without
actually having to reboot to that alternate OS.



I'd like the answer for a slightly different scenario too. If you boot
the install disk in rescue mode and the system is able to detect your
installed drives and mount them for you, it will also populate /dev.
However, if the reason you needed the rescue boot was that /etc/fstab
doesn't match the current layout or something similar that prevents
automatic mounting, it doesn't work. You may be able to manually mount
the correct partitions, but you can't chroot there without whatever this
missing step is that sets up the /dev entries in udev based systems.


--
Les Mikesell
lesmikesell@gmail.com

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-24-2007, 03:08 AM
Jack Byers
 
Default Complete chroot environment?

Tom, Les
maybe more complete?

#!/bin/bash
mount --bind /dev /path-to-your-chroot/dev
mount --bind /dev/pts /path-to-your-chroot/dev/pts
mount --bind /dev/shm /path-to-your-chroot/dev/shm
mount -t proc none /path-to-your-chroot/proc
mount -t sysfs none /path-to-your-chroot/sys

mount --bind /tmp /path-to-your-chroot/tmp
xhost local:localhost

Jack
__________________________________________________ _______________
i’m is proud to present Cause Effect, a series about real people making a difference.
http://im.live.com/Messenger/IM/MTV/?source=text_Cause_Effect

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-27-2007, 11:43 AM
John Summerfield
 
Default Complete chroot environment?

Tom Horsley wrote:

I've been experimenting with chroot to switch to an
alternate root partition and "do stuff" without
actually having to reboot to that alternate OS.

I see that none of the special filesystems seem to
be created as part of the ordinary chroot command, yet
things like the bind-chroot rpm does manage to create
a more complete environment for named to run in
(with populated /dev and /proc and wot-not).

Is there a handy tool somewhere to duplicate all the
special filesystems in a chroot environment?

Or should I just look at bind-chroot in more detail
and steal what it does?

The general idea of chroot is to provide a slightly more secure
environment than the base system.


bind-chroot has what it needs; ordinarily one doesn't want devices in
the chroot environment (a few exceptions such as /dev/{null,zero} are
needed, but certainly not /dev/sda).


I would contemplate an alternative approach such as using xen or, if h/w
virtualisation is available. kvm.


--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-27-2007, 12:04 PM
Tom Horsley
 
Default Complete chroot environment?

On Thu, 27 Dec 2007 21:43:22 +0900
John Summerfield <debian@herakles.homelinux.org> wrote:

> I would contemplate an alternative approach such as using xen or, if h/w
> virtualisation is available. kvm.

Actually, the "stuff" I want to do is pretty limited. I mainly just
want to run "yum -y --downloadonly update" to get the alternate
boot partition's yum cache populated with updates which will be
there waiting to install when I boot for real. The mount --bind
gimmick earlier in this thread seems to work (according to my
experiments), now I just gotta get official scripts written and
installed in cron.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-28-2007, 10:18 AM
kalinix
 
Default Complete chroot environment?

On Thu, 2007-12-27 at 21:43 +0900, John Summerfield wrote:
> Tom Horsley wrote:
> > I've been experimenting with chroot to switch to an
> > alternate root partition and "do stuff" without
> > actually having to reboot to that alternate OS.
> >
> > I see that none of the special filesystems seem to
> > be created as part of the ordinary chroot command, yet
> > things like the bind-chroot rpm does manage to create
> > a more complete environment for named to run in
> > (with populated /dev and /proc and wot-not).
> >
> > Is there a handy tool somewhere to duplicate all the
> > special filesystems in a chroot environment?
> >
> > Or should I just look at bind-chroot in more detail
> > and steal what it does?
> >
> The general idea of chroot is to provide a slightly more secure
> environment than the base system.
>

Actually the general ideea of chroot is to provide base system with an
extra layer of security. E.g. chrooted bind: if one succeed to
compromise bind, cannot compromise the base system once he is isolated
in the chrooted environment.
Of course, there are ways to surpass chroot as well, but this is an
entirely other story.


> bind-chroot has what it needs; ordinarily one doesn't want devices in
> the chroot environment (a few exceptions such as /dev/{null,zero} are
> needed, but certainly not /dev/sda).
>
> I would contemplate an alternative approach such as using xen or, if h/w
> virtualisation is available. kvm.
>
> --
>
> Cheers
> John
>
> -- spambait
> 1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
> -- Advice
> http://webfoot.com/advice/email.top.php
> http://www.catb.org/~esr/faqs/smart-questions.html
> http://support.microsoft.com/kb/555375
>
> You cannot reply off-list:-)
>

OTOH, you may want to look at jailkit
(http://olivier.sessink.nl/jailkit/) or even LFS
(http://www.linuxfromscratch.org/) if you want to play around with
chroot.


HTH,



Calin

=================================================
Men take only their needs into consideration -- never their abilities.
-- Napoleon Bonaparte

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-28-2007, 10:52 AM
John Summerfield
 
Default Complete chroot environment?

Tom Horsley wrote:

On Thu, 27 Dec 2007 21:43:22 +0900
John Summerfield <debian@herakles.homelinux.org> wrote:

I would contemplate an alternative approach such as using xen or, if h/w
virtualisation is available. kvm.


Actually, the "stuff" I want to do is pretty limited. I mainly just
want to run "yum -y --downloadonly update" to get the alternate
boot partition's yum cache populated with updates which will be
there waiting to install when I boot for real. The mount --bind
gimmick earlier in this thread seems to work (according to my
experiments), now I just gotta get official scripts written and
installed in cron.



Then this might do.

20:49 [summer@numbat ~]$ yum --help | grep root
--installroot=[path] set install root
20:50 [summer@numbat ~]$


try (I often fail) to remember to define the problem and invite
solutions. chroot is one, but it might not be the best.




--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-28-2007, 12:09 PM
Tom Horsley
 
Default Complete chroot environment?

On Fri, 28 Dec 2007 20:52:03 +0900
John Summerfield <debian@herakles.homelinux.org> wrote:

> 20:49 [summer@numbat ~]$ yum --help | grep root
> --installroot=[path] set install root
> 20:50 [summer@numbat ~]$

That just does what it says - sets the root where yum will install.
As near as I can tell though, it doesn't convince yum update to download
the proper packages for the version and architecture of the
linux located in that root. If it does, the documentation needs
more work :-).

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-28-2007, 09:07 PM
John Summerfield
 
Default Complete chroot environment?

Tom Horsley wrote:

On Fri, 28 Dec 2007 20:52:03 +0900
John Summerfield <debian@herakles.homelinux.org> wrote:


20:49 [summer@numbat ~]$ yum --help | grep root
--installroot=[path] set install root
20:50 [summer@numbat ~]$


That just does what it says - sets the root where yum will install.
As near as I can tell though, it doesn't convince yum update to download
the proper packages for the version and architecture of the
linux located in that root. If it does, the documentation needs
more work :-).




It _should_ work. So far, I've not had the need, but the equivalent
feature in rpm correctly maintains state in the specified root directory
tree.


If it doesn't, I think it's worth a bug report. I'd not argue to hard
whether it's a request for an enhancement or a "normal" bug where
something doesn't work, but it seems to me a sensible solution to your
problem.




--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 09:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org