User Tools

Site Tools


operating_systems:linux:debian:flash_card

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
operating_systems:linux:debian:flash_card [2012/07/16 11:31] tretoperating_systems:linux:debian:flash_card [2013/12/20 09:56] – [Configuration de l'image] jzaehrin
Line 3: Line 3:
 Installation d'une Debian sur une carte flash. Installation d'une Debian sur une carte flash.
  
 +Version humainement lisible: [[Flash Card Tret]]
 +
 +[[operating_systems:linux:debian:flash_card:Ubuntu_upstart|Bug de upstart en chroot]]
 ===== Préparation de la carte ===== ===== Préparation de la carte =====
  
-==== Suppression des partitions ==== 
- 
-On commence par supprimer les partitions déjà crées sur la carte. 
- 
-''debian:/home/sbolay# fdisk /dev/sdb'' 
- 
-    Command (m for help): p 
-         
-    Disk /dev/sdb: 4000 MB, 4000317440 bytes 
-    124 heads, 62 sectors/track, 1016 cylinders 
-    Units = cylinders of 7688 * 512 = 3936256 bytes 
-    Disk identifier: 0xbf7f3f48 
-     
-      Device Boot      Start         End      Blocks   Id  System 
-    /dev/sdb1                    1013     3893941   83  Linux 
-    /dev/sdb2            1014        1016       11532   83  Linux 
-     
-    Command (m for help): d 1 
-    Partition number (1-4): 1 
-     
-    Command (m for help): p 
-     
-    Disk /dev/sdb: 4000 MB, 4000317440 bytes 
-    124 heads, 62 sectors/track, 1016 cylinders 
-    Units = cylinders of 7688 * 512 = 3936256 bytes 
-    Disk identifier: 0x00000000 
-     
-    Device Boot      Start         End      Blocks   Id  System 
-    /dev/sdb2            1014        1016       11532   83  Linux 
-     
-    Command (m for help): d 1 
-    Selected partition 2 
-     
-    Command (m for help): p 
-     
-    Disk /dev/sdb: 4000 MB, 4000317440 bytes 
-    124 heads, 62 sectors/track, 1016 cylinders 
-    Units = cylinders of 7688 * 512 = 3936256 bytes 
-    Disk identifier: 0x00000000 
-     
-    Device Boot      Start         End      Blocks   Id  System 
-     
-    Command (m for help): w 
-    The partition table has been altered! 
-     
-    Calling ioctl() to re-read partition table. 
-    Syncing disks.  
  
-Une fois les partitions supprimées, on réinitialise la carte à zéro.+Réinitialiser la carte à zéro.
  
 ''debian:/home/sbolay# dd if=/dev/zero of=/dev/sdb'' ''debian:/home/sbolay# dd if=/dev/zero of=/dev/sdb''
Line 138: Line 94:
 L'utilitaire 'debootstrap' va installer une image de Debian sur la carte. L'utilitaire 'debootstrap' va installer une image de Debian sur la carte.
  
-debian:/mnt# mount /dev/sdb1 /mnt/cf/+''debian:/mnt# mount /dev/sdb1 /mnt/cf/''
  
-debian:/mnt# debootstrap --arch i386 squeeze /mnt/cf/ http://ftp.ch.debian.org/debian +''debian:/mnt# debootstrap --arch i386 squeeze /mnt/cf/ http://ftp.ch.debian.org/debian'' 
-.... +    .... 
-I: Configuring aptitude... +    I: Configuring aptitude... 
-I: Configuring tasksel-data... +    I: Configuring tasksel-data... 
-I: Configuring tasksel... +    I: Configuring tasksel... 
-I: Base system installed successfully.+    I: Base system installed successfully.
  
----- debian:/mnt# mount -t proc none /mnt/cf/proc +==== Configuration de l'image ====
----- debian:/mnt# mount -t sysfs nonen /mnt/cf/sys+
  
-debian:/mnt# mount -o bind /proc /mnt/cf/proc +''debian:/mnt# mount -proc none /mnt/cf/proc''
-debian:/mnt# mount -o bind /dev /mnt/cf/dev +
-debian:/mnt# mount -o bind /sys /mnt/cf/sys+
  
-debian:/mnt# LANG=C chroot /mnt/cf/ /bin/bash+''debian:/mnt# mount -t sysfs none /mnt/cf/sys''
  
-root@debian:/# mount devpts /dev/pts -t devpts+''debian:/mnt# mount -o bind /proc /mnt/cf/proc''
  
-root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's/[[:space:]]//g'+''debian:/mntmount -o bind /dev /mnt/cf/dev''
-dumpe2fs 1.41.12 (17-May-2010) +
-root@debian:/# echo $UUID +
-8c14d9c1-48cb-4ac1-b91d-780de47f8b8a+
  
-root@debian:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0/" /etc/fstab +''debian:/mntmount -o bind /sys /mnt/cf/sys''
-root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab+
  
-root@debian:/# dpkg-reconfigure tzdata+''debian:/mntLANG=C chroot /mnt/cf/ /bin/bash''
  
-Current default time zone'Europe/Zurich' +''root@debian:/# mount devpts /dev/pts -t devpts''
-Local time is now:      Fri Oct 14 17:16:25 CEST 2011. +
-Universal Time is now:  Fri Oct 14 15:16:25 UTC 2011.+
  
-root@debian:/# vi /etc/network/interfaces  +''root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's[ [:space:] ]/ /g')''
-# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or +
-/usr/share/doc/ifupdown/examples for more information. +
-auto lo +
-iface lo inet loopback+
  
-auto eth0 +    dumpe2fs 1.41.12 (17-May-2010)
-iface eth0 inet dhcp+
  
-root@debian:/# cat /etc/fstab  +''root@debian:/# echo $UUID''
-# UNCONFIGURED FSTAB FOR BASE SYSTEM +
-proc /proc proc defaults 0 0 +
-UUID=8c14d9c1-48cb-4ac1-b91d-780de47f8b8a / ext3 defaults,noatime 0 1 +
-#/dev/sda1 /         ext3  defaults,noatime 0 1 +
-tmpfs     /tmp      tmpfs defaults,noatime 0 0 +
-tmpfs     /var/tmp  tmpfs defaults,noatime 0 0 +
-tmpfs     /var/run  tmpfs defaults 0 0 +
-tmpfs     /var/log  tmpfs defaults 0 0 +
-tmpfs     /var/lock tmpfs defaults 0 0+
  
 +    8c14d9c1-48cb-4ac1-b91d-780de47f8b8a
  
-root@debian:/# vi /etc/hostname  +''root@debian:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0/" /etc/fstab''
-NiX+
  
-root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main//etc/apt/sources.list +''root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1//etc/fstab''
-root@debian:/# sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\squeeze\/updates main/' /etc/apt/sources.list+
  
-root@debian:/# cat /etc/apt/sources.list +''root@debian:/# dpkg-reconfigure tzdata''
-deb http://ftp.ch.debian.org/debian squeeze main +
-deb-src http://security,debian.org/ squeeze/updates main +
-deb http://security,debian.org/ squeeze/updates main+
  
-root@debian:/# aptitude update +    Current default time zone'Europe/Zurich' 
-root@debian:/# aptitude install locales+    Local time is now     Fri Oct 14 17:16:25 CEST 2011. 
 +    Universal Time is now:  Fri Oct 14 15:16:25 UTC 2011.
  
-root@debian:/# dpkg-reconfigure locales +''root@debian:/# vi /etc/network/interfaces ''
-Generating locales (this might take a while)... +
-  fr_CH.ISO-8859-1... done +
-Generation complete.+
  
-root@debian:/aptitude install console-data+    Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or 
 +    # /usr/share/doc/ifupdown/examples for more information. 
 +    auto lo 
 +    iface lo inet loopback 
 +     
 +    auto eth0 
 +    iface eth0 inet dhcp
  
-root@debian:/# aptitude install linux-image-486+''root@debian:/# cat /etc/fstab'' 
 +    # UNCONFIGURED FSTAB FOR BASE SYSTEM 
 +    proc /proc proc defaults 0 0 
 +    UUID=8c14d9c1-48cb-4ac1-b91d-780de47f8b8a / ext3 defaults,noatime 0 1 
 +    #/dev/sda1 /         ext3  defaults,noatime 0 1 
 +    tmpfs     /tmp      tmpfs defaults,noatime 0 0 
 +    tmpfs     /var/tmp  tmpfs defaults,noatime 0 0 
 +    tmpfs     /var/run  tmpfs defaults 0 0 
 +    tmpfs     /var/log  tmpfs defaults 0 0 
 +    tmpfs     /var/lock tmpfs defaults 0 0
  
-root@debian:/# aptitude install grub+''root@debian:/# vi /etc/hostname''
  
-root@debian:/# vi /etc/default/grub  +    NiX
-# If you change this file, run 'update-grub' afterwards to update +
-# /boot/grub/grub.cfg.+
  
-GRUB_DEFAULT=0 +''root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
-GRUB_TIMEOUT=5 +
-GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +
-#GRUB_CMDLINE_LINUX_DEFAULT="quiet" +
-GRUB_CMDLINE_LINUX_DEFAULT="verbose console=ttyS0,38400n8 reboot=bios" +
-GRUB_SERIAL_COMMAND="serial --unit=0 --speed=38400" +
-GRUB_CMDLINE_LINUX=""+
  
-Uncomment to enable BadRAM filtering, modify to suit your needs +''root@debian:/sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
-# This works with Linux (no patch required) and with any kernel that obtains +
-# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...+
-#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"+
  
-Uncomment to disable graphical terminal (grub-pc only) +''root@debian:/cat /etc/apt/sources.list''
-#GRUB_TERMINAL=console +
-GRUB_TERMINAL=serial+
  
-# The resolution used on graphical terminal +    deb http://ftp.ch.debian.org/debian squeeze main 
-# note that you can use only modes which your graphic card supports via VBE +    deb-src http://security,debian.org/ squeeze/updates main 
-# you can see them in real GRUB with the command `vbeinfo' +    deb http://security,debian.org/ squeeze/updates main 
-#GRUB_GFXMODE=640x480+     
 +<note important>a partir de cette étape, il est possible qu'une erreur de Upstart survient, pour contourné ce problème, suivez c'est quelques lignes [[operating_systems:linux:debian:flash_card:Ubuntu_upstart|ici]] et reprenez les mise à jour des packets du début.</note>
  
-# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux +''root@debian:/aptitude update''
-#GRUB_DISABLE_LINUX_UUID=true+
  
-Uncomment to disable generation of recovery mode menu entries +''root@debian:/aptitude install locales''
-#GRUB_DISABLE_LINUX_RECOVERY="true"+
  
-Uncomment to get beep at grub start +''root@debian:/dpkg-reconfigure locales'' 
-#GRUB_INIT_TUNE="480 440 1"+    Generating locales (this might take while)... 
 +      fr_CH.ISO-8859-1... done 
 +    Generation complete.
  
-debian:/mnt/cf/boot/grubecho '(hd0) /dev/sdb> /boot/grub/device.map+''root@debian:/# aptitude install console-data''
  
-root@debian:/# grub-install /dev/sdb +''root@debian:/# aptitude install linux-image-486''
-Installation finished. No error reported.+
  
-root@debian:/# update-grub +''root@debian:/# aptitude install grub''
-Generating grub.cfg ... +
-Found linux image: /boot/vmlinuz-2.6.32-5-486 +
-Found initrd image: /boot/initrd.img-2.6.32-5-486 +
-done+
  
---CHECK-- root@debian:/# sed -i 's/hd1/hd0/g' /boot/grub/grub.cfg +''root@debian:/# vi /etc/default/grub'
 +    # If you change this file, run 'update-grub' afterwards to update 
 +    # /boot/grub/grub.cfg
 +     
 +    GRUB_DEFAULT=0 
 +    GRUB_TIMEOUT=5 
 +    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` 
 +    #GRUB_CMDLINE_LINUX_DEFAULT="quiet" 
 +    GRUB_CMDLINE_LINUX_DEFAULT="verbose console=ttyS0,38400n8 reboot=bios" 
 +    GRUB_SERIAL_COMMAND="serial --unit=0 --speed=38400" 
 +    GRUB_CMDLINE_LINUX="" 
 +     
 +    # Uncomment to enable BadRAM filtering, modify to suit your needs 
 +    # This works with Linux (no patch required) and with any kernel that obtains 
 +    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) 
 +    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" 
 +     
 +    # Uncomment to disable graphical terminal (grub-pc only) 
 +    #GRUB_TERMINAL=console 
 +    GRUB_TERMINAL=serial 
 +     
 +    # The resolution used on graphical terminal 
 +    # note that you can use only modes which your graphic card supports via VBE 
 +    # you can see them in real GRUB with the command `vbeinfo' 
 +    #GRUB_GFXMODE=640x480 
 +     
 +    # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux 
 +    #GRUB_DISABLE_LINUX_UUID=true 
 +     
 +    # Uncomment to disable generation of recovery mode menu entries 
 +    #GRUB_DISABLE_LINUX_RECOVERY="true" 
 +     
 +    # Uncomment to get a beep at grub start 
 +    #GRUB_INIT_TUNE="480 440 1"
  
-root@debian:/# vi /etc/inittab  +''debian:/mnt/cf/boot/grubecho '(hd0) /dev/sdb' > /boot/grub/device.map''
-#1:2345:respawn:/sbin/getty 38400 tty1 +
-#2:23:respawn:/sbin/getty 38400 tty2 +
-#3:23:respawn:/sbin/getty 38400 tty3 +
-#4:23:respawn:/sbin/getty 38400 tty4 +
-#5:23:respawn:/sbin/getty 38400 tty5 +
-#6:23:respawn:/sbin/getty 38400 tty6+
  
-T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100+''root@debian:/# grub-install /dev/sdb'' 
 +    Installation finished. No error reported.
  
-root@debian:/# passwd root    (nixpw) +''root@debian:/# update-grub''
-Enter new UNIX password:  +
-Retype new UNIX password:  +
-passwd: password updated successfully+
  
-root@debian:/# aptitude install rsyslog sudo +    Generating grub.cfg ... 
-root@debian:/# tasksel install standard +    Found linux image: /boot/vmlinuz-2.6.32-5-486 
-root@debian:/# tasksel install ssh-server +    Found initrd image: /boot/initrd.img-2.6.32-5-486 
-root@debian:/# aptitude clean +    done
-root@debian:/# umount /dev/pts +
-root@debian:/# exit +
-exit+
  
-debian:/# umount /mnt/cf/proc/ +''root@debian:/# sed -i 's/hd1/hd0/g' /boot/grub/grub.cfg''
-debian:/# umount /mnt/cf/sys +
-debian:/# umount /mnt/cf/dev +
-debian:/# umount /mnt/cf+
  
 +''root@debian:/# vi /etc/inittab''
  
-debian:/mntdf -h +    #1:2345:respawn:/sbin/getty 38400 tty1 
-Filesystem            Size  Used Avail Use% Mounted on +    #2:23:respawn:/sbin/getty 38400 tty2 
-/dev/sdb1             3.7G  547M  3.0G  16% /mnt/cf+    #3:23:respawn:/sbin/getty 38400 tty3 
 +    #4:23:respawn:/sbin/getty 38400 tty4 
 +    #5:23:respawn:/sbin/getty 38400 tty5 
 +    #6:23:respawn:/sbin/getty 38400 tty6 
 +     
 +    T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
  
 +''root@debian:/# passwd root    (nixpw)''
 +
 +    Enter new UNIX password: 
 +    Retype new UNIX password: 
 +    passwd: password updated successfully
 +
 +''root@debian:/# aptitude install rsyslog sudo''
 +
 +''root@debian:/# tasksel install standard''
 +
 +''root@debian:/# tasksel install ssh-server''
 +
 +''root@debian:/# aptitude clean''
 +
 +''root@debian:/# umount /dev/pts''
 +
 +''root@debian:/# exit''
 +
 +    exit
 +
 +''debian:/# umount /mnt/cf/proc/''
 +
 +''debian:/# umount /mnt/cf/sys''
 +
 +''debian:/# umount /mnt/cf/dev''
 +
 +''debian:/# umount /mnt/cf''
 +
 +''debian:/mnt# df -h''
 +
 +    Filesystem            Size  Used Avail Use% Mounted on
 +    /dev/sdb1             3.7G  547M  3.0G  16% /mnt/cf
 +    
  
-Links:+Si le système d'exploitation ne démarre pas, revérifier fichier /etc/fstab. la variable UUID doit est impérativement collé au '=' et à l'UUID du stockage.  
 +===== Links: =====
 http://www.youtube.com/watch?v=6VPsgR4pMik http://www.youtube.com/watch?v=6VPsgR4pMik
 https://mseiwald.at/doc/alix/installation https://mseiwald.at/doc/alix/installation
operating_systems/linux/debian/flash_card.txt · Last modified: 2013/12/20 09:57 by jzaehrin