Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a usb drive which I would like to put a linux distribution on but it already has some files on it on /dev/sdc1. Using fdisk, I deleted the first partition and wrote the changes. When I printed the table, the first partition was gone.

Then I created a new partition (/dev/sdc1).

However when I wrote these changes to the usb, the old files were still there. I followed these instructions after deleting the first partition http://www.zorge.net/?p=22

Are there any commands in fdisk (I'm trying to get comfortable in fdisk, so no gparted for me) to completely wipe out all the information on a drive?

share|improve this question
up vote 3 down vote accepted

fdisk manages partitions, but does not format or write data to the disk.

To format the disk, use mkfs

# FAT
mkfs.vfat /dev/sdxy # /dev/sdxy is your usb

# Or for ext4
mkfs.ext4 /dev/sdxy 

But, even formatting does not over writ your data. To over write your data use dd or a utility such as scrub

scrub /dev/sdxy

See also man scrub

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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