Ubuntu – USB Read-Only Filesystem


I'm pretty confident in Linux now, but this USB stick is complaining of a read only file system, but I wrote to it in Windows 7 a minute ago, and there was no issues. I've tried all the suggestions from other posts, and all the things I can think of.

Here is the dmesg stating write-protection is off:

[ 5563.009330] scsi 11:0:0:0: Direct-Access     SanDisk  Cruzer Edge          1.26 PQ: 0 ANSI: 5
[ 5563.009676] sd 11:0:0:0: Attached scsi generic sg5 type 0
[ 5563.011878] sd 11:0:0:0: [sdi] 31266816 512-byte logical blocks: (16.0     GB/14.9 GiB)
[ 5563.013754] sd 11:0:0:0: [sdi] Write Protect is off
[ 5563.013759] sd 11:0:0:0: [sdi] Mode Sense: 43 00 00 00
[ 5563.014970] sd 11:0:0:0: [sdi] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA

Here is the problem:

adam@Home:~$ sudo mount /dev/sdi ~/usb
mount: /dev/sdi is write-protected, mounting read-only

I have also formatted the usb with zero's with DD, and tried again:

adam@Home:~$ sudo dd if=/dev/zero of=/dev/sdi bs=1k count=2048
2048+0 records in
2048+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.426446 s, 4.9 MB/s

adam@Home:~$ sudo parted /dev/sdi
GNU Parted 3.2
Using /dev/sdi
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: /dev/sdi: unrecognised disk label
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdi: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
(parted) mklabel msdos
(parted) mkpart primary
File system type?  [ext2]? fat32
Start? 1MiB
End? 100%
(parted) p
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdi: 16.0GB
    Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  16.0GB  16.0GB  primary  fat32        lba

(parted) q
Information: You may need to update /etc/fstab.

adam@Home:~$ lsblk
sda                   8:0    0 698.7G  0 disk
└─md0                 9:0    0   2.7T  0 linear /mnt/raiddrives
sdb                   8:16   0 698.7G  0 disk
└─md0                 9:0    0   2.7T  0 linear /mnt/raiddrives
sdc                   8:32   0 698.7G  0 disk
└─md0                 9:0    0   2.7T  0 linear /mnt/raiddrives
sdd                   8:48   0 698.7G  0 disk
└─md0                 9:0    0   2.7T  0 linear /mnt/raiddrives
sde                   8:64   1   7.6G  0 disk
├─sde1                8:65   1   487M  0 part   /boot
├─sde2                8:66   1     1K  0 part
└─sde5                8:69   1   7.1G  0 part
  ├─Home--vg-root   252:0    0   3.2G  0 lvm    /
  └─Home--vg-swap_1 252:1    0     4G  0 lvm    [SWAP]
sdi                   8:128  1  14.9G  0 disk
└─sdi1                8:129  1  14.9G  0 part

adam@Home:~$ sudo mkfs -t vfat /dev/sdi1
mkfs.fat 3.0.28 (2015-05-16)

adam@Home:~$ sudo mount /dev/sdi ~/usb
mount: wrong fs type, bad option, bad superblock on /dev/sdi,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

There is no button the USB to turn write protection on or off.

Best Answer

I wanted to extend john smiths answer. I had made two USB sticks bootable using Ubuntus "Start media creator". It made the sticks unusable afterwards, because they were write protected and I could not format them in Ubuntu or Windows. I tried fdisk, gparted. No dice.
What helped was inserting the stick (make sure this is the only USB drive inserted), finding out where it is mounted:

df -Th

That will show you a list of devices/partitions and their mount paths/points: udev devtmpfs 7,8G 0 7,8G 0% /dev ... /dev/sdb1 vfat 7,5G 4,0K 7,5G 1% /media/<USER_NAME>/<STICK_NAME_OR_ID>

Find your USB stick and remember its partition device path (here: /dev/sdb1) and mount point (here: /media/USER_NAME/STICK_NAME_OR_ID). Then unmount it:

sudo umount /media/USER_NAME/STICK_NAME_OR_ID

Now recreate the file system (FAT32 in this case):

sudo mkfs.msdos -F 32 /dev/sdb1

Wait a short time and unplug the stick. Wait again and plug it in. It should be writable now...

Related Question