I put OSMC (kod multimedia system for blackberry) system on a SD card using dd commans:
sudo dd bs=4M if=/dev/zero of=/dev/mmcblk0 oflag=sync
sudo dd bs=4M if=OSMC_TGT_rbp2_20200607.img of=/dev/mmcblk0 status=
progress && sync
That worked fine, OS installed itself and was working. While installing HGO EU add on (for HBO GO in EU), it needed to install widevine, so I agreed. The problem was, it was taken from some Chrome OS image, so download file was 1GB. In theory there was a space on SD (32 GB SD card and only ca. 300 MB taken by the system, rest was used for another partiion).
I had no idea where the kodi was downloading this file (OS or another partition), but assume that if run out of space, it will simply error out. Nothing serious. Right? Wrong, deadly wrong…
The system just went blank and didn’t even reboot itsel. I had to manually plug it off and in. I was greeted with some file system serious errors and advice to reinstall OS. So I wanted to do just that…
SD card became not readable. I was able to fix that with command:
sudo dosfsck -l -t /dev/mmcblk0
Then I repeated the first commands above. After starting the blackberry, I was greeted with the same error interface. I tried again and noticed, there were some dd errors:
sudo dd bs=4M if=/dev/zero of=/dev/mmcblk0 oflag=sync
dd: save error '/dev/mmcblk0':Not enough space on the device
974+0 read records
973+0 saved records
copied 4083318784 baits (4,1 GB, 3,8 GiB), 5,32627 s, 767 MB/s
When checked on gparted, the whole SD card shows 3,8 GB of space, although this is a 32 GB card and should show ca. 29 GB.
What is more weird, is that gparted sees this as empty, while lsblk still sees two partitions that were there before. I tried creating new msdos partition tables, to nuke everything on this SD card and… gparted shows success and yet system still sees the partitions that gparted does not. I’m getting headache
dd messed up something and cannot fix it.
Any idea what is happening? Are there any deep disc tools that could help with it?