1

I bought a SanDisk Ultra 16GB 3.0 USB stick, reformatted it to ntfs and "managed" to copy too much data on to it. After that it is undetectable in Ubuntu as well as in Windows (10). I have tried fdisk and its variants, gparted, mkfs, gpart, testdisk and it is no longer detected. Is there a way to make it work? The files on it are still on the disk I copied from so, just make it work again is enough. No need for file recovery.

Addition: I tried fdisk -l | grep Disk and when I lost it and still knew the device bound to that stick, I tried to zero it by dd if=/dev/zero of=dev/sdd, which at the time seemed to work but the stick still is undetected.

2 Answers 2

0

In the terminal, run this command:

fdisk -l | grep Disk

Hopefully, its block device will be listed.

I will assume it showed at /dev/sdb.

Warning! Failure to type the correct block device could result in complete data destruction on your computer's internal HDD.

Next we will wipe it completely:

sudo dd if="/dev/zero" of="/dev/sdb" #Replace "of" accordingly

After that, hopefully you'll be able to format it in Gparted.

1
  • I tried this but to no avail, my ram, my SSD and my HDD show up and whichever other USB stick I insert but not the faulty one.
    – Serafim
    Jul 3, 2016 at 12:56
0

Run the following commands from the terminal.

  1. Remove all of your USB devices except for the 16GB USB flash drive that you want to reformat, so you won't get confused about the device name of the USB flash drive later on.

  2. List all the partitions.

    sudo fdisk -l
    

    Search the results of the command for output that looks like this:

    Disk /dev/sdc: 15729 MB, 15728640000 bytes
    60 heads, 33 sectors/track, 31030 cylinders, total 30720000 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
    Disk identifier: 0x00016288
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *        2048    30719998    15357952    b  W95 FAT32
    

    If you see something like 15729 MB (16GB) in the output (see the example output above), then that is your 16GB USB flash drive. In this example it is called /dev/sdc. Now open the Disks application from the Dash and check again to make sure that the device name of your 16GB flash drive is the same as what you got from running the command: sudo fdisk -l.

  3. Create a partition table on the disk of type msdos, sometimes known as Master Boot Record (MBR).

    sudo parted /dev/sdc mklabel msdos
    

    In this example I used /dev/sdc for the name of the device which is what was found in the results of step 2. I can't stress strongly enough how important it is to verify the device name before running this step!

    Warning: If you type the wrong device name you may overwrite your operating system or another one of your partitions containing important personal files!!! So be careful and check the device name a second time. Open the Disks application and check the device name of your 16GB USB flash drive in Disks. It should be the same device name!!! Now check again! You don't want to accidentally type the wrong device name!

  4. Add an empty "primary" partition, which will hold a FAT filesystem later.

    sudo parted -a none /dev/sdc mkpart primary fat32 0 16384 
    

    Once again in this example I used /dev/sdc for the name of the device which is what was found in the results of step 2. The command specifies the start point (from 0 MB) to the end point (16384 MB). If the 16GB USB flash drive does not have the full 16384 MB space, parted will adjust it automatically. If the terminal returns a message that the start point can't start at 0 MB and you have to use some other small number close to 0 MB, type Y to accept this. Note the command is creating a single, primary partition on the whole disk.

    This newly created partition will have the ID /dev/sdc1. That is because the device name in this example is /dev/sdc and the 1 at the end is because it is the first partition on that device.

  5. Create a FAT filesystem on the /dev/sdc1 partition by formatting the partition.

    mkfs.vfat -n "16GBUSB" /dev/sdc1
    

    /dev/sdc1 is the partition ID from step 4. "16GBUSB" is the partition label, which can be your own choice of label, just enclose the label inside two double quote characters.

You now have a ready-to-use reformatted USB flash drive with a 16GB FAT partition.

2
  • It doesn't show up. And while I still knew the device I tried this. No success.
    – Serafim
    Jul 3, 2016 at 13:16
  • 1
    Maybe I can manage to bind a dev to seemingly unused ports, one by one and see what happens.
    – Serafim
    Jul 3, 2016 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .