I have a backup of my Raspbian on a .img file. The problem is that even though the file is less than 8GB when I try to flash it on a 16GB microSD card, I get an error that there is not enough space.
This is what I get when I run
sudo fdisk -l on my .img file:
Disk Rasp4.img: 14,9 GiB, 15987638272 bytes, 31225856 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: 0xa8c7ffa4 Device Boot Start End Sectors Size Id Type Rasp4.img1 8192 93814 85623 41,8M c W95 FAT32 (LBA) Rasp4.img2 94208 15564799 15470592 7,4G 83 Linux
When I open the .img file in
Disks, I see that there is 8GB of free space. Why is this free space being included in the .img file (and yet is not being shown by
fdisk -l as a partition that can be trimmed) and how can I remove it?