0

I'm using Ubuntu 16, and my 64 GB sandisk ultra pen drive is in read-only mode. I need to modify the files on the pen drive.

How do I change the permissions so that I have write/delete access?

/proc/mounts has the following entry for this pen drive:

/dev/sdb1 /media/ashgan/54E5-2AC5 vfat ro,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0

I was able to modify these files in the previous computer where I used this pen drive and earlier in the present computer also, but permissions seem to have changed somehow.

Amanda
  • 9,333
ub2016
  • 1

1 Answers1

0

Your drive is mounted read only (as indicated by the ro in the /proc/mounts output. You could try to remount it with read-write permissions:

mount -o remount,rw /dev/sdb1 /media/ashgan/54E5-2AC5

(sudo might be required here)

I expect that this will present some error, which likely is the root cause why your pendrive was not mounted rw from the beginning

mbeyss
  • 978
  • It works temporarily, but then reverts back to read only mode, and I have to type this command again. – ub2016 Feb 21 '18 at 13:36
  • strange. Could you have insert the flashdrive and then have a look at /var/log/syslog it should report everything from the discovery of the device to the final mount. Any error there? – mbeyss Feb 21 '18 at 13:46
  • the /var/log/syslog file has the following tail entries: Feb 21 19:09:24 ashgan-Latitude-E7440 kernel: [ 3278.441175] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 397416600)

    Feb 21 19:12:59 ashgan-Latitude-E7440 kernel: [ 3493.205285] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. ashgan:~$

    – ub2016 Feb 21 '18 at 13:53
  • Ah ... so it seems your drive is corrupted (because it was not properly removed earlier. run fsck on it e.g. sudo dosfsck -w -r -l -a -v -t /dev/sdc1 (taken from https://askubuntu.com/questions/147228/how-to-repair-a-corrupted-fat32-file-system ) – mbeyss Feb 21 '18 at 13:55