Difference between revisions of "Minimal"

From PostgreSQL_wiki
Jump to: navigation, search
(Debian minimal USB)
(Debian minimal USB)
Line 1: Line 1:
 
= Debian minimal USB =
 
= Debian minimal USB =
 
Een bootable Debian USB is goud waard in een migratie uit Windows naar Linux.
 
Een bootable Debian USB is goud waard in een migratie uit Windows naar Linux.
1. maak met unetbootin een een netinstall aan op een partitie op een usb-stick
+
* maak met unetbootin een een netinstall aan op een partitie op een usb-stick
2. Boot de doel machine met de usb-stick en voer de installatie uit
+
* Boot de doel machine met de usb-stick en voer de installatie uit
3. Grub maakt een foutje door de devices te verwisselen, sda <-> sdb
+
* Grub maakt een foutje door de devices te verwisselen, sda <-> sdb
4. Herstel de fout in grub edit en boot
+
* Herstel de fout in grub edit en boot
5. Pas na de boot /etc/fstab aan en doe update-grub
+
* Pas na de boot /etc/fstab aan en doe update-grub
   
De installatie is nog niet erg minimaal, maar hij werkt. Installeer ook nog tools om met Windows file systems te werken:
+
De installatie is nog niet erg minimaal, maar hij werkt.
  +
<pre>
  +
root@host:~# apt-get clean
  +
root@host:~# apt-get install localespurge
  +
root@host:~# localespurge
  +
</pre>
  +
  +
Installeer ook nog tools om met Windows file systems te werken:
   
   
Line 40: Line 47:
 
tmpfs /var/tmp tmpfs defaults,noatime 0 0
 
tmpfs /var/tmp tmpfs defaults,noatime 0 0
 
</pre>
 
</pre>
  +
Ruim de bestanden in bovenstaande directories op na een umount.
  +
 
1 uname -a
 
1 uname -a
 
2 vi /etc/fstab
 
2 vi /etc/fstab

Revision as of 01:15, 5 January 2011

Debian minimal USB

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

  • maak met unetbootin een een netinstall aan op een partitie op een usb-stick
  • Boot de doel machine met de usb-stick en voer de installatie uit
  • Grub maakt een foutje door de devices te verwisselen, sda <-> sdb
  • Herstel de fout in grub edit en boot
  • Pas na de boot /etc/fstab aan en doe update-grub

De installatie is nog niet erg minimaal, maar hij werkt.

root@host:~# apt-get clean
root@host:~# apt-get install localespurge
root@host:~# localespurge

Installeer ook nog tools om met Windows file systems te werken:


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

Doe eerst alle stappen uit chrooted en doe daarna:

root@host:~# umount /usbsystem/dev/ /usbsystem/sys /usbsystem/proc /usbsystem/tmp
root@host:~# umount /usbsystem-amd64/dev/ /usbsystem-amd64/sys /usbsystem-amd64/proc /usbsystem-amd64/tmp

chrooted

fstab

# UNCONFIGURED FSTAB FOR BASE SYSTEM                                                                                                            
LABEL=USB_ROOT / ext2 defaults,errors=remount-ro,noatime 0 1                                                                                    
proc /proc proc defaults 0 0                                                                                                                    
tmpfs /tmp tmpfs defaults,noatime 0 0                                                                                                           
tmpfs /var/lock tmpfs defaults,noatime 0 0                                                                                                      
tmpfs /var/log tmpfs defaults,noatime 0 0                                                                                                       
tmpfs /var/run tmpfs defaults,noatime 0 0                                                                                                       
tmpfs /var/tmp tmpfs defaults,noatime 0 0 

Ruim de bestanden in bovenstaande directories op na een umount.

  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