FWIW, this is running on an Arch Linux ARM installation booting off a SATA, where I plugged in the SD card from the RPi. The original 16GB card was imaged from Windows using a Debian image. I had used an SD card that I happened to have on hand, but I don't want to keep that specific SD card in the RPi anymore:
Disk /dev/mmcblk0: 16.1 GB, 16134438912 bytes
4 heads, 32 sectors/track, 246192 cylinders, total 31512576 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
Disk identifier: 0x000ee283
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 155647 76800 c W95 FAT32 (LBA)
/dev/mmcblk0p2 157696 3414015 1628160 83 Linux
/dev/mmcblk0p3 3416064 3807231 195584 82 Linux swap / Solaris
So then I took a disk image
$ dd if=/dev/mmcblk0 of=/backup/rpiboot.bin bs=1M
15387+0 records in
15387+0 records out
16134438912 bytes (16 GB) copied, 1745.67 s, 9.2 MB/s
I swapped in the 8GB SD card, here's the fdisk of a stock 8GB SD card before dd
:
Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
81 heads, 10 sectors/track, 19165 cylinders, total 15523840 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
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 15523839 7757824 b W95 FAT32
I wrote the image to the 8GB drive (note the "no space left on device" message)
$ dd of=/dev/mmcblk0 if=/backup/rpiboot.bin bs=1M
dd: writing ‘/dev/mmcblk0’: No space left on device
7581+0 records in
7580+0 records out
7948206080 bytes (7.9 GB) copied, 1802.52 s, 4.4 MB/s
fdisk
after dd
:
Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 32 sectors/track, 121280 cylinders, total 15523840 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
Disk identifier: 0x000ee283
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 155647 76800 c W95 FAT32 (LBA)
/dev/mmcblk0p2 157696 3414015 1628160 83 Linux
/dev/mmcblk0p3 3416064 3807231 195584 82 Linux swap / Solaris
The partitions are all the same.
The RPi boots and everything seems fine.
So I surmise that because the stock image is just a 2GB image, and I never resized it to use up the full 16GB, it was able to copy it and then write the first 8GB to the new drive.
So am I likely to see any problems with this new SD card due to the way I cloned it? Is there a better way to handle this?