2

I have a 2GB USB drive that had about 1.8GB of stored data on it. So I delete these files, and then I check the drive's properties, and I see it still has 1.8GB of data on it (only 0.2GB remaining)!

The file system doesn't see any files on it, but the drive is almost at full capacity. I previously had UNetbootin create a bootable USB drive out of this stick, so I'm wondering if that created some kind of "partition" or something on it that can't be erased through the file system.

I just want my 2GB back - don't care what I have to do to get it. I'm also not able to get to the store and buy another stick, if that was going to be someone's suggestion! Thanks in advance!

Edit - I'm on Linux Mint and/or Linux Ubuntu (I'm in front of 2 machines right now, so a solution for either of those OSes would suffice).

4
  • Could you use Parted to repartition the USB drive?
    – martineau
    Aug 31, 2012 at 16:28
  • No unfortunately it doesn't look like its possible to do with Linux Mint :-/
    – pnongrata
    Aug 31, 2012 at 16:28
  • There's always fdisk.
    – martineau
    Aug 31, 2012 at 16:32
  • Thanks @martineau but unfortunately fdisk doesn't work either - please see my comment under m4573r's answer.
    – pnongrata
    Aug 31, 2012 at 16:48

3 Answers 3

5

You can always format your drive. However I would verify that your "deleted" files are not in the recycle bin... In which case emptying it should solve your problem.

4
  • Thanks @m4573r (+1) - please see my edit regarding my OSes. On Windows it's nice - you can just right-click the USB stick and select "Format drive". What's the analog in Linux Land?
    – pnongrata
    Aug 31, 2012 at 16:08
  • 1
    Well it is quite easy to find guides on "How to format a disk on linux". The standard command line tool is fdisk /dev/your_device to repartition your disk, and mkfs -t ext3 /dev/your_device to recreate the (empty) filesystem on it.
    – m4573r
    Aug 31, 2012 at 16:16
  • Thanks again @m4573r but I'm not having any luck with fdisk. When I type fdisk <my-drive> it outputs the following: "Command (m for help):". When I type "m" it gives me a whole list of options to choose from, none of which are for formatting the drive...
    – pnongrata
    Aug 31, 2012 at 16:26
  • 1
    Type p to list all the partitions on your drive. Then d to delete them, one by one. Then n to create a new one. Choose primary, and use the default values to span it across all your disk space. After quitting and saving (key w), you'll have an empty drive, without a filesystem. You can then use mkfs to rebuild it.
    – m4573r
    Aug 31, 2012 at 17:05
2

For your partition issues you can try using GParted:

sudo apt-get install gparted
gksu gparted

Choose your device in the upper-right corner list. Then select Device -> Create partition table to create a partition table on the device. This will allow you to repartition the drive and should restore the entire capacity.

I'm unclear on whether you're wanting to overwrite, or securely erase previous data as well. In the case you are: Ubuntu has a command line utility shred which can overwrite previously stored data with random bits and bytes.

man shred

After using it you would have to repartition the device.

or you could also try the dd tool:

 1. Start the Disk Utility via System > Administration > Disk Utility
 2. Find your disk in the left panel, select it, and on the right find the device path (eg. /dev/sdb )
 3. Run the following command from a gnome-terminal (Applications > Accessories > Terminal):

    sudo dd if=/dev/zero of=/dev/sdb bs=1M
1

You have several options here:

1) Reformat the USB drive

2) Use HP USB Disk Storage Format Tool to format the drive. (Very helpful tool!)

3) Or you can use Boot and Nuke. When you use Boot and Nuke, make sure you leave the USB stick plugged in. I would be very, very careful using this tool as if you select a wrong drive, you potentially can format your HDD instead of USB drive.

Good luck! Hope this helps!

2
  • Thanks @George but HP USB Disk Storage Format Tools is a Windows application (see my update regarding Linux), and the link for Boot & Nuke doesn't work...
    – pnongrata
    Aug 31, 2012 at 16:14
  • @zharvey I think the site might be down. The nuke and boot is probably your best choice, you'll still might have to reformat the USB afterwords, but it will, for sure, get ride everything you have on that USB.
    – George
    Aug 31, 2012 at 16:47

You must log in to answer this question.

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