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'm trying to format a pen drive using mkfs, but it fails with: Read-only file system. Here is what I have tried so far:

$ sudo hdparm -r0 /dev/sdb1

 setting readonly to 0 (off)
 readonly      =  0 (off)
$ umount /dev/sdb1
$ sudo chmod 777 /dev/sdb1
$ sudo mkfs -t vfat /dev/sdb1
mkfs.vfat 3.0.13 (30 Jun 2012)
mkfs.vfat: unable to open /dev/sdb1: Read-only file system

What should I do?

share|improve this question
poss dupe – Ringtail Jan 10 '13 at 17:39
Some pen drives have a readonly/readwrite switch. Have you checked it? Also, after issuing the mkfs command, could you please run dmesg | tail and paste the output inside your question? Thanks! – Andrea Corbellini Jan 10 '13 at 18:01

Your Answer


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

Browse other questions tagged or ask your own question.