Partition Tables won't write to USB Stick

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Hi,

Recently one of my USB Drives became unreadable according to GParted. None of the partitions show up and it doesn't mount to Ubuntu Desktop 20.10. I've tried all the command line tools under the sun that I know of but nothing, the partition table "writes", but never mounts. I reload the tool and guess what: the partition table is none existent.

Tools I've used:
-fdisk
-mkfs
-cfdisk
-GParted (doesn't do anything, just informs me that it's unreadable even after writing new partition table.)

When I tried mkfs.vfat /dev/sda -I
it told me that attribute "partition" not found

Any ideas to fix the USB Drive and be able to actually use it again?

Oh, and I also zeroed the drive using dd and it took a few hours at 4.7MB/s, then tried doing mkfs but it didn't work. Maybe even made it worse.
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
When you have your usb drive in your pc, open a terminal and share the output of.
Code:
lsblk
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.8G 0 disk

That's the output for my USB Stick
There should be 32Gb but it only shows 29.8
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
When you used fdisk, what keys do you press when trying to create a partition?
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
My use of fdisk:

Code:
Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognised partition table.
Created a new DOS disklabel with disk identifier 0x9ef83dc1.

Command (m for help): g
Created a new GPT disklabel (GUID: 15B28608-CBFE-2944-86B1-A73EF5239A68).

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-62535646, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62535646, default 62535646):

Created a new partition 1 of type 'Linux filesystem' and of size 29.8 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Synching disks.

After this, I opened GParted which told me as normal, unallocated space.
I reopened fdisk and it said this:

Code:
Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognised partition table.
Created a new DOS disklabel with disk identifier 0xa2399da4.

It appears to have done absolutely nothing, even though I have used the write command, every time you open fdisk, it creates a new DOS Disklabel. I have tried most partition tables and no luck with any.

Also, where the input is blank I stuck with the default and just hit enter.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
Try running partprobe from the commanline when your usb drive is still in the system, can you then run lsblk again and share the output?
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Code:
sudo partprobe /dev/sda

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    1  29.8G  0 disk
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
What does the output of the following look like for you.
Code:
dmesg | grep sda
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Code:
sudo dmesg | grep sda
[ 7841.353849] sd 0:0:0:0: [sda] 62535680 512-byte logical blocks: (32.0 GB/29.8 GiB)
[ 7841.354139] sd 0:0:0:0: [sda] Write Protect is off
[ 7841.354145] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 7841.354392] sd 0:0:0:0: [sda] No Caching mode page found
[ 7841.354401] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 7841.382950] sd 0:0:0:0: [sda] Attached SCSI removable disk
[11245.518544] sd 0:0:0:0: [sda] 62535680 512-byte logical blocks: (32.0 GB/29.8 GiB)
[11245.518828] sd 0:0:0:0: [sda] Write Protect is off
[11245.518834] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[11245.519082] sd 0:0:0:0: [sda] No Caching mode page found
[11245.519091] sd 0:0:0:0: [sda] Assuming drive cache: write through
[11245.553013] sd 0:0:0:0: [sda] Attached SCSI removable disk
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
That looks good, try wiping the usb drive, make sure that the of is your usb device.
Code:
dd if=/dev/zero of=/dev/sda bs=4096 status=progress
Then try to create a partition with fdisk or gparted again.
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Ok have set it running, this will take a while on a 32Gb drive...
I'll reply back here when it's done.
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Okay so the dd operation has finished:
Code:
32014962688 bytes (32 GB, 30 GiB) copied, 1636 s, 19.6 MB/s
dd: error writing '/dev/sda': No space left on device
7816961+0 records in
7816960+0 records out
32018268160 bytes (32 GB, 30 GiB) copied, 1661.8 s, 19.3 MB/s
I have just opened GParted and created a new partition table. It looked like it was doing something and no errors happened after the loading bar vanished, but it appears to have done nothing, as when I clicked on new partition, it told me it needed a new partition table first. A never ending loop.

The same with fdisk even when running sudo partprobe /dev/sda
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
Sounds more like a physical defect if that doesn't work since there's not much else to it.
 
OP
P

PenguinS

New Member
Joined
Jan 24, 2021
Messages
8
Reaction score
2
Credits
61
Okay well I'll count that USB Stick as completely and utterly dead.
Thanks for your time and help anyway
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,963
Reaction score
4,434
Credits
43,802
Okay well I'll count that USB Stick as completely and utterly dead.
Thanks for your time and help anyway
Normally when with the output of dmesg you can see if there is something wrong with a drive but seems like this is a special case, try another usb drive and it most likely will work then.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
9,112
Reaction score
7,735
Credits
74,391
Ha! I knew I had this bookmarked. It was in a browser that's not synced.

If you want to throw a bit more time at it as a last resort:

 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Top