The Computer employs Troubleshooters, whose job is to go out, find trouble, and shoot it. — Paranoia
While re-imaging the MicroSD cards for my cluster, I ran into a few issues — nothing insurmountable, but I figured that I would share them to help others…..
MicroSD cards generally come with an adapter to allow them to be used in SD card slots. If there is a problem with the adapter, it can manifest in a few ways and cascade from there.
SD cards come with a switch which makes them read-only. However, if the switch is faulty, any MicroSD cards put in the adapter will not be writable.
In this case, the slider was faulty and slid to the locked position when I put the card into the computer.
1 2 3 4 5 6 |
dd: failed to open ‘/dev/mmcblk0’: Read-only file system 64kB 0:00:00 [ 1.8MB/s] [> ] 0% Flushing Buffers Mounting Disk Mounting /dev/mmcblk0p1 to customize mount: block device /dev/mmcblk0p1 is write-protected, mounting read-only |
The next SD card adapter, while the write-only slider works, had other problems:
1 2 3 4 5 6 7 8 9 |
Flashing hypriot-rpi-20150727-151455.img to /dev/mmcblk0 ... 1.3GB 0:00:02 [ 474MB/s] [============================================================>] 100% 0+10802 records in 0+10802 records out 1400000000 bytes (1.4 GB) copied, 2.81349 s, 498 MB/s Flushing Buffers Mounting Disk Mounting /dev/mmcblk0p1 to customize mount: special device /dev/mmcblk0p1 does not exist |
The adapter was bad in this case; consequently the device didn’t mount. This caused yet another issue. When the image was written to /dev/mmcblk0
, it overwrote the mount point for the device.
1 2 |
-rw-r--r-- 1 root root 1400000000 Sep 5 14:08 mmcblk0 brw-rw---- 1 root disk 179, 1 Sep 5 14:08 mmcblk0p1 |
Notice that mmcblk0
has -
, which denotes it is a regular file. mmcblk0p1
is a block device as denoted by the b
— these are disks and the like.
In order for the device to mount so that the card can be imaged, the file needs to be removed. After this, the automounter will work correctly and create the device when the card is inserted (with a good adapter, of course).
3 comments
stefanscherer
September 8, 2015 at 2:00 pm (UTC -5) Link to this comment
Thanks for the post! Got the same issue on my Mac today.
Matt Williams
September 8, 2015 at 2:04 pm (UTC -5) Link to this comment
Glad it was of use! It’s a pity the adapters are so flakey.
stefanscherer10
January 31, 2016 at 5:33 am (UTC -5) Link to this comment
A pull request to fix this in
flash
script is on its way https://github.com/hypriot/flash/pull/26