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.

My pendrive has become read only. I want to format it using Linux - how do I do that?

If I run mkfs.vfat \dev\sdc1, it doesn't work.

share|improve this question
1  
Well first of all linux uses the forward slash / and not the backward slash. Secondly, "it doesn't work" isn't good enough. Please say precisely how it's failing (errors given, etc). Third (and most importantly) this is the wrong site for this question. This site is for programming questions. –  Chris Aug 3 '11 at 6:07
    
Hi coder. As this question is not related to programming, you are more likely to get an answer on Super User or unix.stackexchange.com –  Crippledsmurf Aug 3 '11 at 6:08
add comment

migrated from stackoverflow.com Aug 3 '11 at 10:21

This question came from our site for professional and enthusiast programmers.

3 Answers

sudo mkfs.vfat /dev/sdc1 -I

or

sudo mkfs -t vfat /dev/sdc1 -I

That should do it.

If it says its mounted, Do this:

sudo umount /dev/sdc1

If it says the drive is in use, close all the explorers that are showing contents of ur pen drive. Close Video/Audio/Multimedia/Any Other applications that are using pendrive eg: VLC playing a video file from ur PenDrive.

After (umount)ing, try the first command.

share|improve this answer
    
IMHO the -I switch is unnecessary, because you create the VFAT FS inside a partition (sdc1), not on the whole device (sdc). Otherwise good job trying to capture some possible error scenarios. –  mpy May 9 '13 at 13:02
add comment

mkfs.vfat maybe the incorrect way to invoke the tool. I would think mkfs -t vfat /dev/sdc1 would be the correct way to go about it. Make sure of the following before you do this:

  1. Backup all data.
  2. Make sure from /etc/fstab that /dev/sdc1 points to the usb drive.
  3. That you do not need root permissions for this.

Do check the man pages for mkfs for additional options.

share|improve this answer
2  
FYI mkfs -t vfat will call mkfs.vfat. Makes no difference, really. –  Chris Aug 3 '11 at 6:10
add comment

Make sure sdc1 is your USB drive.

Here are instructions on the process: http://www.cyberciti.biz/faq/formatting-usb-pen-in-linux/

share|improve this answer
add comment

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.