Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hosed USB Stick
#1
Is there any way to repair a usb stick that seems to be hosed?
It shows up in disks, but all options are greyed out.
Reply
#2
Have you tried Gparted?
Jeremy (Mr. Server)

* Desktop: Ubuntu MATE
* Windows are for your walls, Apple is for your health, Linux is for your computer
Reply
#3
I did. It won't even show is gparted.
Reply
#4
Is there data on the stick that you need to recover? If not, it hardly seems worth putting a lot of time effort into something that is so cheap to replace.
Cliff Coggin
Mint 18.3
Reply
#5
It sounds like the stick is just hosed.  That obviously isn't normal function.

I agree with cliffcoggin.  If there isn't any data on it that matters I would let it go.  Besides I would never trust a stick or drive that started showing those signs even it could be restored.
Jeremy (Mr. Server)

* Desktop: Ubuntu MATE
* Windows are for your walls, Apple is for your health, Linux is for your computer
Reply
#6
Unfortunately USB flash drives can die without any prior notice.
The only way is to never have any data on a pendrive that you don't have a duplicate of on a HDD somewhere. I know it's not big help in hindsight, but there are not many easy ways to rescue data from a flash drive.
I am working on an Arch installation in a VM that will be moved to an USB stick.
Reply
#7
(06-18-2019, 02:00 AM)TarsolyGer Wrote: Unfortunately USB flash drives can die without any prior notice...

That is also true of any drive.


(06-18-2019, 02:00 AM)TarsolyGer Wrote: ...The only way is to never have any data on a pendrive that you don't have a duplicate of on a HDD somewhere...
.

Again, that is also true of any drive.


(06-18-2019, 02:00 AM)TarsolyGer Wrote: ...there are not many easy ways to rescue data from a flash drive.

True. It's pretty much impossible without professional (aka expensive!) data recovery (and, even then, there are only three chances of success: fat, slim, and none). This also applies to SSDs.

The only way to endure the safety of data on any drive is for it to exist in three, separate places. An example would be on a computer, on an onsite backup drive, and on an offsite backup drive. For a drive to be a true backup drive, it must be kept powered down, disconnected from the computer, and stored out of sight of the computer except while updating the backup.

USB flash drives are more prone to failure than other drives. If data is to exist only on a USB flash drive, you should have two more USB flash drives with the same data on them and keep them stored away from each other (preferably with one being kept offsite).

(Before anyone brings it up, RAID or any other kind of redundancy in itself is not a backup!)
Jeannie

One has to be proactive, not reactive, to ensure the safety of one's data so backup your data! And RAID is NOT a backup!
Reply
#8
(06-17-2019, 12:56 PM)Rob Hymers Wrote: Is there any way to repair a usb stick that seems to be hosed?
It shows up in disks, but all options are greyed out.



What was originally on the device?  Is it possible it has been auto mount? Some distros have a Removable Drives and Media setting.  If linux detected a major error it will freeze a file system in to read only mode.  You will have to attempt a manual fsck. 
 
First, you need to make sure you have identified the proper device name.  You can use the lsblk command to help identify your storage as well as the storage purpose.

lsblk -o name,size,label,fstype,mountpoint

Is the device auto mounted?

df -h 

If it is mounted check the /var/log/syslog file or journalctl for any device errors or file system freeze events.  If device errors are occurring you probably should discard the device.  If you need to recover data you can attempt to use dd_rescue to read as much as possible from the drive.  However, there is no guarantee you will get what you need, or even worse if it effects inode2 or file system meta data it will be useless. 

If it is not mounted you can try a simple read only test to see if the device is readable.  For a very quick read test do the followng dd command.

sudo dd if=/dev/sdX of=/dev/null bs=8192 count=1024 iflag=direct

To perform a read test on the entire device run the following dd command.

sudo dd if=/dev/sdX of=/dev/null bs=8192 iflag=direct

Check the /var/log/syslog file for errors or use the journalctl.

