LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   SD card issues (https://www.linuxquestions.org/questions/linux-hardware-18/sd-card-issues-4175622043/)

parsious 01-20-2018 08:37 AM

SD card issues
 
Hi Team,

Iḿ having some issues with an SD card that was in a Pi 2,
its 8Gb in size and I want to reformat it so it can rebuilt with a new test OS fpr some stuff Im working on.

However my normal go to for formatting these cards being a card reader on a windows machine fails to format.

So after plugging the card reader into my pi and confirming that it mounts and writes to the card I have encountered issues with making any alterations to the partition table.

´lslbk´ confirms that the card is found on /dev/sdb with partitions 1,2,3,5 and 6.

I have tried ¨parted¨ which didn't work and then I went onto Fdisk which shows
Code:

=================================================================
Command (m for help): p
Disk /dev/sdb: 7.4 GiB, 7892631552 bytes, 15415296 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: 0x0009c1ec

Device    Boot    Start      End  Sectors  Size Id Type
/dev/sdb1          2048  242187  240140 117.3M  e W95 FAT16 (LBA)
/dev/sdb2        245760 15349759 15104000  7.2G 85 Linux extended
/dev/sdb3      15349760 15415295    65536    32M 83 Linux
/dev/sdb5        253952  376831  122880    60M  c W95 FAT32 (LBA)
/dev/sdb6        385024 15349759 14964736  7.1G 83 Linux

Partition table entries are not in disk order.

Command (m for help):

======================================================

I have gone through and deleted all of these and them made sure I wrote the new data which threw no errors or anything the looked out of the ordinary and the partition table seem not to have changed

lslbk still gives the same info ... starting fdisk again which I would be expecting to have no entries on the table as I didn´t add any back and a table print shows the original table with all 5 partitions

=====================================================

After a scratch of my head I remembered and confirmed that if I were to ´mkfs.ext4 /dev/sdb´ that should just blitz the partition table and rebuild an ext4 filesystem on the card, not really ideal for what i want but in all honesty i can probably deal with that.

So tried that and no dice.

=====================================================

Some more thinking and I had a look at
´dd if=/dev/zero of=/dev/sdb count=512 count=1' which if my memory serves me right should nuke it completely also.

still no dice!

so one last thing that I have tried is to put it in my phone and format it that way ... the phone wouldn't even mount it (not an unheard of issue with SD cards as it seems some android versions want a decent format to start from but hell you never know)..

======================================================

I will freely admit that while Iḿ not new to linux I´m deffinatally not a power user and I haven't really had to do anything too drastic to a machine in a few years

Anyone have any ideas about how I may be able to resurrect this card or is the card so dead even Bones cant save it...

failing that I´m fully prepared to be told I have overlooked some simple thing


Cheers

Emerson 01-20-2018 11:27 AM

I have more than one SD card expired this way. No writes possible, the contents is as it is and cannot be altered.

BW-userx 01-20-2018 11:42 AM

it might be that write protection has been set to it, micro sd or a standard sd card?


on USB stick that with some have write protection on them I issues this command to remove it.
Code:

remove write protect usb stick

hdparm -r0  /dev/sdx

do you got gparted on PI?

on a standard sd card they got a little tab on the side to turn on and off write protection.

I found this
SD Card Write protection
https://github.com/BertoldVdb/sdtool

Brains 01-20-2018 03:24 PM

I ran myself ragged last winter trying to fix a friend's Acer switch 10 with emmc drive/chip. It's exactly like this. I eventually gave up, no help from the Chinese manufacturer. Buddy said he was surfing around and it just suddenly froze and that was it. He is heavy into porn, most of his data is of that nature, I have many of his broken machines and keep telling him to stay away from those places. However, if I remember correctly, I did manage to nuke something with diskpart via a Windows PE, but unable to add partitions.

I wasn't able to find any information like the link you posted BW-userx, no matter how much Googling, but that was a year ago. Do I want to attempt this again, that is the question I am now pondering. Maybe I'll just subscribe to this thread for now. I ran a 30 day trial of Windows 8.1 off a USB stick with Win2USB setup and really liked this little 32bit thing, love the portability.

Myrddin Emrys 01-20-2018 04:18 PM

Here too as well, it is quite annoying, I thought SD cards are supposed to be more resilient.

Brains 01-20-2018 04:51 PM

Quote:

Originally Posted by Myrddin Emrys (Post 5809153)
Here too as well, it is quite annoying, I thought SD cards are supposed to be more resilient.

It is a known fact flash based memory has limited writes.

parsious 01-20-2018 06:46 PM

Quote:

Originally Posted by BW-userx (Post 5809092)
it might be that write protection has been set to it, micro sd or a standard sd card?

https://github.com/BertoldVdb/sdtool



It's a microSD so no stupid tab .. that was my initial thought .. but I have proven I can write to the FS that is there.

you can get gparted on Pi and all sorts of the GUI tools but I'm an old guy and Command line is where I do most of my work so I tend to use it

syg00 01-20-2018 06:52 PM

When I got my first pi3, I went and bought a couple of class 10 SDcards (same as I use in my DSLR). One was DOA.
Tossed it in the bin.

Brains 01-20-2018 07:42 PM

Quote:

Originally Posted by parsious (Post 5809179)
I can write to the FS that is there.

As I mentioned, I had exact same issues. I could write to the partitions via the Windows PE, it's the partitioning/formatting that could not be altered. I came to the conclusion it was something towards the beginning of the drive that was either burnt in or locked.
The Acer Switch 10 had Windows 8.1, someone on some forum said that operating system enabled bitlocker automatically, the Win2USB OS I ran on it said there was no bitlocker encryption.
Some time in the past there were a lot of threads here related to not being able to convert a U3 smart drive to normal data drive, similar situation as this, something at the beginning of the drive is locked.
EDIT: Something like this:
The U3 platform is a "closed" platform / proprietary format. SanDisk, the rightsholders for U3, ask for a 5% royalty from USB flash drive manufacturers who wish to implement the platform on their products.

Brains 01-20-2018 08:29 PM

It's the corporate way
You have to buy another one.

My Grandfather's farm pickup was an International harvester pickup when I was a child, it was 50 years old at the time and we used it every day, it was also quite impossible to find parts but that was obviously not an issue.

Today, if you buy a new vehicle and put it in a shed and don't drive it, 50 years from now it will be inoperable, seals will be shot, etc etc etc.

The corporation does not want you to buy one vehicle in your lifetime, they want you to buy one every two years.

EDIT: Had you not gone to the porn site......?

Myrddin Emrys 01-21-2018 08:27 AM

Quote:

Originally Posted by Brains (Post 5809161)
It is a known fact flash based memory has limited writes.

That's not the case this time.

BW-userx 01-21-2018 02:21 PM

Quote:

Originally Posted by parsious (Post 5809179)
It's a microSD so no stupid tab .. that was my initial thought .. but I have proven I can write to the FS that is there.

you can get gparted on Pi and all sorts of the GUI tools but I'm an old guy and Command line is where I do most of my work so I tend to use it

it was just an idea for one more thing to use to try and blast them partitions out of it. If you got windows laying around on a PC somewhere you might want to try their built in partitioning software they have. Just make it one partition in ntfs or whatever windows format, then redo the format whence you get it back to PI Linux. It's just an idea.

for all of this grief it is giving you .. you might want to just pick up a new one.

EDIT
from everything I've seen on write protect on a micro SD Card, they keep showing that tab on the adapter ... just out of curiosity and process of elimination. if you have one of them adapters, I'd just slip it in and move that tab to remove write protect then take it out of that adapter then see if that had any effect on it.

it is not a guarantee. just one more (idea) thing to try..

Brains 01-21-2018 09:27 PM

Quote:

Originally Posted by Myrddin Emrys (Post 5809335)
That's not the case this time.

I know, that's why I mentioned porn sites and 5% royalty from flash drive manufacturers who wish to implement the platform. Notice this time I omitted the word "USB"
EDIT: And...it's the corporate way

parsious 01-21-2018 10:00 PM

Quote:

Originally Posted by BW-userx (Post 5809464)

for all of this grief it is giving you .. you might want to just pick up a new one.

EDIT
from everything I've seen on write protect on a micro SD Card, they keep showing that tab on the adapter ... just out of curiosity and process of elimination. if you have one of them adapters, I'd just slip it in and move that tab to remove write protect then take it out of that adapter then see if that had any effect on it.

it is not a guarantee. just one more (idea) thing to try..

Yeah .. New card is being obtained today ... and yep I tried the adapter trick too for write protect ...

in in that weird state where I know there is almost no hope but I'm too suborn to be beaten my a bloody SD card

BW-userx 01-22-2018 07:11 AM

Quote:

Originally Posted by parsious (Post 5809608)
Yeah .. New card is being obtained today ... and yep I tried the adapter trick too for write protect ...

in in that weird state where I know there is almost no hope but I'm too suborn to be beaten my a bloody SD card

I know that feeling... I've never heard of such a thing as an microSD Card going on write protect all by its little self. It has to be something to do with that write bit that is stored on it. Like the USB Stick that come with write protect already and I just issue that hdparm -r0 /dev/sdx to set it for read / write. but on one is talking on the internet about it. It might be one of them conspiracies we so often do not hear about. :D ( sarcastically speaking of course).


All times are GMT -5. The time now is 07:07 AM.