1

If I run the following command on Ubuntu 14.10:

sudo dd if=/dev/zero of=/dev/sdb bs=1M count=100

It effectively erases my SD card.

If I run the exact same command on Ubuntu 16.10 (or 16.04), nothing happens. I've tried it on two different Ubuntu 16 machines. Literally nothing happens. I see the same dd output, but when I unplug and plug the SD card back in all the folders are still there, the partition is still there, everything.

Does anyone have insights as to how this could happen?

Edit:

As per request:

user@cobalt:~/Desktop$ sudo parted /dev/sdb print
Model: Generic- SD Card (scsi)
Disk /dev/sdb: 7948MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  7948MB  7947MB  primary  ext4
muru
  • 197,895
  • 55
  • 485
  • 740
Gillespie
  • 133
  • 5
    First of all, both 14.10 and 16.10 are no longer supported. You should switch to supported releases like 14.04 LTS, 16.04 LTS or 17.04. Second, have you verified that /dev/sdb really corresponds to your SD card in the second case? Otherwise you might have accidentally overwritten your secondary hard disk or something like that. – Byte Commander Aug 09 '17 at 23:03
  • 2
    To backup @ByteCommander second point, you should always run lsblk or something similar to ensure your SD Card is mounted at the location you expect. – WinEunuuchs2Unix Aug 10 '17 at 01:10
  • @ByteCommander I'll check whether it happens in 16.04 or not, but it definitely works in 14. Yes, I have verified that /dev/sdb really corresponds to my SD card. Here, I'll prove it: http://imgur.com/a/95YP1 – Gillespie Aug 10 '17 at 15:13
  • Could the first 100 MB of your SD card actually be unused from the start? What does sudo parted /dev/sdb print say? – Byte Commander Aug 10 '17 at 15:18
  • @ByteCommander see edit above – Gillespie Aug 10 '17 at 15:21
  • @ByteCommander I'm wondering if Ubuntu 16 is respecting some sort of write protections that Ubuntu 14 ignores... still investigating this avenue – Gillespie Aug 10 '17 at 15:25
  • 1
    @ByteCommander I've confirmed this issue is also present in 16.04 – Gillespie Aug 10 '17 at 15:31
  • Voted to reopen the question. You should also add the dd output from the 16.04 machine as well. Also, can you run dmesg about 30 seconds after plugging the card in? Amongst its last lines of output, there should be some regarding the SD card. Please add those to your question too. Btw. is it always the same SD card and the same computer on which you try this operation? Does the SD card have a write protection switch? – Byte Commander Aug 10 '17 at 15:46
  • 2
    @ByteCommander I figured it out. The card reader I am using has an internal plastic notch that flips a write protection switch on the side of the SD card when I insert it and unswitches write protection when I remove the card. Ubuntu 14 seems to completely ignore that switch on the side of the SD card, while Ubuntu 16 respects it. I filed off the notch so the reader doesn't flip it anymore and it seems to be working now. – Gillespie Aug 10 '17 at 15:54
  • See https://askubuntu.com/questions/213889/microsd-card-is-set-to-read-only-state-how-can-i-write-data-on-it – Gillespie Aug 10 '17 at 15:56

0 Answers0