Quicklinks

EndUser

Test/Virtualisaton


Installieren

Kernel - Tuning

Network

Display / Pads

Bock Devices

Printer

USB-Devices

BenutzerSW

Server

Install Notes

General/Hints

anoyances.org

Collection of installation & troublshooting info related to my linux (debian/mint/ubuntu) installations

Links

http://www.debian.org/doc/manuals/securing-debian-howto/ap-chroot-apache-env.de.html

Jails

Howto Jail irssi und wohl andere auch - mittels Tools: mkjailenv ...

chroot pivot_root

schroot

Möglichkeit mehrere Installationen per schroot aufzurufen (alt: dchroot)

[??] - für Ubuntu? []X11 Probleme mit Berechtigung
http://www.debian-administration.org/articles/566

/etc/schroot/schroot.conf

[sid]
description=Debian sid (unstable)
type=directory
location=/srv/chroot/sid
priority=3
users=YOUR_USER
groups=SOME_GROUP_LIKE_users
root-groups=YOUR_ADMIN_USER
run-setup-scripts=true
run-exec-scripts=true

debootstrap --arch i386 sid /srv/chroot/sid http://ftp.br.debian.org/debian installation Sid
schroot -c sid -p aptitude install wengophone

$ xhost + (local:)
$ schroot -c sid -p wengophone

xchroot (ex openroot)

Erweiterung chroot für X11
http://www.elstel.com/xchroot/

Bsp:

sudo xchroot -u lucky /mnt/u1004/ shotwell
[] automount USB-Drive, CAM u.s.w. (bind mount von media nützt nichts, wegen Berechtigung zum lesen der Device)

workarround: sudo mount --bind /media/E0FD-1813/DCIM/ /mnt/u1004/mnt/cam/

dchroot

->schroot verwenden, da chroot depreciated
z.B. 32Bit chroots auf 64Bit rechnern, SW auf anderen Installationen
oder Open Office
http://xpt.sourceforge.net/techdocs/nix/chroot/chrt06-Amd6432bitChroot/ar01s03.html

Config: (owned by root)

 /etc/dchroot.conf         (1-spezifisch für dchoot)
 /etc/schroot/schroot.conf (2-für dchroot und schroot) 

[] - ziel-user?
[] - can't open Display...

chroot

  • 32Bit-chroot für 64Bit Systeme
  • Testen von anderen System

http://www.internettablettalk.com/wiki/index.php?title=Running_Debian_chroot
http://linux.kahl-com.de/page/3/ chroot (D)
http://wiki.ubuntuusers.de/32-Bit_chroot 64Bit-Architekturen

LANG=C cmd (orig,engl)

bsp:
mount --bind /proc /chroot/proc /od. mount -t proc none /chroot

mount --bind /dev /chroot/dev
# create some useful devices
mkdir dev/pts
test -b dev/null  && mknod dev/null   c   1 3
test -b dev/zero  && mknod dev/zero   c   1 5
test -b dev/tty   && mknod dev/tty    c   5 0
test -b dev/pts/0 && mknod dev/pts/0  c 136 0
test -b dev/pts/1 && mknod dev/pts/1  c 136 1
chmod 666 dev/null dev/zero dev/tty dev/pts/*


cp /proc/mounts /chroot/etc/mtab 
cp /etc/resolv.conf /chroot/etc/resolv.conf
Probleme:

[]-Grub Legacy zeigte nicht die korrekten Drives
[]-Aus Ubuntu lassen sich keine X-Fenster öffnen
[]-chroot-partition muss mit dev (nicht nodev) gemountet sein, allenfalls remounten (speziell USB-Devices)

Workarrounds:

mount --bind (z.B. /boot für Grub installationen auf fremder Disk)

Installation mit X11 anwenden

hints from: http://www.pixelbeat.org/docs/chroot.html
Starten von Ubuntu7.10 ab USB-Disk aus Ubuntu7.10 (analog der Anleitung)
mount --bind /dev/sdb2 /_inst #USB-Device

sudo cp /etc/resolv.conf /_inst/etc/  #Make DNS available to ubuntu
sudo /usr/sbin/chroot /_inst          #chroot to ubuntu root partition
mount /proc                           #make /proc virtual filesystem available
mount /sys                            #make /sys virtual filesystem available
mount /home                           #separate or shared partiton
[su - pogay ]                         #Change user from root to me
. /etc/environment && export LANG     #need to explicitly set locale (." "/etc...)

/dev ... mount --bind /dev /_inst/dev #/dev/null dev/pt/x others...(additonal mounts can be made after starting chroot).

X11:
1]
ssh -Y localhost (from "host"-Terminal)
echo $DISPLAY - ( localhost:10.0)

enable TCP access (in host)
GDM_CONF=`find /etc -name gdm.conf 2>/dev/null`
sudo sed -i 's/#DisallowTCP=true/DisallowTCP=false/' $GDM_CONF
(restart X-Server)

[] - tests - restart X-first
2]

in /etc/X11  Xwrapper.config
sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config (or in editor) 

[startx /usr/X11R6/bin/twm -- :1&]  minimal GUI
[startx -- :1 &]  #opens new grafical console alt-F8 ..

[ok]gdm (for Ubuntu, as root)  - minor errors couldn't initialize HAL, otherwise functinal 
chroot-terminal can be closed without affecting the new gdm instance

pivot_root

  • Im Gegensatz zu chroot kann das alte Root abgehängt werden
  • wird verwendet für Systemstart (Minisystem->zum Booten)
  • zum Test: Booten von Testsystemen aus einem System
mount -t ext3 /dev/hda5 /mnt
mount --bind /mnt/home/.../newroot/ /mnt2

Und das Beste ist, jetzt kann man /mnt sogar unmounten, ohne dass /mnt2 verschwindet und dahin das Root-Verzeichnis wechseln.


umount /mnt
pivot_root /mnt2 /mnt2/initrd

www.knoppix.net/wiki/Pivot_Root_Install
http://www.pro-linux.de/t_system/chroot-booten.html

Probleme:

[]-Achtung: gilt dann für ganzes System
[] sudo ging nicht, kein root (ubuntu804)

Script um ein neues ext2-System zu testen (von Fabian Franz Pro Linux)

#!/static/sh
insmod /modules/jbd.o
insmod /modules/ext3.o
mount -t proc proc /proc
echo 256 > /proc/sys/kernel/real-root-dev
umount /proc
mount -t ext3 /dev/hda5 /mnt
/bin/mount --bind /mnt/home/ffranz/newroot /mnt2
umount /mnt
/static/pivot_root /mnt2 /mnt2/initrd
Categorie: Boot Testing
Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on October 27, 2013, at 08:26 PM, visited:$PageCount