I) Installation de l'image ArchLinux sur une carte SD. 1) A partir d'un ordinateur disposant d'un lecteur de carte mémoire, insérer la carte mémoire dans le lecteur de carte memoire. /!\ Ne pas monter la carte mémoire /!\ 2) Répertoire de travail :
[~] ➔ mkdir -p RASPBERRYPI/ARCHLINUX
[~] ➔ cd RASPBERRYPI/ARCHLINUX/
[~/RASPBERRYPI/ARCHLINUX] ➔
3) Télécharger l'image de ArchLinux : http://www.raspberrypi.org/downloads/ 4) Vérification :
[~/RASPBERRYPI/ARCHLINUX] ➔ ls -l
total 215496
-rw-r--r-- 1 util01 util01 220443197 2014-06-02 20:55 ArchLinuxARM-2014.05-rpi.img.zip
5) Décompression de l'archive :
[~/RASPBERRYPI/ARCHLINUX] ➔ unzip ArchLinuxARM-2014.05-rpi.img.zip
[~/RASPBERRYPI/ARCHLINUX] ➔ ls -l *.img
-rw-r--r-- 1 util01 util01 1960837120 2014-05-02 00:28 ArchLinuxARM-2014.05-rpi.img
6) Copie de l'image sur la carte mémoire : Dans mon cas, la copie s'est faite à partir d'un ordinateur portable donc le device est : /dev/mmcblk0
[~/RASPBERRYPI/ARCHLINUX] ➔ sudo dd bs=4M if=ArchLinuxARM-2014.05-rpi.img of=/dev/mmcblk0
467+1 enregistrements lus
467+1 enregistrements écrits
1960837120 octets (2,0 GB) copiés, 288,646 s, 6,8 MB/s
7) Retirer la carte du lecteur SD. II) Configuration de ArchLinux : 1) Insérer la carte SD ArchLinux dans le Raspberry Pi 2) Allumer le Raspberry Pi. 3) La connexion en mode console : Utilisateur : root Mot de passe : root 4) Passer le clavier en mode français :
[root@alarmpi ~]# loadkeys fr
5) Configuration de la langue et du clavier : Ouvrir :
/etc/locale.gen
Chercher :
#fr_FR.UTF-8 UTF-8
#fr_FR ISO-8859-1
#fr_FR@euro ISO-8859-15
Remplacer par :
fr_FR.UTF-8 UTF-8
fr_FR ISO-8859-1
fr_FR@euro ISO-8859-15
Ouvrir :
/etc/locale.conf
Ajouter :
LANG=fr_FR.UTF-8
LC_COLLATE=C
6) Changer le mot de passe root :
[root@alarmpi ~]# passwd
Enter new UNIX password: <mot2passe>
Retype new UNIX password: <mot2passe>
passwd: password updated successfully
7) Mise-à-jour du système :
[root@alarmpi ~]# pacman -Syu
8) Installation de logiciel :
[root@alarmpi ~]# pacman -S screen links htop
9) Lien : http://www.f.0x2501.org/p/013/ http://www.azurs.net/carnet/2013/03/arch-linux-sur-raspberry-pi-installation/ III) Redimensionnement de la partition / : Ces opérations ont été effectué sur une carte mémoire SD avec un espace de stockage de 16 go et de classe 10. 1) Lancement de fdisk :
[root@alarmpi ~]# fdisk -c -u /dev/mmcblk0
Welcome to fdisk (util-linux 2.24.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help):
2) Afficher les partitions :
Command (m for help): p
Disk /dev/mmcblk0: 14.7 GiB, 15720251392 bytes, 30703616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x417ee54b
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA)
/dev/mmcblk0p2 186368 3667967 1740800 5 Extended
/dev/mmcblk0p5 188416 3667967 1739776 83 Linux
3) Suppression de la partition logique :
Command (m for help): d
Partition number (1,2,5, default 5): 5
Partition 5 has been deleted.
4) Suppression de la partition étendu :
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
5) Création d'une partition étendu:
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): e
Partition number (2-4, default 2): 2
First sector (186368-30703615, default 186368):
Last sector, +sectors or +size{K,M,G,T,P} (186368-30703615, default 30703615):
Created a new partition 2 of type 'Extended' and of size 14.6 GiB.
6) Création d'une partition logique :
Command (m for help): n
Partition type:
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (188416-30703615, default 188416):
Last sector, +sectors or +size{K,M,G,T,P} (188416-30703615, default 30703615):
Created a new partition 5 of type 'Linux' and of size 14.6 GiB.
7) Vérification :
Command (m for help): p
Disk /dev/mmcblk0: 14.7 GiB, 15720251392 bytes, 30703616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x417ee54b
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA)
/dev/mmcblk0p2 186368 30703615 15258624 5 Extended
/dev/mmcblk0p5 188416 30703615 15257600 83 Linux
8) Ecriture des partitions créés :
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
9) Redémarrage :
[root@alarmpi ~]# shutdown -r now
10) Redimensionner le système de fichier :
[root@alarmpi ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.7G 472M 1.1G 31% /
devtmpfs 89M 0 89M 0% /dev
tmpfs 93M 0 93M 0% /dev/shm
tmpfs 93M 388K 93M 1% /run
tmpfs 93M 0 93M 0% /sys/fs/cgroup
tmpfs 93M 0 93M 0% /tmp
/dev/mmcblk0p1 90M 25M 66M 28% /boot
tmpfs 19M 0 19M 0% /run/user/0
[root@alarmpi ~]# resize2fs /dev/mmcblk0p5
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mmcblk0p5 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p5 is now 3814400 blocks long.
[root@alarmpi ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 474M 14G 4% /
devtmpfs 89M 0 89M 0% /dev
tmpfs 93M 0 93M 0% /dev/shm
tmpfs 93M 388K 93M 1% /run
tmpfs 93M 0 93M 0% /sys/fs/cgroup
tmpfs 93M 0 93M 0% /tmp
/dev/mmcblk0p1 90M 25M 66M 28% /boot
tmpfs 19M 0 19M 0% /run/user/0
11) Lien : http://gleenders.blogspot.fr/2014/03/raspberry-pi-resizing-sd-card-root.html IV) Configuration du système : 1) Changer le nom du Rapsberri Pi :
[root@alarmpi ~]# hostnamectl set-hostname framboisepi
2) Création de l'utilisateur : util01
[root@alarmpi ~]# useradd -m -g users -G wheel,storage,power -s /bin/bash util01
[root@alarmpi ~]# passwd util01
Enter new UNIX password: <mot2passe>
Retype new UNIX password: <mot2passe>
passwd: password updated successfully
Après redémarrage et la connexion avec le compte util01 :
[util01@framboisepi ~]$
3) Configuration de l'utilisateur normal pour l'administration :
[root@alarmpi ~]# pacman -S sudo
Ouvrir :
/etc/sudoers
Ajouter :
util01 ALL=(ALL) ALL
util01 ALL = NOPASSWD: /sbin/shutdown
4) Synchronisation de l'horloge local via le réseau.
[root@framboisepi ~]# pacman -S ntp
/etc/ntp.conf
Chercher :
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
Remplacer par :
server 0.fr.pool.ntp.org iburst
server 1.fr.pool.ntp.org iburst
server 2.fr.pool.ntp.org iburst
server 3.fr.pool.ntp.org iburst
[root@framboisepi ~]# systemctl start ntpd.service
[root@framboisepi ~]# systemctl enable ntpd.service
ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
[root@framboisepi ~]# timedatectl set-timezone Europe/Paris