Difference between revisions of "Minimal"

From PostgreSQL_wiki
Jump to: navigation, search
 
(Op de host)
Line 3: Line 3:
   
 
== Op de host ==
 
== Op de host ==
  +
Maak een file system aan voor het OS op de USB stick.
mkfs.ext2 /dev/sdf1
 
  +
<pre>
94 debootstrap --arch i386 etch $CHROOT_DIR http://ftp.debian.org/debian
 
  +
root@host:~# fdisk /dev/sdb
95 debootstrap --arch i386 squeeze $CHROOT_DIR http://ftp.debian.org/debian
 
96 fdisk /dev/sdf
+
root@host:~# mkfs.ext2 /dev/sdb1
  +
</pre>
97 e2label /dev/sdf1 USB_ROOT
 
  +
Maak een folder aan op de host om daarin de installatie voor de usb-stick voor te bereiden.
98 debootstrap --arch i386 squeeze /dev/sdf1 http://ftp.nl.debian.org/debian
 
  +
<pre>
99 mount
 
  +
root@host:~# mkdir /usbsystem
100 mount -t ext2 /dev/sdf1 /mnt
 
101 debootstrap --arch i386 squeeze /mnt http://ftp.nl.debian.org/debian
+
root@host:~# debootstrap --arch i386 squeeze /usbsystem http://ftp.nl.debian.org/debian
102 vi croot.sh
+
root@host:~# ./croot.sh /usbsystem
  +
root@host:~# umount /usbsystem/dev/ /usbsystem/sys /usbsystem/proc /usbsystem/tmp
103 chmod +x croot.sh
 
  +
</pre>
104 mount
 
105 ./croot.sh /mnt
 
106 mv croot.sh chroot.sh
 
107 cp -p chroot.sh chroot.sh.org
 
108 ./chroot.sh /mnt
 
109 mount
 
110 ls -al /mnt/
 
111 ./chroot.sh /mnt
 
112 chroot /mnt
 
113 ./chroot.sh /mnt
 
114 ./chroot.sh /mnt
 
115 ./chroot.sh /mnt
 
116 ./chroot.sh /mnt
 
117 umount /mnt/dev/ /mnt/sys /mnt/proc /mnt/tmp
 
   
 
== chrooted ==
 
== chrooted ==

Revision as of 19:36, 3 January 2011

Debian minimal USB

Een bootable Debian USB is goud waard in een migratie uit Windows naar Linux.

Op de host

Maak een file system aan voor het OS op de USB stick.

root@host:~# fdisk /dev/sdb
root@host:~# mkfs.ext2 /dev/sdb1

Maak een folder aan op de host om daarin de installatie voor de usb-stick voor te bereiden.

root@host:~# mkdir /usbsystem
root@host:~# debootstrap --arch i386 squeeze /usbsystem http://ftp.nl.debian.org/debian
root@host:~# ./croot.sh /usbsystem
root@host:~# umount /usbsystem/dev/ /usbsystem/sys /usbsystem/proc /usbsystem/tmp

chrooted

  1  uname -a
   2  vi /etc/fstab 
   3  vi /etc/fstab 
   4  vi /etc/fstab 
   5  vi /etc/apt/sources.list
   6  rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
   7  echo "127.0.0.1 localhost" > /etc/hosts
   8  history 
   9  apt-get install localepurge
  10  localepurge 
  11  apt-cache search linux | grep image | grep 386
  12  apt-cache search linux 
  13  apt-cache search kernel
  14  uname -a
  15  apt-get install linux-image-2.6-686
  16  vi /etc/default/locale 
  17  apt-get install grub
  18  echo lang
  19  echo LANG
  20  echo $LANG
  21  vi /boot/grub/grub.cfg 
  22  groupadd martin
  23  useradd --home /home/martin --shell /bin/bash --gid martin
  24  mkdir /home/martin
  25  useradd --home /home/martin --shell /bin/bash --gid martin
  26  useradd --home-dir /home/martin --shell /bin/bash --gid martin
  27  useradd --home-dir /home/martin --shell /bin/bash --gid martin martin
  28  apt-get install rungetty
  29  sed -i '/getty/d' /etc/inittab
  30  vi rungetty-script
  31  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin
  32  EOF
  33  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin EOF
  34  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin
  35  vi /etc/inittab 
  36  apt-get clean
  37  exit
  38  history    1  uname -a
   2  vi /etc/fstab 
   3  vi /etc/fstab 
   4  vi /etc/fstab 
   5  vi /etc/apt/sources.list
   6  rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
   7  echo "127.0.0.1 localhost" > /etc/hosts
   8  history 
   9  apt-get install localepurge
  10  localepurge 
  11  apt-cache search linux | grep image | grep 386
  12  apt-cache search linux 
  13  apt-cache search kernel
  14  uname -a
  15  apt-get install linux-image-2.6-686
  16  vi /etc/default/locale 
  17  apt-get install grub
  18  echo lang
  19  echo LANG
  20  echo $LANG
  21  vi /boot/grub/grub.cfg 
  22  groupadd martin
  23  useradd --home /home/martin --shell /bin/bash --gid martin
  24  mkdir /home/martin
  25  useradd --home /home/martin --shell /bin/bash --gid martin
  26  useradd --home-dir /home/martin --shell /bin/bash --gid martin
  27  useradd --home-dir /home/martin --shell /bin/bash --gid martin martin
  28  apt-get install rungetty
  29  sed -i '/getty/d' /etc/inittab
  30  vi rungetty-script
  31  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin
  32  EOF
  33  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin EOF
  34  cat >> /etc/inittab << face="courier new">1:2345:respawn:/sbin/rungetty --autologin martin
  35  vi /etc/inittab 
  36  apt-get clean
  37  exit
  38  history