You are not logged in.

#21 2017-01-12 21:56:16

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

I've been trying to use testdisk to repair the boot sector with no luck.

Offline

#22 2017-01-14 14:07:06

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

Here the testdisk log:

Partition table type (auto): None
Disk /dev/sdb - 31 GB / 29 GiB - Mass Storage Device
Partition table type: Intel

Analyse Disk /dev/sdb - 31 GB / 29 GiB - CHS 29983 64 32
Geometry from i386 MBR: head=256 sector=63
BAD_RS LBA=2048 2103326
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT32 at 1/0/1
Info: size boot_sector 61403136, partition 61403136
FAT1 : 32-59879
FAT2 : 59880-119727
start_rootdir : 119728 root cluster : 2
Data : 119728-61403135
sectors : 61403136
cluster_size : 8
no_of_cluster : 7660426 (2 - 7660427)
fat_length 59848 calculated 59848
heads/cylinder 4 (FAT) != 64 (HD)
sect/track 16 (FAT) != 32 (HD)
set_FAT_info: name from BS used
get_geometry_from_list_part_aux head=64 nbr=2
get_geometry_from_list_part_aux head=8 nbr=2
get_geometry_from_list_part_aux head=16 nbr=2
get_geometry_from_list_part_aux head=32 nbr=2
get_geometry_from_list_part_aux head=64 nbr=2
Current partition structure:
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Warning: number of heads/cylinder mismatches 4 (FAT) != 64 (HD)
Warning: number of sectors per track mismatches 16 (FAT) != 32 (HD)
 1 * FAT32 LBA                1   0  1 29982  63 32   61403136 [NO NAME]

