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:32] 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 146: Line 102:
     I: Configuring tasksel...     I: Configuring tasksel...
     I: Base system installed successfully.     I: Base system installed successfully.
 +
 +==== Configuration de l'image ====
  
 ''debian:/mnt# mount -t proc none /mnt/cf/proc'' ''debian:/mnt# mount -t proc none /mnt/cf/proc''
-''debian:/mnt# mount -t sysfs nonen /mnt/cf/sys''+ 
 +''debian:/mnt# mount -t sysfs none /mnt/cf/sys''
  
 ''debian:/mnt# mount -o bind /proc /mnt/cf/proc'' ''debian:/mnt# mount -o bind /proc /mnt/cf/proc''
 +
 ''debian:/mnt# mount -o bind /dev /mnt/cf/dev'' ''debian:/mnt# mount -o bind /dev /mnt/cf/dev''
 +
 ''debian:/mnt# mount -o bind /sys /mnt/cf/sys'' ''debian:/mnt# mount -o bind /sys /mnt/cf/sys''
  
Line 158: Line 119:
 ''root@debian:/# mount devpts /dev/pts -t devpts'' ''root@debian:/# mount devpts /dev/pts -t devpts''
  
-''root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's/[[:space:]]//g')'' +''root@debian:/# UUID=$(dumpe2fs /dev/sdb1 | grep 'UUID' | cut -d':' -f2 | sed 's/ [ [:space:] ]/ /g')''
-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 +    dumpe2fs 1.41.12 (17-May-2010)
-root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab+
  
-root@debian:/# dpkg-reconfigure tzdata+''root@debian:/# echo $UUID''
  
-Current default time zone: 'Europe/Zurich' +    8c14d9c1-48cb-4ac1-b91d-780de47f8b8a
-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:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0//etc/fstab''
-# 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:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab''
-iface eth0 inet dhcp+
  
-root@debian:/# cat /etc/fstab  +''root@debian:/# dpkg-reconfigure tzdata''
-# 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+
  
 +    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:/# vi /etc/hostname  +''root@debian:/# vi /etc/network/interfaces ''
-NiX+
  
-root@debian:/sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list +    Used by ifup(8) and ifdown(8)See the interfaces(5) manpage or 
-root@debian:/sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list+    # /usr/share/doc/ifupdown/examples for more information. 
 +    auto lo 
 +    iface lo inet loopback 
 +     
 +    auto eth0 
 +    iface eth0 inet dhcp
  
-root@debian:/# cat /etc/apt/sources.list +''root@debian:/# cat /etc/fstab'' 
-deb http://ftp.ch.debian.org/debian squeeze main +    # UNCONFIGURED FSTAB FOR BASE SYSTEM 
-deb-src http://security,debian.orgsqueeze/updates main +    proc /proc proc defaults 0 0 
-deb http://security,debian.orgsqueeze/updates main+    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 update +''root@debian:/# vi /etc/hostname''
-root@debian:/# aptitude install locales+
  
-root@debian:/# dpkg-reconfigure locales +    NiX
-Generating locales (this might take a while)... +
-  fr_CH.ISO-8859-1... done +
-Generation complete.+
  
-root@debian:/# aptitude install console-data+''root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
  
-root@debian:/# aptitude install linux-image-486+''root@debian:/# sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list''
  
-root@debian:/# aptitude install grub+''root@debian:/# cat /etc/apt/sources.list''
  
-root@debian:/# vi /etc/default/grub  +    deb http://ftp.ch.debian.org/debian squeeze main 
-# If you change this file, run 'update-grub' afterwards to update +    deb-src http://security,debian.orgsqueeze/updates main 
-/boot/grub/grub.cfg.+    deb http://security,debian.orgsqueeze/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>
  
-GRUB_DEFAULT=0 +''root@debian:/# aptitude update''
-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:/aptitude install locales''
-# 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:/dpkg-reconfigure locales'' 
-#GRUB_TERMINAL=console +    Generating locales (this might take a while)... 
-GRUB_TERMINAL=serial+      fr_CH.ISO-8859-1... done 
 +    Generation complete.
  
-# The resolution used on graphical terminal +''root@debian:/aptitude install console-data''
-# 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:/aptitude install linux-image-486''
-#GRUB_DISABLE_LINUX_UUID=true+
  
-Uncomment to disable generation of recovery mode menu entries +''root@debian:/aptitude install grub''
-#GRUB_DISABLE_LINUX_RECOVERY="true"+
  
-# Uncomment to get a beep at grub start +''root@debian:/# vi /etc/default/grub'' 
-#GRUB_INIT_TUNE="480 440 1"+    # 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"
  
-debian:/mnt/cf/boot/grub# echo '(hd0) /dev/sdb' > /boot/grub/device.map+''debian:/mnt/cf/boot/grub# echo '(hd0) /dev/sdb' > /boot/grub/device.map''
  
-root@debian:/# grub-install /dev/sdb +''root@debian:/# grub-install /dev/sdb'' 
-Installation finished. No error reported.+    Installation finished. No error reported.
  
-root@debian:/# update-grub +''root@debian:/# update-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 +    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
  
-root@debian:/# vi /etc/inittab  +''root@debian:/# sed -i 's/hd1/hd0/g' /boot/grub/grub.cfg''
-#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:/# vi /etc/inittab''
  
-root@debian:/# passwd root    (nixpw) +    #1:2345:respawn:/sbin/getty 38400 tty1 
-Enter new UNIX password:  +    #2:23:respawn:/sbin/getty 38400 tty2 
-Retype new UNIX password:  +    #3:23:respawn:/sbin/getty 38400 tty3 
-passwdpassword updated successfully+    #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:/# aptitude install rsyslog sudo +''root@debian:/# passwd root    (nixpw)''
-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/ +    Enter new UNIX password:  
-debian:/# umount /mnt/cf/sys +    Retype new UNIX password:  
-debian:/# umount /mnt/cf/dev +    passwdpassword updated successfully
-debian:/# umount /mnt/cf+
  
 +''root@debian:/# aptitude install rsyslog sudo''
  
-debian:/mntdf -h +''root@debian:/# tasksel install standard''
-Filesystem            Size  Used Avail Use% Mounted on +
-/dev/sdb1             3.7G  547M  3.0G  16% /mnt/cf+
  
 +''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