Tuesday, January 28, 2014

Raspberry Pi Journal #47


SD card capacity


So I was wondering why my dd command always fail with insufficient disk space message. Turns out that there are different sizes with different SD card brands. Here is my size of PNY 16 gig card:


  1. sudo fdisk -l /dev/sda



  • Disk /dev/sda: 16.0 GB, 16012804096 bytes
  • 255 heads, 63 sectors/track, 1946 cylinders, total 31275008 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/sda1            8192    31275007    15633408    c  W95 FAT32 (LBA)



And here is my size of generic store brand 16 Gig card:


  • sudo fdisk -l /dev/sda
  • Warning: ignoring extra data in partition table 5

  • Disk /dev/sda: 16.0 GB, 16009658368 bytes
  • 4 heads, 16 sectors/track, 488576 cylinders, total 31268864 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: 0x00048a81

  •    Device Boot      Start         End      Blocks   Id  System
  • /dev/sda1            2048     2324218     1161085+   e  W95 FAT16 (LBA)
  • /dev/sda2         2326528    31268863    14471168   85  Linux extended
  • /dev/sda5         2334720     2449407       57344    c  W95 FAT32 (LBA)



As you can see, the PNY SD card has holds 16012804096 bytes, compared to 16009658368. So that's the difference of 3145728 bytes. No wonder the dd command always fails. Well, there are two ways about it:


  1. Buy identical PNY SD cards
  2. Migrate the whole thing to a smaller, generic SD card.


Option one is easy, but depends on availability of such card. Option two is, frankly, a pain at this point. I have too many stuff in there already.

Option 3, which is to built another card, and copy the files between them somehow does not work because the keyboard stopped working. No, I don't know why, but that is why it's off the table.

No comments:

Post a Comment