Google
 
Web www.bloodpet.tk
phreakfish.blogspot.com emans.blogspot.com

20050623

Kewl chroot tips

8.6.35 chroot

The chroot program, chroot(8), enables us to run different instances of the GNU/Linux environment on a single system simultaneously without rebooting.

One may also run a resource hungry program such as apt-get or dselect under the chroot of a fast host machine while NFS-mounting a slow satellite machine to the host as r/w and the chroot point being the mount point of the satellite machine.


8.6.35.1 Run a different Debian distribution with chroot

A chroot Debian environment can easily be created by the debootstrap command in Woody. For example, to create a Sid chroot on /sid-root while having fast Internet access:

     main # cd / ; mkdir /sid-root
main # debootstrap sid /sid-root http://ftp.debian.org/debian/
... watch it download the whole system
main # echo "proc-sid /sid-root/proc proc none 0 0" >> /etc/fstab
main # mount proc-sid /sid-root/proc -t proc
main # cp /etc/hosts /sid-root/etc/hosts
main # chroot /sid-root /bin/bash
chroot # apt-setup # set-up /etc/apt/sources.list
chroot # vi /etc/apt/sources.list # point the source to unstable
chroot # dselect # you may use aptitude, install mc and vim :-)

At this point you should have a fully working Debian system, where you can play around without fear of affecting your main Debian installation.

This debootstrap trick can also be used to install Debian to a system without using a Debian install disk, but instead one for another GNU/Linux distribution. See http://www.debian.org/releases/stable/i386/ch-preparing#s-linux-upgrade.


8.6.35.2 Setting up login for chroot

Typing chroot /sid-root /bin/bash is easy, but it retains all sorts of environment variables that you may not want, and has other issues. A much better approach is to run another login process on a separate virtual terminal where you can log in to the chroot directly.

Since on default Debian systems tty1 to tty6 run Linux consoles and tty7 runs the X Window System, let's set up tty8 for a chrooted console as an example. After creating a chroot system as described in Run a different Debian distribution with chroot, Section 8.6.35.1, type from the root shell of the main system:

     main # echo "8:23:respawn:/usr/sbin/chroot /sid-root "        "/sbin/getty 38400 tty8"  >> /etc/inittab
main # init q # reload init

8.6.35.3 Setting up X for chroot

You want to run the latest X and GNOME safely in your chroot? That's entirely possible! The following example will make GDM run on virtual terminal vt9.

First install a chroot system using the method described in Run a different Debian distribution with chroot, Section 8.6.35.1. From the root of the main system, copy key configuration files to the chroot system.

     main # cp /etc/X11/XF86Config-4 /sid-root/etc/X11/XF86Config-4
main # chroot /sid-root # or use chroot console
chroot # apt-get install gdm gnome x-window-system
chroot # vi /etc/gdm/gdm.conf # do s/vt7/vt9/ in [servers] section
chroot # /etc/init.d/gdm start

Here, /etc/gdm/gdm.conf was edited to change the first virtual console from vt7 to vt9.

Now you can easily switch back and forth between full X environments in your chroot and your main system just by switching between Linux virtual terminals; e.g. by using Ctrl-Alt-F7 and Ctrl-Alt-F9. Have fun!

[FIXME] Add a comment and link to the init script of the chrooted gdm.


8.6.35.4 Run other distributions with chroot

A chroot environment for another Linux distribution can easily be created. You install a system into separate partitions using the installer of the other distribution. If its root partition is in /dev/hda9:

     main # cd / ; mkdir /other-dist
main # mount -t ext3 /dev/hda9 /other-dist
main # chroot /other-dist /bin/bash

Then proceed as in Run a different Debian distribution with chroot, Section 8.6.35.1, Setting up login for chroot, Section 8.6.35.2, and Setting up X for chroot, Section 8.6.35.3.


8.6.35.5 Build a package with chroot

There is a more specialized chroot package, pbuilder, which constructs a chroot system and builds a package inside the chroot. It is an ideal system to use to check that a package's build-dependencies are correct, and to be sure that unnecessary and wrong build dependencies will not exist in the resulting package.



source: Debian Reference - Chapter 8 - Debian tips

20050618

LinuxWorld San Francisco 2005: 15% Registration Discount

As a member of Novell Linux Users International, LinuxWorld Conference & Expo is extending you a special offer. Register by July 8 for any conference package and receive an additional 15% off early bird pricing. That includes the Hands-on Labs, Tutorials and the *new* System Administration Workshop.
Too bad i can't come.

20050613

Moving from Slackware 10.0 to Debian 3.1 (sarge)

After the announcement that Debian 3.1 "sarge" -- the deb release with the easy installer -- is now released as stable, i d/led the netinst cd. This is the first time i'm able to do this. I usually d/l everything i needed cause i had to connect this comp directly to the net. But since i connect thru a router now, connecting to the net's not a problem.

The netinst routine also saved time 'cause i downloaded only the packages i needed. And the delay in my work's minimal cause i installed every work-related software first, then the other packages later.

I have to admit, the whole apt system's really convenient. There are a few annoying things -- like the Apache2 being installed along with Apache1 by default, but that's no biggie. I still have that problem of making SSI work in Apache, but that's just configurations.

Right now, i like what i've seen with Debian, and i'm probably gonna replace my Slackware installation entirely.

20050608

some humor from gopherspace

gopher://erwin.complete.org/1/Humor%20and%20Fun

USENET Oracle:
gopher://erwin.complete.org/1/Archives/mirrors/ftp.cs.indiana.edu/pub/oracle
gopher://erwin.complete.org/0/Archives/mirrors/ftp.cs.indiana.edu/pub/oracle/00/0001|/MBOX-MESSAGE/1