Warning: Bad starting sector (CHS and LBA don't match)

search_part()
Disk /dev/sdb - 31 GB / 29 GiB - CHS 29983 64 32
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT32 at 1/0/1
FAT1 : 32-59879
FAT2 : 59880-119727
start_rootdir : 119728 root cluster : 2
Data : 119728-61403135
sectors : 61403136
cluster_size : 8
no_of_cluster : 7660426 (2 - 7660427)
fat_length 59848 calculated 59848
heads/cylinder 4 (FAT) != 64 (HD)
sect/track 16 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
     FAT32 LBA                1   0  1 29982  63 32   61403136 [NO NAME]
     FAT32, blocksize=4096, 31 GB / 29 GiB
get_geometry_from_list_part_aux head=64 nbr=2
get_geometry_from_list_part_aux head=8 nbr=2
get_geometry_from_list_part_aux head=16 nbr=2
get_geometry_from_list_part_aux head=32 nbr=2
get_geometry_from_list_part_aux head=64 nbr=2

Results
   * FAT32 LBA                1   0  1 29982  63 32   61403136 [NO NAME]
     FAT32, blocksize=4096, 31 GB / 29 GiB

interface_write()
 1 * FAT32 LBA                1   0  1 29982  63 32   61403136 [NO NAME]
simulate write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition

TestDisk exited normally.

Offline

#23 2017-01-15 08:23:05

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: I can't format a SD anymore, not even with dd.

i never used testdisk.
is it a tool to test hardware for errors? i see various warnings but no errors - i'm sure you could have told that yourself, sorry.

in a similar case i once got lucky with dd:

sudo dd if=/dev/null of=/dev/sdX

let this run for a minute, then cancel out of it.
if you're lucky, you now have a completely blank drive that can be reformatted (please use gparted for that).
if not, my bet is on physical damage.

Offline

#24 2017-01-15 08:42:22

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: I can't format a SD anymore, not even with dd.

@overkill22: I have had once similar situation (if not exactly the same), SD card on RaspberryPi got unreadable, and testdisk gave messages similar as yours.

At the end, I couldn't get my data back, but I was able to reformat SD card after I zeroed MBR (or GPT?) with:

$ sudo dd if=/dev/zero of=/dev/sdX bs=1M; sync

(/dev/sdX = your SD card, something like /dev/sdb or /dev/sdc, or similar; The point is there is no number in name.)
It will write 1M of zeros to the beginning of the SD card (although, probably 512 bytes would be enough), removing any information of formatting which seems to confuse disk format software (especially on MS windows).

Now, remove card and insert it again, there are chances you will be able to format it again.

Note1: I, too, think that this card is near its end of life, therefore I wouldn't use it for important data.

Note2: WARNING: please be careful with 'dd' command, as it can erase your hard disk, if you are not careful. Please, triple check what you put as a '/dev/sdX' ... if it is '/dev/sda' then it is probably wrong!

EDIT: Ah, ninja'd by ohnonot, but for the record, I belive the first argument is '/dev/zero', not '/dev/null'  wink

Last edited by iMBeCil (2017-01-15 08:44:11)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#25 2017-01-15 11:46:41

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

ohnonot wrote:

i never used testdisk.
is it a tool to test hardware for errors? i see various warnings but no errors - i'm sure you could have told that yourself, sorry.

in a similar case i once got lucky with dd:

sudo dd if=/dev/null of=/dev/sdX

let this run for a minute, then cancel out of it.
if you're lucky, you now have a completely blank drive that can be reformatted (please use gparted for that).
if not, my bet is on physical damage.

I did it already, with no luck. Is it /dev/null or /dev/zero as @iMBeCil noted?

iMBeCil wrote:

@overkill22: I have had once similar situation (if not exactly the same), SD card on RaspberryPi got unreadable, and testdisk gave messages similar as yours.

At the end, I couldn't get my data back, but I was able to reformat SD card after I zeroed MBR (or GPT?) with:

$ sudo dd if=/dev/zero of=/dev/sdX bs=1M; sync

(/dev/sdX = your SD card, something like /dev/sdb or /dev/sdc, or similar; The point is there is no number in name.)
It will write 1M of zeros to the beginning of the SD card (although, probably 512 bytes would be enough), removing any information of formatting which seems to confuse disk format software (especially on MS windows).

Now, remove card and insert it again, there are chances you will be able to format it again.

Note1: I, too, think that this card is near its end of life, therefore I wouldn't use it for important data.

Note2: WARNING: please be careful with 'dd' command, as it can erase your hard disk, if you are not careful. Please, triple check what you put as a '/dev/sdX' ... if it is '/dev/sda' then it is probably wrong!

EDIT: Ah, ninja'd by ohnonot, but for the record, I belive the first argument is '/dev/zero', not '/dev/null'  wink


I did the command you suggest (but not with sync) and nothing happened.
The thing is I DON'T WANT TO RECOVER DATA. It sounds ridiculous but at this time I'm not able to DELETE the data on the card!!! All the pictures I took with the phone are stored there and after all the formatting, erasing and commands I tried, they're still there!
I can't believe it is damaged, the only thing that went wrong is that I unplugged the device before ejecting or dismount it (because the process hanged).

So, I really can't understand why I'm not able to format this damn micro SD.

Offline

#26 2017-01-15 11:55:47

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

ohnonot wrote:

i never used testdisk.
is it a tool to test hardware for errors? i see various warnings but no errors - i'm sure you could have told that yourself, sorry.

in a similar case i once got lucky with dd:

sudo dd if=/dev/null of=/dev/sdX

let this run for a minute, then cancel out of it.
if you're lucky, you now have a completely blank drive that can be reformatted (please use gparted for that).
if not, my bet is on physical damage.

it gives me immediately this:

$sudo dd if=/dev/null of=/dev/sdb
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0,000437213 s, 0,0 kB/s

Offline

#27 2017-01-15 12:45:04

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

keep on having these errors with the command sudo dd if=/dev/zero of=/dev/sdb bs=512 count=1

[ 8027.382082] sd 4:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 8027.382095] sd 4:0:0:0: [sdb] Sense Key : Medium Error [current] 
[ 8027.382102] sd 4:0:0:0: [sdb] Add. Sense: Peripheral device write fault
[ 8027.382111] sd 4:0:0:0: [sdb] CDB: Write(10) 2a 00 00 00 81 60 00 00 f0 00
[ 8027.382118] blk_update_request: I/O error, dev sdb, sector 33120
[ 8027.382128] buffer_io_error: 20 callbacks suppressed
[ 8027.382133] Buffer I/O error on dev sdb, logical block 4140, lost async page write
[ 8027.382149] Buffer I/O error on dev sdb, logical block 4141, lost async page write
[ 8027.382156] Buffer I/O error on dev sdb, logical block 4142, lost async page write
[ 8027.382163] Buffer I/O error on dev sdb, logical block 4143, lost async page write
[ 8027.382170] Buffer I/O error on dev sdb, logical block 4144, lost async page write
[ 8027.382177] Buffer I/O error on dev sdb, logical block 4145, lost async page write
[ 8027.382184] Buffer I/O error on dev sdb, logical block 4146, lost async page write
[ 8027.382191] Buffer I/O error on dev sdb, logical block 4147, lost async page write
[ 8027.382198] Buffer I/O error on dev sdb, logical block 4148, lost async page write
[ 8027.382207] Buffer I/O error on dev sdb, logical block 4149, lost async page write

