Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I made a bootable USB stick (Fedora) to install on a system. I'd like to reuse the stick, so I want to remove all traces of the functioning system; in particular I'm not sure how to reset the MBR so that, when treated as a disk, the stick does not look bootable.

My ultimate goal is to have a blank, non-bootable, NTFS (re-)formatted USB stick.

share|improve this question

5 Answers 5

up vote 12 down vote accepted

As root, run dd if=/dev/zero of=/dev/sdX bs=512 count=1

Then you can add a partition table (fdisk /dev/sdX and press o, or you could use one of the graphical tools like gparted) and a new NTFS partition.

share|improve this answer

From Fedora install Gparted from the Fedora package manager. Unmount the bootable USB drive. Open Gparted and find the USB drive from the menu list of drives (see mouse cursor on screenshot below).

enter image description here

From the Gparted menu choose: Partition -> Manage Flags. From the Manage flags on... window uncheck boot (see screenshot below).

enter image description here

From the Gparted menu select Partition -> Format to -> NTFS.

share|improve this answer
    
Is unchecking the boot flag equivalent to zeroing the MBR via dd? –  Dave Oct 3 '13 at 14:04
    
The USB drive has a boot flag somewhere in one of the first sectors of the drive which can be set/unset to bootable using gparted. So gparted will unset the identical boot flag as dd does, only it has a graphical front-end to show you what it's doing. –  karel Oct 3 '13 at 14:14
1  
@Dave No, it is not the same. Unsetting the flag will leave your MBR intact. –  hunter2 Oct 4 '13 at 7:50

You can achieve this by a simple system tool like diskpart from windows.

1)Open up the Start Menu and type “diskpart” in the run box.

2)Type “list disk”.enter image description here 3)“select disk #” where # is the disk number of your USB stick.

4)now enter the command “clean all”

The "clean" command zeroes out the sectors of the disk that contain the partition data. “clean all”command zero out all data on the USB stick .

Now you can format it from context menu as usual.

(since you mentioned NTFS , i hope you have access to a windows system)

To zero fill the drive from linux you can make use of dd. To wipe a disk by writing zeros:

dd if=/dev/zero of=/dev/sda bs=4k conv=notrunc

where /dev/sda with your device.

share|improve this answer
    
You don't actually need to zero the whole drive, just the MBR. This will save a write cycle on the flash memory. –  user55325 Oct 3 '13 at 14:03
    
I agree to that. –  Ash Oct 3 '13 at 14:12

You can use diskpart from the command line or the disk management tool (inside computer management).

Disk Management: http://windows.microsoft.com/en-us/windows7/delete-a-hard-disk-partition

Obviously repartitioning / reformatting will erase all your files on the drive.

Diskpart command line: http://ss64.com/nt/diskpart.html

Usually the procedure is : delete the partition, create a new one, then format it

share|improve this answer
    
Slow to the races, and you don't give any clear instructions, just links. Welcome to superuser, but realize we don't like answers of just links. Summarize the points, and add the link as a source for your information –  Canadian Luke Oct 3 '13 at 14:34

While the accepted Answer works, it is overkill.

The MBR contains the partition table as well as the bootloader. The bootflag is yet another thing. To boot from the USB, you need a bootloader installed and the bootflag set on one partition. To use the drive at all (whether or not you want it to be bootable), you need a partition table.

You could just use your drive as-is, with no changes (so what if it's bootable).
You could also unset the bootflag to make it non-bootable.
A step further is to remove the bootloader (the first 446 bytes, IIRC) - but not the partition table. At that point, it is non-bootable and all your data is still intact.

Granted, you say that you want a NTFS partition, and I guess we can infer that it is/was not NTFS before, so you'll move your data and reformat anyway.

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.