0

I have SD Card with Raspbian Jessie. I want to have there completely new Raspbian Stretch. I booted LiveCD and did

dd bs=4M if=2017-11-29-raspbian-stretch.img of=/dev/sdc conv=fsync

However, after I launched my Raspberry Pi with the rewritten SD card, there's still Jessie with all my files in /home/pi directory.

What happened, why didn't it work?

EDIT: I tried again with suggestions from the 2 answers:

root@kali:/tmp# ls -l /dev/sdc
brw-rw---- 1 root disk 8, 32 Feb  8 18:05 /dev/sdc
root@kali:/tmp# fdisk -l /dev/sdc
Disk /dev/sdc: 29.6 GiB, 31724666880 bytes, 61962240 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: 0xea0e7380

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdc1         8192   131071   122880   60M  c W95 FAT32 (LBA)
/dev/sdc2       131072 61962239 61831168 29.5G 83 Linux
root@kali:/tmp# dd bs=4M if=2017-11-29-raspbian-stretch-lite.img of=/dev/sdc conv=fsync
443+0 records in
443+0 records out
1858076672 bytes (1.9 GB, 1.7 GiB) copied, 1017.9 s, 1.8 MB/s
root@kali:/tmp# fdisk -l /dev/sdc
Disk /dev/sdc: 29.6 GiB, 31724666880 bytes, 61962240 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: 0xea0e7380

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdc1         8192   131071   122880   60M  c W95 FAT32 (LBA)
/dev/sdc2       131072 61962239 61831168 29.5G 83 Linux
root@kali:/tmp# mount /dev/sdc2 /foo
root@kali:/tmp# cat /foo/etc/debian_version
8.0
root@kali:/tmp# touch /foo/home/pi/bar
root@kali:/tmp# ls -l /foo/home/pi/bar
-rw-r--r-- 1 root root 0 Feb  8 18:39 /foo/home/pi/bar
4
  • Try write it with /dev/zero, then write the image again. – Kong Chun Ho Feb 9 '18 at 5:53
  • Didn't help :). I also tried with Etcher run on Linux, but it also didn't help even tough it said that flashing had been successful. I guess the card is broken in a weird way. – Radek Wyroslak May 15 '18 at 18:33
  • My next guess is a defective SD card or SD card controller. Did you try using another card reader? – Kong Chun Ho May 15 '18 at 18:40
  • Yes, I changed the reader. – Radek Wyroslak May 15 '18 at 19:11
1

My guess is, when you first issued this command, there was no device node /dev/sdc, so dd just copied the image file within your filesystem.

# ls -l /dev/sdc -rw------- 1 pi users 1050542343 6. Feb 09:27 /dev/sdc

That's a copy of your image. It must read

brw-rw---- 1 root disk 8, 32 6. Feb 09:27 /dev/sdc

instead. That's a block special —a type of device node—, you can see it from the b in the first column.

UDEV won't create a block special at that place as long a regular file sits there. You have to remove the regular file by hand, if there was one.

1
  • It's not the case here, please see my updated question. – Radek Wyroslak Feb 8 '18 at 18:43
0

My guess is you accidently switched your SD card to lock mode. Unlock it.

1
  • I'm not sure how I could have locked it. It's a MicroSD card put directly into the reader. Please also see my updated question - I was able to touch a file after I mounted / partition, and then the file was shown by ls. – Radek Wyroslak Feb 8 '18 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.