Offline

#28 2017-01-15 16:03:50

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: I can't format a SD anymore, not even with dd.

^I think your SD card is dead. It happens sometimes, not your fault. Get a new one ...

A few notes for other interested parties:
As for the '/dev/null' vs. '/dev/zero': first one is 'null' i.e. empty, with nothing inside, as your 'dd' attempt nicely showed. Therefore, in this case '/dev/zero', which is full of shi ]:D I mean zeros and acts as an infinite source of zeros, is the way to go.

As for the 'sync' ... it flushes ('forces actual writes to device') those zeros to be physically written to SD card. Instead of waiting in RAM (cache). This is what 'remove device' or 'eject device' does in GUI file managers ... like Thunar.

Last edited by iMBeCil (2017-01-15 16:04:01)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#29 2017-01-15 16:34:14

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: I can't format a SD anymore, not even with dd.

OH!  NICE POST iMBeCil!

I didn't know that about /dev/null & /dev/zero.

S11's head = /dev/null --»» Space, the final frontier!
S11's memory = /dev/zero --»» the same thing over and over an...  again and again an...

And now I know why Thunar takes it's time 'ejecting', 'unmounting' at times.
I'll file that in memory slot: 0⁵³⁷

===
Seriously - excellent post.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Online

#30 2017-01-15 16:47:36

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: I can't format a SD anymore, not even with dd.

Sector11 wrote:

S11's head = /dev/null --»» Space, the final frontier!
S11's memory = /dev/zero --»» the same thing over and over an...  again and again an...

Hahaha smile smile ... don't be so harsh on yourself Sector. I'm sure there are nice and useful bits in both your head and memory. Not to mention wiseness which comes with maturity ...

BTW, thanks for the kind words.  wink


Postpone all your duties; if you die, you won't have to do them ..

Offline

#31 2017-01-15 17:17:40

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

iMBeCil wrote:

^I think your SD card is dead. It happens sometimes, not your fault. Get a new one ...

A few notes for other interested parties:
As for the '/dev/null' vs. '/dev/zero': first one is 'null' i.e. empty, with nothing inside, as your 'dd' attempt nicely showed. Therefore, in this case '/dev/zero', which is full of shi ]:D I mean zeros and acts as an infinite source of zeros, is the way to go.

As for the 'sync' ... it flushes ('forces actual writes to device') those zeros to be physically written to SD card. Instead of waiting in RAM (cache). This is what 'remove device' or 'eject device' does in GUI file managers ... like Thunar.

Thank you for the explanation, very useful indeed.

What I can't understand is how this SD get spoiled. Especially how is that possible that I can read everything but can't write. Usually you can't read and write, isn't it?

Offline

#32 2017-01-15 17:36:41

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: I can't format a SD anymore, not even with dd.

iMBeCil wrote:
Sector11 wrote:

