4

My old box running ubuntu 9.04 passed away, so I plugged a flash drive into a newer box running ubuntu 16.04.

But, I can't run scripts from there, because all files lost the x-permission. I can copy those files, but I can't chmod them, not even chmod a+w, not even using sudo.

chmod returns with no errors, echo $? shows 0.

It all worked perfectly on 9.04.

Here is what mount says:

/dev/sdd1 on /media/user/LABC type vfat   
 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

I am aware of https://askubuntu.com/a/17550/778232 and I don't think it's a duplicate.

Firstly, with my problem here, not only +x is ignored. Secondly, the file where the answer proposes a change does not exist on my box.

Edit: What I don't understand, if FAT does not support linux-like flags, why did it work with ubuntu 9.04?

Edit2:

Nope, this didn't work. I unmounted the device, created a new directory, mounted it with

mount /dev/sdd1 /media/LABC -o dmask=000,fmask=111

I can see the files, but still cannot chmod or chown (as root user). chown gives "Operation not permitted".

Gyro Gearloose
  • 185
  • 1
  • 2
  • 14
  • @Melebius just what I wrote in the question: it's not only the x flag, but w too, and the answer does not solve the problem because it refers to an non-existing file. Maybe it is close enough to a duplicate that it may be merged. – Gyro Gearloose Apr 02 '19 at 12:29
  • chmod does not work on vfat only on ext or when mounting through fmask and dmask – Rinzwind Apr 02 '19 at 12:30
  • @RoVo Thanks, I will try sudo mount /dev/sdb1 /media/flash -o dmask=000,fmask=111, but currently I'm recovering my update data from another USB drive and don't dare to mess too much with mount as long as it is running. – Gyro Gearloose Apr 02 '19 at 12:31
  • Maybe the following link can help you, [In Linux the mode of NTFS (and FAT32) is determined by the partition's mount options. You cannot change it via chmod.](https://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/956072#956072) – sudodus Apr 04 '19 at 12:09

1 Answers1

1

In my honest experience, If you have a dual boot computer then you're lucky and you can try "Repair this drive" in Windows. This usually fixes my problems.

  • Thank you, but I'm not using "enemy software" ;-) . Further, I don't think the file system is broken. It worked a week ago under 9.04, and two other flash drives behave exactly the same. Very unlikely that all 3 of them should be damaged in exactly the same way. If everything else fails, I will copy the data,format them with a better file system (ext3, for example) and store the data back. – Gyro Gearloose Apr 03 '19 at 13:27
  • @Melebius "Unfortunately, this does not answer the chmod question at all.", yes, but very unfortunately, no one else did or could or did care for an answer. – Gyro Gearloose Jan 06 '21 at 16:00