4

I recently used a flash drive to try MeeGo on my netbook. Unfortunately, the application I used to write MeeGo to the flash drive created a new partition in a rather unusual format. The Ubuntu disk utility can't delete the partition, and GParted can't even see it. How can I completely wipe the flash drive from Ubuntu? I'd prefer not to install any additional software.

3 Answers 3

7

Have you tried fdisk? In a terminal, run

sudo fdisk /dev/sdx

where /dev/sdx should be replaced with the device file for your flash drive. Once you get fdisk open, type p to list the partition table, and if the mysterious partition is listed, you can use d # to delete it. (# is the number of the partition, so e.g. d 1, d 2) w writes the partition table back to the disk and q quits. (hit m for help)

If even fdisk fails, I guess you could just try zeroing out the first sector, which I think contains the partition table.

sudo dd if=/dev/zero of=/dev/sdx bs=512 count=1

where, again, /dev/sdx should be replaced with the actual device for your flash drive, will do that for you. You can increase the count= number to write zeros to more of the disk, or omit it entirely to overwrite the entire disk. Needless to say, if you do this, you irretrievably lose any files that may have been stored on the disk.

0

I think the best way is to use flash_erase which is part of MTD (Memory Technology Devices) drivers.

sudo flash_erase --help

gives:

Usage: flash_erase [options] MTD_DEVICE <start offset> <block count>
Erase blocks of the specified MTD device.
Specify a count of 0 to erase to end of device.

  -j, --jffs2       format the device for jffs2
  -N, --noskipbad   don't skip bad blocks
  -u, --unlock      unlock sectors before erasing
  -q, --quiet       do not display progress messages
      --silent      same as --quiet
      --help        display this help and exit
      --version     output version information and exit
0

if you would like to have a bit more security, you can use random digits instead of zeros:

dd if=/dev/urandom of=/dev/sdX bs=128

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.