recover usb stick

I have a usb stick that is not recognized by dolphin but shows up in a terminal with command lsusb. Can I format it from the cli? It shows up like this.

Bus 001 Device 029: ID 058f:6387 Alcor Micro Corp. Flash Drive

Of course, the device number changes but the ID remains 058f:6387. It would be nice to recover it, but it is real close to the trash can!

When it is plugged in, does:

fdisk -l

see it. And, for that matter, does

parted -l

see it. (You will need a root commandline for those commands).

fdisk -l gives me

**Disk /dev/sdc: 1.91 GiB, 2055208960 bytes, 4014080 sectors**
Disk model: Flash Disk       
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: 0x4958e456

**Device****Boot****Start****    End****Sectors**** Size****Id****Type**
/dev/sdc1          63 4014079 4014017  1.9G  7 HPFS/NTFS/exFAT

parted -l gives me

Model: Generic Flash Disk (scsi)
Disk /dev/sdc: 2055MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:  

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  2055MB  2055MB  primary               type=07


Dolphin still does not see it after running these two commands.

First, please do not type “<command> gives me” preceding the output within the CODE tags. Simply copy that one line
with the output and paste it between the CODE tags. How easy can it be?

And when you leave out parts of your output, then say so. Now we have a listing of a system that can not exist. The presence of sdc implies that there most probably is a sda and a sdb, but we do not see it. How trustworthy is your computer copy/paste when you leave out things without even explaining that you did so?

Then, sdc is apparently a mass-storage device of ~ 1.9 GiB. It has a partition table of the type DOS (also called MBR). In the partition table is defined one (1) partition that covers the rest of the space (~ 9 GiB). The partion is of type 7 HPFS/NTFS/exFAT, which may point to it being created for having a non-Linux file system (like NTFS) on it.

These two outputs are just listings of tacts. I do not understand why you suggest that hey should change something by saying "Dolphin still does not see it after running these two commands. "

Apparently there is no file system on that partition. But of course you can create one. Of your own choice. But when you want to create a Linux file system on it, then please change the partition type accordingly (to Linux data). You can of course use YaST > System > Partitioner to do that. From the command line use fdisk to change to partition type (when needed) or the whole partitioning (when wanted). Use mkfs variants for creating Linux file systems of several types. For NTFS and other non-Linux (read: MS Windows) type of file systems, I would use a MS Windows system (well, in fact I would never do that at all), but it may be that there are tools to do that on your openSUSE system.

GParted, KDE Partition Manager. The last creates exFAT.

I’m resurrecting this old thread because I tried again to make this usb drive work. I must have damaged it by unplugging without unmounting. I’ve used both the yast partitioner and Gparted. Both say the GPT is corrupted but say the primary partition is ok and ask if I want to continue creating a partition. I say yes but it fails. Gparted shows the whole drive as an unallocated partition. I’ve tried to format it as both xfs and exFAT, but of course both failed.

Gparted gave me one bit of info to pursue. It states that the drive is mounted read-only. I don’t know how to change this. There is no physical switch. I saw no way in Gparted and I don’t know the cli command that might do it. Any suggestions?

Does gparted really say it is mounted (read-only). When there is no file system at all, how can it be mounted?

It’s possibly an exFAT filesystem – “lsblk --fs” would probably have given you the correct answer …

  • You’ll need to install the “exfatprogs” package from the main openSUSE Repository.
  • The “fsck.exfat” and, if really needed, “mkfs.exfat” …

Apart from that, the exFAT drivers have been present in the Linux Kernel for some time now – the Leap 15.3 Kernel has them by default …

In a similar situation in the past, I was able to use “gdisk”. The expert menu includes an option to zap the GPT partition table.

I have not tried that recently.

SUSE Paste
Before this, an error message says the GPT is corrupt.

The image shows that it says “…, because it is opened read-only”.
You said “It states that the drive is mounted read-only.”

Please do not post your own conclusions/fantasy, but only what the computer says. >:(

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

When there is nothing on that device you want to save (but only then), the best thing is to erase the first block. As root:

dd if=/dev/zero of=/dev/sdN count=1

(replace the N with the correct letter, check that twice**!** or you may destroy the contents of the wrong disk).

When this gives an error, please post (and then not your conclusion, but the copied/pasted text from the terminal including the line with the prompt and the command, up to and including the line with the new prompt) between CODE tags (you get the CODE tags by clicking on the button with the # in the toolbar at the top of the post editor).

When this gives writing problems (read-only or otherwise) then your device is broken.

When that succeeds, then use the partitioner of your choice to make a partitioning of your choice and put file system of your choice on those partitions.

Please be aware that, the filesystems supported by any given Kernel are located in ‘/lib/modules/$(uname -r)/kernel/fs/’.

  • “modprobe «filesystem name
    »” to load the driver into the running Kernel.

To initialise a storage medium before reformatting it –

  • “dd if=/dev/urandom of=/dev/sd? iflag=fullblock bs=1024 count=10 status=progress”

In other words, overwrite whatever partition table was present – in this case the first MB of blocks on the given device.

  • You can also use “dd if=/dev/zero of=/dev/sd? iflag=fullblock bs=1024 count=10 status=progress” to overwrite the first MB with zeros.

It possible that, the USB device has a capacity of around about 2 GB –

  • Therefore, it doesn’t need exFAT – simple FAT is OK for devices with a capacity of up to and including 32 GB.

[HR][/HR]Extra information for exFAT –

  • You’ll need to add “exfat” to the file ‘/etc/filesystems
    ’ to allow “mount” to auto-magically recognise the filesystem and, remember to re-edit that file every time the package “util-linux” changes … - It’s also not a bad idea to execute “modprobe exfat” …

GParted and KDE Partition Manager can do this too.

I used the second command to initialize the disk. Next, I formatted with a single FAT partition. Prior to doing this, Dolphin didn’t see it; but it showed up in lsusb and lsblk. After formatting, it could now be seen by Dolphin but would not mount. After a short time, this error appeared

An error occurred while accessing '252.5 MiB Removable Media', the system responded: An unspecified error has occurred: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

So apparently, as hvcc says: it is broken.

Thanks to all for helping me with this.