-
Insert the Pi's SD card to host
-
Find the device of the SD card with
sudo fdisk -l
For MacOS you can use the command
diskutil list
For a pc with one physical disk, the output will be look like this
da@agile images$ sudo fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xd1654e20
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1936928767 1936926720 923.6G 83 Linux
/dev/sda2 1936930814 1953523711 16592898 7.9G 5 Extended
/dev/sda5 1936930816 1953523711 16592896 7.9G 82 Linux swap / Solaris
Partition 2 does not start on physical sector boundary.
Disk /dev/sdb: 14.9 GiB, 15931539456 bytes, 31116288 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: 0xfea8d6fe
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 93596 85405 41.7M c W95 FAT32 (LBA)
/dev/sdb2 94208 31116287 31022080 14.8G 83 Linux
To track the device of the sd card check the disk size. If your sd card is 16 GB (like mine) then the /dev/sdb is the device we looking for.
- Copy the image to the host with dd program. Be careful! If there is already an image named as of argument (raspimage.img in our case) this commands will overide this image.
sudo dd bs=4M if="/dev/sdb" of="raspimage.img" status=progress conv=fsync
- Now your have the raspberry image to your host. You will notice that the size of the image is too large. Your can reduced it with a programm like PiShrink
git clone https://github.com/Drewsif/PiShrink
cd PiShrink
./pishrink raspimage.img