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:18] – [Formatage de la carte] 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 134: Line 90:
 ===== Installation de Debian ===== ===== Installation de Debian =====
  
-debian:/mnt# mount /dev/sdb1 /mnt/cf/+==== Installation de l'image ====
  
-debian:/mnt# debootstrap --arch i386 squeeze /mnt/cf/ http://ftp.ch.debian.org/debian +L'utilitaire 'debootstrap' va installer une image de Debian sur la carte.
-.... +
-I: Configuring aptitude... +
-I: Configuring tasksel-data... +
-I: Configuring tasksel... +
-I: Base system installed successfully.+
  
----- debian:/mnt# mount -t proc none /mnt/cf/proc +''debian:/mnt# mount /dev/sdb1 /mnt/cf/''
----- debian:/mnt# mount -t sysfs nonen /mnt/cf/sys+
  
-debian:/mnt# mount -o bind /proc /mnt/cf/proc +''debian:/mnt# debootstrap --arch i386 squeeze /mnt/cf/ http://ftp.ch.debian.org/debian'' 
-debian:/mnt# mount -o bind /dev /mnt/cf/dev +    .... 
-debian:/mnt# mount -o bind /sys /mnt/cf/sys+    I: Configuring aptitude... 
 +    IConfiguring tasksel-data... 
 +    I: Configuring tasksel... 
 +    I: Base system installed successfully.
  
-debian:/mnt# LANG=C chroot /mnt/cf/ /bin/bash+==== Configuration de l'image ====
  
-root@debian:/# mount devpts /dev/pts -t devpts+''debian:/mnt# mount -t proc none /mnt/cf/proc''
  
-root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's/[[:space:]]//g'+''debian:/mntmount -t sysfs none /mnt/cf/sys''
-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 /proc /mnt/cf/proc''
-root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab+
  
-root@debian:/# dpkg-reconfigure tzdata+''debian:/mntmount -o bind /dev /mnt/cf/dev''
  
-Current default time zone: 'Europe/Zurich' +''debian:/mnt# mount -o bind /sys /mnt/cf/sys''
-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  +''debian:/mntLANG=C chroot /mnt/cf/ /bin/bash''
-# 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 +''root@debian:/# mount devpts /dev/pts -t devpts''
-iface eth0 inet dhcp+
  
-root@debian:/# cat /etc/fstab  +''root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's[ [:space:] ]/ /g')''
-# 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+
  
 +    dumpe2fs 1.41.12 (17-May-2010)
  
-root@debian:/# vi /etc/hostname  +''root@debian:/# echo $UUID''
-NiX+
  
-root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list +    8c14d9c1-48cb-4ac1-b91d-780de47f8b8a
-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:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0//etc/fstab''
-deb http://ftp.ch.debian.org/debian squeeze main +
-deb-src http://security,debian.orgsqueeze/updates main +
-deb http://security,debian.org/ squeeze/updates main+
  
-root@debian:/# aptitude update +''root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab''
-root@debian:/# aptitude install locales+
  
-root@debian:/# dpkg-reconfigure locales +''root@debian:/# dpkg-reconfigure tzdata''
-Generating locales (this might take a while)... +
-  fr_CH.ISO-8859-1... done +
-Generation complete.+
  
-root@debian:/# aptitude install console-data+    Current default time zone'Europe/Zurich' 
 +    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:/# aptitude install linux-image-486+''root@debian:/# vi /etc/network/interfaces ''
  
-root@debian:/aptitude install grub+    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:/# vi /etc/default/grub  +''root@debian:/# cat /etc/fstab'' 
-If you change this file, run 'update-grub' afterwards to update +    # UNCONFIGURED FSTAB FOR BASE SYSTEM 
-/boot/grub/grub.cfg.+    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
  
-GRUB_DEFAULT=0 +''root@debian:/# vi /etc/hostname''
-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 +    NiX
-# 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:/sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
-#GRUB_TERMINAL=console +
-GRUB_TERMINAL=serial+
  
-# The resolution used on graphical terminal +''root@debian:/sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
-# 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 +''root@debian:/cat /etc/apt/sources.list''
-#GRUB_DISABLE_LINUX_UUID=true+
  
-# Uncomment to disable generation of recovery mode menu entries +    deb http://ftp.ch.debian.org/debian squeeze main 
-#GRUB_DISABLE_LINUX_RECOVERY="true"+    deb-src http://security,debian.org/ squeeze/updates main 
 +    deb http://security,debian.org/ squeeze/updates main 
 +     
 +<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 to get a beep at grub start +''root@debian:/aptitude update''
-#GRUB_INIT_TUNE="480 440 1"+
  
-debian:/mnt/cf/boot/grubecho '(hd0) /dev/sdb> /boot/grub/device.map+''root@debian:/# aptitude install locales''
  
-root@debian:/# grub-install /dev/sdb +''root@debian:/# dpkg-reconfigure locales'' 
-Installation finishedNo error reported.+    Generating locales (this might take a while)... 
 +      fr_CH.ISO-8859-1... done 
 +    Generation complete.
  
-root@debian:/# update-grub +''root@debian:/# aptitude install console-data''
-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 -'s/hd1/hd0/g/boot/grub/grub.cfg +''root@debian:/# aptitude install linux-image-486''
  
-root@debian:/# vi /etc/inittab  +''root@debian:/# aptitude install grub''
-#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 -ttyS0 9600 vt100+''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:/# passwd root    (nixpw) +''debian:/mnt/cf/boot/grubecho '(hd0/dev/sdb' > /boot/grub/device.map''
-Enter new UNIX password:  +
-Retype new UNIX password:  +
-passwd: password updated successfully+
  
-root@debian:/# aptitude install rsyslog sudo +''root@debian:/# grub-install /dev/sdb'' 
-root@debian:/# tasksel install standard +    Installation finished. No error reported.
-root@debian:/# tasksel install ssh-server +
-root@debian:/# aptitude clean +
-root@debian:/# umount /dev/pts +
-root@debian:/# exit +
-exit+
  
-debian:/# umount /mnt/cf/proc/ +''root@debian:/# update-grub''
-debian:/# umount /mnt/cf/sys +
-debian:/# umount /mnt/cf/dev +
-debian:/# umount /mnt/cf+
  
 +    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
  
-debian:/mntdf -+''root@debian:/# sed -i 's/hd1/hd0/g' /boot/grub/grub.cfg''
-Filesystem            Size  Used Avail Use% Mounted on +
-/dev/sdb1             3.7G  547M  3.0G  16% /mnt/cf+
  
 +''root@debian:/# vi /etc/inittab''
 +
 +    #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:/# 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