administratormta@UNILT129:/mnt/c/WINDOWS/system32$ cd /mnt/d/ administratormta@UNILT129:/mnt/d$ sudo ./rpiShrink.sh StationEditorCFD.img [sudo] password for administratormta: ATTENTION! ce script est fait pour redimentionner les images de cartes SD de Raspberry Pi utilisant Raspberry Pi OS. L'utilisation de ce script pour un autre utilisation risque de produire des résultats inattendus. Pour plus de détails et l'explication du script, voir ici: https://www.jesus-forain.fr/blog/reduire-la-taille-d-une-image-de-carte-sd-d-un-raspberry-pi-136.html Le fichier image donné en argument sera modifié, il est conseillé de faire une copie de sauvegarde de ce fichier image Fichier à réduire: StationEditorCFD.img Confirmer (O/N)? O [INFO] Recherche d'un périphérique /dev/loopX libre 8 périphériques /dev/loopX disponibles [INFO] /dev/loop0 est libre [INFO] Montage de l'image [INFO] Rechargement de la table des partitions [INFO] affichage de la structure des partitions NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 14.9G 0 loop ├─loop0p1 259:0 0 256M 0 part └─loop0p2 259:1 0 14.6G 0 part [INFO] Vérification du filesystem e2fsck 1.46.5 (30-Dec-2021) Pass 1: Checking inodes, blocks, and sizes Inode 400440 extent tree (at level 2) could be narrower. Optimize? yes Pass 1E: Optimizing extent trees Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information rootfs: ***** FILE SYSTEM WAS MODIFIED ***** rootfs: 198158/934128 files (0.6% non-contiguous), 1674685/3827776 blocks [INFO] Redimensionnement du filesystem. Cette étape est la plus longue du script et peut durer plusieurs dizaines de minutes selon la taille du fichier image resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /dev/loop0p2 to 1877181 (4k) blocks. Begin pass 2 (max = 126535) Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Begin pass 3 (max = 117) Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/loop0p2 is now 1877181 (4k) blocks long. [INFO] Informations sur les partitions nombre de blocs : 1877181 taille de bloc : 4096 octets taille de secteur : 512 octets début de partition: fin de partition : (1877181 * 4096) / 512 + 1) = 15017449 [INFO] Modification des partitions Welcome to fdisk (util-linux 2.37.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): Disk /dev/loop0: 14.86 GiB, 15951200256 bytes, 31154688 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: 0x8d7828c4 Device Boot Start End Sectors Size Id Type /dev/loop0p1 8192 532479 524288 256M c W95 FAT32 (LBA) /dev/loop0p2 532480 31154687 30622208 14.6G 96 unknown Command (m for help): Partition number (1,2, default 2): Partition 2 has been deleted. Command (m for help): Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): Partition number (2-4, default 2): First sector (2048-31154687, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-8191, default 8191): Value out of range. Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-8191, default 8191): Created a new partition 2 of type 'Linux' and of size 3 MiB. Command (m for help): Disk /dev/loop0: 14.86 GiB, 15951200256 bytes, 31154688 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: 0x8d7828c4 Device Boot Start End Sectors Size Id Type /dev/loop0p1 8192 532479 524288 256M c W95 FAT32 (LBA) /dev/loop0p2 2048 8191 6144 3M 83 Linux Partition table entries are not in disk order. Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Invalid argument The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8). [INFO] Détacher la disque virtuel /dev/loop0 [INFO] Réduction du fichier image à 4194304 octets TERMINÉ