Remove partitions / format uSD Card
Remove partitions / format uSD Card
Author
Discussion

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
I have a micro SD card that used to be in use in a Moto G phone as 'phone' storage - by which, I mean the phone encrypted the card so it could only be used in that particular phone, to help expand the usable memory, rather than as simple additional storage that could then be read by any other system. It was a Moto G / Android function that encrypted the card, nothing after market or app based.

Having removed the card from the phone, i tried clear it / format it in my PC/laptop using the normal format routine. This didn't work and as I didn't have immediate access to the phone, tried a few other SD formatting tools which also didn't work, such as https://www.sdcard.org/downloads/formatter/ . Once I had access to the original phone again, I replaced the uSD card and tried format/remove the encryption but the phone no longer recognised the card, probably due to my meddling!

I've now installed (USB pen drive) Ubuntu 19.10 temporarily and tried GParted to remove the partitions, change the partition type, format the card in different file systems, all with no joy. I've also tried using dd to fill the card with zeros (sudo dd if=/dev/zero of=/dev/sdc) which 'timed out' with no more space, saying it had filled everything with zeros, but still the 2 partitions remain.

Within Windows, I can't 'see' the card but in Linux, I can see info on the 2 partitions. The info I get is:



Any tools I can try to get rid of these 2 partitions so I can get back to a 'normal' uSD card? I don't need to recover any info from the card.

cobra kid

5,612 posts

270 months

Friday 12th June 2020
quotequote all
Spend a tenner and save the hassle.

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
Thanks for the useful input! I have 2 x 64Gb cards (empty), 2 x 8Gb cards (in use) and various SD and USB pen drives of varying size up to 32Gb, so have no actual need for the drive, it is more the principle that I don't want to be defeated!

hutchst

3,727 posts

126 months

Friday 12th June 2020
quotequote all
Can you mount it in Ubuntu?

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
I've tried, but (from memory) it said it can't find an entry for it in etc/fstab (not sure if I've remembered the right folder...)

xeny

5,524 posts

108 months

Friday 12th June 2020
quotequote all
Does lsblk show anything if you compare it with a "good" card?

Have you tried dd'ing a good card (with a different partition arrangement) onto it?

My normal go to in this situation is dd if=/dev/zero, I'm slightly suspicious it has ended up toggled read only somehow.

Jinx

12,022 posts

290 months

Friday 12th June 2020
quotequote all
Have you another android phone you could reformat it in. Linux would be my goto normally but if gparted can't do anything with it I'd try another android phone. Dodgy android formatting by the look of things (so almost Linux but changed just enough to be a pain in the arse) .

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
xeny said:
Does lsblk show anything if you compare it with a "good" card?

Have you tried dd'ing a good card (with a different partition arrangement) onto it?

My normal go to in this situation is dd if=/dev/zero, I'm slightly suspicious it has ended up toggled read only somehow.
I need to load Ubuntu onto an old SSD I have, as my pen drive is too slow to keep booting into it and it's a quicker operation for me to swap out disks in my laptop, so your first suggestion I'll try once I've loaded Ubuntu onto my SSD. I have tried dd'ing the Ubuntu pen drive (8Gb) onto the card but it wouldn't / couldn't complete the task (probably to do with the fact that the pen drive was in use...), so once I've loaded my SSD, I'll give that one a shot as well using another uSD card. As you know, I've tried the dd if=/dev/zero route and this didn't work.

Jinx said:
Have you another android phone you could reformat it in. Linux would be my goto normally but if gparted can't do anything with it I'd try another android phone. Dodgy android formatting by the look of things (so almost Linux but changed just enough to be a pain in the arse) .
I've just tried this in my Android phone (a Xioami Redmi 6A phone), which claimed to work but the phone still reported it as a non-recognised card (I tried twice), so then tried a Windows format (not fast format) but it couldn't complete it.

Next task - load Ubuntu onto my old SSD and try xeny's suggestions

xeny

5,524 posts

108 months

Friday 12th June 2020
quotequote all
S6PNJ said:
I've tried, but (from memory) it said it can't find an entry for it in etc/fstab (not sure if I've remembered the right folder...)
that suggests your mount command either didn't specify a mount point, or the device you wanted to mount in it? (apologies if this is sucking eggs).

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
xeny said:
S6PNJ said:
I've tried, but (from memory) it said it can't find an entry for it in etc/fstab (not sure if I've remembered the right folder...)
that suggests your mount command either didn't specify a mount point, or the device you wanted to mount in it? (apologies if this is sucking eggs).
Nope, not sucking eggs at all - my linux knowledge is very VERY limited - can you give me a command to use please?

S6PNJ

Original Poster:

5,852 posts

311 months

Friday 12th June 2020
quotequote all
xeny said:
Does lsblk show anything if you compare it with a "good" card?
Running "lsblk /dev/sdb" I get:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 1 29.6G 0 disk
??sdb1 8:17 1 16M 0 part
??sdb2 8:18 1 29.5G 0 part

Running against a USB pen drive, I get:

lsblk /dev/sdc
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 1 1.9G 0 disk
??sdc1 8:33 1 1.9G 0 part /media/phil/MYLINUXLIVE

Not sure what I'm looking for or what it is meant to tell me?

Edited to add:
Running sudo dd if=/dev/zero of=/dev/sdb

I get

dd: writing to '/dev/sdb': No space left on device
61962241+0 records in
61962240+0 records out
31724666880 bytes (32 GB, 30 GiB) copied, 9005.36 s, 3.5 MB/s

but then subsequently running Gparted I still see the 2 Android partitions.


Edited by S6PNJ on Friday 12th June 20:36