Linux usb file system read only one

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 
adam@Home:~$ sudo mount /dev/sdi ~/usb mount: /dev/sdi is write-protected, mounting read-only 
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 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 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. 

Источник

Читайте также:  Enable sound in linux

Fix read only file system usb [closed]

Questions describing a problem that can’t be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers.

sudo fdisk -l Device Boot Start End Sectors Size Id Type /dev/sdc1 * 2048 7864319 7862272 3.8G b W95 FAT32 
sudo mkfs.fat -F 32 /dev/sdc1 mkfs.fat 3.0.28 (2015-05-16) mkfs.fat: unable to open /dev/sdc1: Read-only file system 

How can I fix this? PS: Let’s assume the USB is not write-protected by design, such as with a manual switch.

The command mount (probably as root) is the one to use to change mounted filesystem state, not mkfs .

Is this a sandisk usb? Some have a hardware ‘safety lock’ that locks the usb to read-only in the event of a usb power fluctuation. I had one that did this and had to be returned, though they replaced it FOC.

Is it plugged into a USB 3.0 socket (the blue kind)? I have a 4 GB flash drive that mounts as read-only when connected to USB 3.0, but I can write to it when I use the older USB sockets on the same computer (running Xubuntu 16.04).

we have same distro but unfortunately my laptop does not have any USB 2.0 socket.I will try it on another laptop .Thanks

1 Answer 1

  1. Make sure you are performing filesystem management actions with escalated privileges. Most systems do not let users modify filesystems.
  2. Ensure the device isn’t already mounted. As root, execute lsblk and look for any filesystems using /dev/sdc1 . If it is mounted you will have to unmount prior to formatting with mkfs.
  3. Make sure the device is not a read-only UFD. Though uncommon, these do exist . usually as hand-outs from vendor booths with product sheets or other vendor info on them.

Quick walkthrough of steps

  1. Verify you are performing all tasks as root. Best way is to simply open a shell as root: In a terminal, execute sudo -i is usually the easiest way.
  2. Unmount the device with umount /dev/sdc1 (may give error info if it is not mounted, no worries if this happens)

VVV WARNING THIS WILL DESTROY ALL DATA ON THE DEVICE VVV

  1. Format the device mkfs.vfat /dev/sdc1 (you can force 32bit size if you wish, but mkfs will select whatever fits best for the size of the volume)
Читайте также:  Linux which device is this file on

If this does not work, you may want to wipe the device, recreate the partition with fdisk, and try again:

Again, this will destroy any remaining data. You have been warned.

Источник

Read Only usb stick that won’t let me do anything to it

Somehow I messed up and accidentally made my usb stick into a read only file system. I have tried a bunch of things to delete the files, including the basic ( rm -f myfile ) and attempting to allow writing ( sudo chmod +w myfile ) and then deleting, but none of this seems to work. Any ideas on what I can do. I don’t have anything on the usb stick that I need, but I don’t want to throw away an otherwise perfectly good piece of equipment. How can I make it work? Am I going about this completely the wrong way?

The following link and links from it with more details may help you or at least explain what is the problem, askubuntu.com/questions/402236/…

5 Answers 5

Commands like rm and chmod are done on a mounted file-system. So if the file-system is read only those do not work. What you need to do is to mount the file-system as writeable.

Some USB sticks have a switch on the stick to mount them read-only. Maybe that is the reason. It could also just be broken or damaged due to not correctly umounting it.

Before you do anything: copy the files over from the stick.

If it is not a hardware switch unplug and plug the USB stick and issue a

This will show you any panic messages. If you are seeing alot of them related to the USB stick and if it is a FAT partition you can use dosfsck to fix it.

You can find out how it is mounted with

to fix an MS-DOS partition table or sudo mkfs.vfat /dev/sd to format the disc. Where is a letter and digit you got with the mount command.

You can also use gparted to format it by the way.

Источник

USB devices showing as read only

I am using Ubuntu 14.04. I have an 8gb FAT32 USB stick and a 500gb FAT32 HDD; both of these have suddenly become read only devices. I’ve tried deleting the directory inside /media and then creating it again, renaming it, then giving that directory full permissions. However, this didn’t work. Results of mount :

$ mount /dev/sda5 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/cgroup type tmpfs (rw) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) none on /sys/fs/pstore type pstore (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=simon) 
Model: ATA ST9500325AS (scsi) Disk /dev/sda: 500GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 4 1049kB 500GB 500GB extended 5 2097kB 496GB 496GB logical ext4 6 496GB 500GB 4238MB logical linux-swap(v1) Model: Verbatim STORE N GO (scsi) Disk /dev/sdb: 8028MB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 24.6kB 8028MB 8028MB primary fat32 boot 
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 461.8G 0 part / └─sda6 8:6 0 4G 0 part [SWAP] sdb 8:16 1 7.5G 0 disk └─sdb1 8:17 1 7.5G 0 part /media/simon/LYDIA sr0 11:0 1 1024M 0 rom 
$ cd /media/simon/LYDIA $ touch newfile001 touch: cannot touch ‘newfile001’: Read-only file system 
[ 159.366772] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 159.383252] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.383258] FAT-fs (sdb1): Filesystem has been set read-only [ 159.383571] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.384251] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.384319] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.475111] systemd-hostnamed[2966]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname! [ 159.480141] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.480224] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.480497] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 159.480516] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 0) [ 2893.091767] wlan0: deauthenticating from c0:3e:0f:31:21:05 by local choice (reason=3) 

Источник

Оцените статью
Adblock
detector