J’ai téléchargé https://downloads.raspberrypi.org/raspbian_lite_latest
dans mon répertoire ~/Téléchargements
ensuite, j’ai créé un périphérique loop
michel@debg53sw:~$ udisksctl loop-setup -r -f ~/Telechargements/2016-05-27-raspbian-jessie-lite.img
Mapped file /home/michel/Telechargements/2016-05-27-raspbian-jessie-lite.img as /dev/loop0.
michel@debg53sw:~$
J’ai listé les partitions présentes :
michel@debg53sw:~$ su -c 'fdisk -l /dev/loop0'
Mot de passe :
Disque /dev/loop0 : 1,3 GiB, 1387266048 octets, 2709504 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : dos
Identifiant de disque : 0x6fcf21f3
Device Boot Start End Sectors Size Id Type
/dev/loop0p1 8192 137215 129024 63M c W95 FAT32 (LBA)
/dev/loop0p2 137216 2709503 2572288 1,2G 83 Linux
michel@debg53sw:~$
Et j’ai mounté les systèmes de fichiers des partitions
michel@debg53sw:~$ udisksctl mount -b /dev/loop0p1
Mounted /dev/loop0p1 at /media/michel/boot.
michel@debg53sw:~$ udisksctl mount -b /dev/loop0p2
Mounted /dev/loop0p2 at /media/michel/202638e1-4ce4-45df-9a00-ad725c2537bb.
michel@debg53sw:~$
Puis j’ai visualisé le contenu des systèmes de fichiers
michel@debg53sw:~$ ls -l /media/michel/boot
total 20312
-rw-r--r-- 1 michel michel 13065 mai 27 12:20 bcm2708-rpi-b.dtb
-rw-r--r-- 1 michel michel 13328 mai 27 12:20 bcm2708-rpi-b-plus.dtb
-rw-r--r-- 1 michel michel 13101 mai 27 12:20 bcm2708-rpi-cm.dtb
-rw-r--r-- 1 michel michel 14411 mai 27 12:20 bcm2709-rpi-2-b.dtb
-rw-r--r-- 1 michel michel 15081 mai 27 12:20 bcm2710-rpi-3-b.dtb
-rw-r--r-- 1 michel michel 17932 mai 27 12:20 bootcode.bin
-rw-r--r-- 1 michel michel 184 mai 27 14:15 cmdline.txt
-rw-r--r-- 1 michel michel 1635 mai 27 14:09 config.txt
-rw-r--r-- 1 michel michel 18693 août 21 2015 COPYING.linux
-rw-r--r-- 1 michel michel 2509 mai 27 12:20 fixup_cd.dat
-rw-r--r-- 1 michel michel 6480 mai 27 12:20 fixup.dat
-rw-r--r-- 1 michel michel 9713 mai 27 12:20 fixup_db.dat
-rw-r--r-- 1 michel michel 9713 mai 27 12:20 fixup_x.dat
-rw-r--r-- 1 michel michel 145 mai 27 14:41 issue.txt
-rw-r--r-- 1 michel michel 4224096 mai 27 12:20 kernel7.img
-rw-r--r-- 1 michel michel 4122560 mai 27 12:20 kernel.img
-rw-r--r-- 1 michel michel 1494 nov. 18 2015 LICENCE.broadcom
-rw-r--r-- 1 michel michel 18974 mai 27 14:41 LICENSE.oracle
drwx------ 2 michel michel 8192 mai 27 14:08 overlays
-rw-r--r-- 1 michel michel 615896 mai 27 12:20 start_cd.elf
-rw-r--r-- 1 michel michel 4934920 mai 27 12:20 start_db.elf
-rw-r--r-- 1 michel michel 2743224 mai 27 12:20 start.elf
-rw-r--r-- 1 michel michel 3887400 mai 27 12:20 start_x.elf
michel@debg53sw:~$ ls -l /media/michel/202638e1-4ce4-45df-9a00-ad725c2537bb
total 88
drwxr-xr-x 2 root root 4096 mai 27 13:11 bin
drwxr-xr-x 2 root root 4096 mai 27 13:40 boot
drwxr-xr-x 4 root root 4096 mai 27 13:06 dev
drwxr-xr-x 82 root root 4096 mai 27 13:41 etc
drwxr-xr-x 3 root root 4096 mai 27 13:09 home
drwxr-xr-x 17 root root 4096 mai 27 13:15 lib
drwx------ 2 root root 16384 mai 27 13:40 lost+found
drwxr-xr-x 2 root root 4096 mai 27 13:04 media
drwxr-xr-x 2 root root 4096 mai 27 13:04 mnt
drwxr-xr-x 3 root root 4096 mai 27 13:09 opt
drwxr-xr-x 2 root root 4096 janv. 7 2015 proc
drwx------ 2 root root 4096 mai 27 13:04 root
drwxr-xr-x 5 root root 4096 mai 27 13:09 run
drwxr-xr-x 2 root root 4096 mai 27 13:15 sbin
drwxr-xr-x 2 root root 4096 mai 27 13:04 srv
drwxr-xr-x 2 root root 4096 avril 12 2015 sys
drwxrwxrwt 2 root root 4096 mai 27 13:41 tmp
drwxr-xr-x 10 root root 4096 mai 27 13:04 usr
drwxr-xr-x 11 root root 4096 mai 27 13:04 var
michel@debg53sw:~$
Puis j’ai démounté les systèmes de fichiers
michel@debg53sw:~$ udisksctl unmount -b /dev/loop0p1
Unmounted /dev/loop0p1.
michel@debg53sw:~$ udisksctl unmount -b /dev/loop0p2
Unmounted /dev/loop0p2.
michel@debg53sw:~$
et j’ai supprimé le fichier de périphérique loop0
michel@debg53sw:~$ udisksctl loop-delete -b /dev/loop0
michel@debg53sw:~$
S’il m’avait fallu utiliser la carte SD, la même méthode est utilisable, mais il n’aurait pas été nécessaire de créer le fichier de périphérique loop.
Avant de connecter la carte SD à la machine, je lance la commande :
udisksctl monitor
Et après avoir connecté la carte SD je vois que le fichier de périphérique block associé à ma carte SD est :
/dev/mmcblk0
et que ses deux systèmes de fichiers sont accessibles par :
/dev/mmcblk0p1
et
/dev/mmcblk0p2