Both sides previous revisionPrevious revisionNext revision | Previous revision |
operating_systems:linux:debian:flash_card [2012/07/16 12:21] – tret | operating_systems:linux:debian:flash_card [2013/12/20 09:57] (current) – [Configuration de l'image] jzaehrin |
---|
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 * 1 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'' |
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'' |
| |
''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) | dumpe2fs 1.41.12 (17-May-2010) |
| |
''root@debian:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0/" /etc/fstab'' | ''root@debian:/# sed -i "1s/$/\n proc \/proc proc nodev,noexec,nosuid 0 0/" /etc/fstab'' |
| |
''root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab'' | ''root@debian:/# sed -i "1s/$/\n UUID=$UUID \/ ext3 defaults,noatime 0 1/" /etc/fstab'' |
| |
| |
''root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list'' | ''root@debian:/# sed -i '1s/$/\ndeb http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list'' |
| |
''root@debian:/# sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list'' | ''root@debian:/# sed -i '1s/$/\ndeb-src http:\/\/security\.debian\.org\/ squeeze\/updates main/' /etc/apt/sources.list'' |
| |
deb-src http://security,debian.org/ squeeze/updates main | deb-src http://security,debian.org/ squeeze/updates main |
deb 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 survienne, 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> |
| |
''root@debian:/# aptitude update'' | ''root@debian:/# aptitude update'' |
| |
''root@debian:/# aptitude install locales'' | ''root@debian:/# aptitude install locales'' |
| |
| |
''root@debian:/# aptitude install rsyslog sudo'' | ''root@debian:/# aptitude install rsyslog sudo'' |
| |
''root@debian:/# tasksel install standard'' | ''root@debian:/# tasksel install standard'' |
| |
''root@debian:/# tasksel install ssh-server'' | ''root@debian:/# tasksel install ssh-server'' |
| |
''root@debian:/# aptitude clean'' | ''root@debian:/# aptitude clean'' |
| |
''root@debian:/# umount /dev/pts'' | ''root@debian:/# umount /dev/pts'' |
| |
''root@debian:/# exit'' | ''root@debian:/# exit'' |
| |
| |
''debian:/# umount /mnt/cf/proc/'' | ''debian:/# umount /mnt/cf/proc/'' |
| |
''debian:/# umount /mnt/cf/sys'' | ''debian:/# umount /mnt/cf/sys'' |
| |
''debian:/# umount /mnt/cf/dev'' | ''debian:/# umount /mnt/cf/dev'' |
| |
''debian:/# umount /mnt/cf'' | ''debian:/# umount /mnt/cf'' |
| |
/dev/sdb1 3.7G 547M 3.0G 16% /mnt/cf | /dev/sdb1 3.7G 547M 3.0G 16% /mnt/cf |
| |
| |
| 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: ===== | ===== 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 |