If you want to overwrite the device and start from scratch use the wipefs command. By default the wipefs command will list all detectable signatures.

sudo wipefs /dev/sdX*

If the wipefs command indicates a file system you might want to attempt a manual fsck.  If the fsck successfully completes you can attempt to mount it. 

sudo fsck /dev/sdX

If all else fails and you elect to wipe out the device, be careful and make sure you have identified the proper device before proceeding.  The "wipefs -all" command will remove all signatures effectively resetting the disk management meta data structures.

sudo wipefs -all /dev/sdX 

You can use the badblocks utility to thoroughly test the flash drive.  Periodically scan the /var/log/syslog file for any new disk related events that might be indicative of a drive failure.


Remember, the /dev/sdX is just an example, and you must determine the proper disk name.  Failure to do so, will result in data loss.  Always, make sure you have current backups and a well documented restoration plan before attempting any major disk management.  Better safe than later remorse.  


Examples only:

$ lsblk -o name,size,label,fstype,mountpoint
NAME                  SIZE LABEL                        FSTYPE  MOUNTPOINT
sda                    12G                                      
└─sda1                 12G                              LVM2_me 
  ├─mint--vg-root-real
                      20G                                      
  ├─mint--vg-root    20G                              ext4    /
  └─mint--vg-root_snap
                      20G                              ext4    
  └─mint--vg-swap_1     2G                              swap    [SWAP]
sdb                    10G                                      
├─sdb1                  1G RAID10_4X1GiB                linux_r 
└─md127               2G                              ext4    
└─sdb2                  9G                              LVM2_me 
  └─mint--vg-root_snap-cow
                        9G                                      
    └─mint--vg-root_snap
                       20G                              ext4    
sdc                    10G                                      
└─sdc1                  1G RAID10_4X1GiB                linux_r 
  └─md127               2G                              ext4    
sdd                    10G                                      
└─sdd1                  1G RAID10_4X1GiB                linux_r 
  └─md127               2G                              ext4    
sde                    10G                                      
└─sde1                  1G RAID10_4X1GiB                linux_r 
  └─md127               2G                              ext4    
sdf                  14.9G                                      
├─sdf1                200M EFI                          vfat    
├─sdf2                7.5G Install_macOS_Mojave_10_14_5 hfsplus 
├─sdf3                3.7G ext_jnl                      hfsplus /media/administr
└─sdf4                3.2G ExFAT                        exfat   
sdg                    10G                              LVM2_me 
└─mint--vg-root-real   20G                                      
  ├─mint--vg-root      20G                              ext4    /
  └─mint--vg-root_snap
                       20G                              ext4    
sr0                  1024M                                      

$

The /dev/sdf is the USB flash for this example.

$ sudo wipefs /dev/sdf* 
[sudo] password for administrator: 
        
DEVICE OFFSET      TYPE    UUID                                 LABEL
sdf    0x200       gpt                                          
sdf    0x3b9affe00 gpt                                          
sdf    0x1fe       PMBR                                         
sdf1   0x52        vfat    67E3-17ED                            EFI
sdf1   0x0         vfat    67E3-17ED                            EFI
sdf1   0x1fe       vfat    67E3-17ED                            EFI
sdf2   0x400       hfsplus 62068350-37ca-33cc-860b-84968c84d359 Install_macOS_Mojave_10_14_5
sdf3   0x400       hfsplus 9a6f97a1-9d06-392c-8181-e34ce830f0f3 ext_jnl
sdf4   0x3         exfat   5CFA-004A                            ExFAT

$

I am not going to wipe out my USB flash drive, but the command is as follows.

$ sudo wipefs -all /dev/sdf
Idea  Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.

Reply
#9
Thanks for all the replies. I'm not worried about the disk and there isn't anything important on it.
Was just challenging myself Smile
Reply
#10
Sorry, if my previous post was too much information, but this situation aroused my curiousity.   I will shut up now.
Idea  Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)