S11's head = /dev/null --»» Space, the final frontier!
S11's memory = /dev/zero --»» the same thing over and over an...  again and again an...

Hahaha smile smile ... don't be so harsh on yourself Sector. I'm sure there are nice and useful bits in both your head and memory. Not to mention wiseness which comes with maturity ...

BTW, thanks for the kind words.  wink

Over the years I have learned to laugh at myself and lets fact it If I had said:

Sector11 wrote:

iMBeCil's head = /dev/null --»» Space, the final frontier!
iMBeCil's memory = /dev/zero --»» the same thing over and over an...  again and again an...

using your name as an example only, it might have been Tom, Dick or Harry - someone might have gotten/or felt insulted.  This way the point gets out there and no insults.  big_smile

As for the kind words, you educated me, Thank you.  And I'm sure there are a few useful bits in there ... not sure if there are enough to make a byte though.  lol


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Online

#33 2017-01-15 17:42:56

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: I can't format a SD anymore, not even with dd.

overkill22 wrote:

Usually you can't read and write, isn't it?

Never look a gift horse in the mouth, he'll clamp his teeth shut and you'll loose everything when he swallows.

Also not exactly true.  Read this: Fixing Corrupt SD Memory Cards & Photo Recovery

One of the interesting points:

  • You can see the contents of your SD card in your camera as well as in your system, but unable to copy these contents and get an error message that disk is "write-protected."

Fix #2, 3 & 7 are obviously "Windows" based.  sad


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Online

#34 2017-01-15 20:06:53

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

This SD became undeletable.

Offline

#35 2017-01-15 20:18:33

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: I can't format a SD anymore, not even with dd.

sad  End Game.

Hope there wasn't anything really necessary in it.  sad


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Online

#36 2017-01-15 20:49:44

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

Sector11 wrote:

sad  End Game.

Hope there wasn't anything really necessary in it.  sad

Not sure if I was clear, I can still see EVERYTHING that is inside, and I can make every copy I want of the data in the SD.
What I can't do is DELETE or FORMAT the SD!

Offline

#37 2017-01-15 22:09:31

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: I can't format a SD anymore, not even with dd.

overkill22 wrote:

....
Not sure if I was clear, I can still see EVERYTHING that is inside, and I can make every copy I want of the data in the SD.
What I can't do is DELETE or FORMAT the SD!

How much time do you want to spend on it? Copy any data, and throw the card away - they aren't expensive wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#38 2017-01-16 00:35:48

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: I can't format a SD anymore, not even with dd.

OH in that case I agree with damo, copy it, destroy it - fire, comes to mind - and toss the remains.  RIP.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Online

#39 2017-01-16 12:32:59

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: I can't format a SD anymore, not even with dd.

Thanks Sector.

Sector11 wrote:

Over the years I have learned to laugh at myself and lets fact it If I had said:

Sector11 wrote:

iMBeCil's head = /dev/null --»» Space, the final frontier!
iMBeCil's memory = /dev/zero --»» the same thing over and over an...  again and again an...

using your name as an example only, it might have been Tom, Dick or Harry - someone might have gotten/or felt insulted.  This way the point gets out there and no insults.  big_smile

No need to explain ... I'm too used to make fun of myself (and others). Actually, over the years my beer drinking friends - 9-8 of us - become group of people who are regularly making fun of ourselves. To the point that when something bad happens to any of us, it is normally relieved by telling it to each other and sharing an overall laugh ... and condolence. Something my waifu will never understand. ]:D ]:D

So none (of insult) taken. Or will ever be taken.  wink

For OP: damo is completely right ... you should consider the time lost for lost cause. Buy a new SD card.

Last edited by iMBeCil (2017-01-16 12:33:49)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#40 2017-01-16 13:48:39

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: I can't format a SD anymore, not even with dd.

Yeah, new SD card is already on the way. It was just for winning the battle. SDcard-Humans 1-0

It's always fun destroying things
m1u6GMX.jpg?1

Offline

Board footer

Powered by FluxBB