LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-12-2020, 01:36 PM   #1
cad-guy
Member
 
Registered: May 2012
Posts: 37

Rep: Reputation: Disabled
File permissions can't be changed with chmod


Hello;
I would like to ask for advice on a file permissions problem using Parrot-Linux. I've had various issues with access because the OS runs on an SSD and my data is on a separate spinning disk drive. Because of the situation, I've learned more about chown/chmod. When that didn't solve the problem, a very skilled friend suggested the following:

sudo mount -o remount,rw '/media/username/882D-54D6'
Go to Disk Utility and unmount the disk. Then click on Check Filesystem if there are no problems remount the disk. After mounting the disk it should work correctly.

Recently I've found that a documents folder cannot be edited. I tried all of the above options and still cannot get access. Here is a segment of current permissions with ls -l
-rw-r--r-- 1 bikejunkie bikejunkie 98 Jun 3 2012 chinese.txt
drwxr-xr-x 3 bikejunkie bikejunkie 32768 May 27 13:30 Computer-linux
-rw-r--r-- 1 bikejunkie bikejunkie 720 May 15 2019 computer.txt
-rw-r--r-- 1 bikejunkie bikejunkie 1649664 Jan 4 2005 Consciousness-lecture.doc
-rw-r--r-- 1 bikejunkie bikejunkie 1378 Jun 21 2015 conversions.txt
-rw-r--r-- 1 bikejunkie bikejunkie 28960 Apr 6 2013 couv2couv-journal.odt
drwxr-xr-x 2 bikejunkie bikejunkie 32768 Jun 5 23:30 current-events

If you have ideas I would appreciate, if there is a particular term or method that I can research to learn more, that would also be great.
 
Old 06-12-2020, 06:50 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Since directories can't be edited in principle, "a documents folder cannot be edited" is expected behaviour.
Can you share what exactly you are trying to do? Which command(s) are you running, how do they fail?
Are you running the command(s) under the bikejunkie identity?
What filesystem type is /media/username/882D-54D6?
 
Old 06-12-2020, 08:22 PM   #3
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
If you are working as root (su or sudo) then directory permissions and ownership are definitely editable. So, as asked, are you using the commands as root? And I assume that the removable drive is one of the Linux file systems, not a Windows file system.
 
Old 06-12-2020, 08:32 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by agillator View Post
And I assume that the removable drive is one of the Linux file systems, not a Windows file system.
The name indicates Windows.
 
Old 06-12-2020, 09:44 PM   #5
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
berndbausch, you are correct. The first thing I do when I buy a new removable drive is wipe it and put a new file system on it. I also label my file systems for ease of referring to them and identifying them. I thought that if I did not provide a label the label would remain the same, but you know what Thought did (he just thought he did). I was thinking I had actually done that but obviously I was wrong . . . again. I just tested one and . . . you are correct.
 
Old 06-14-2020, 09:34 PM   #6
cad-guy
Member
 
Registered: May 2012
Posts: 37

Original Poster
Rep: Reputation: Disabled
Hello and thank you so far for the replies

"Since directories can't be edited in principle, "a documents folder cannot be edited" is expected behaviour.
Can you share what exactly you are trying to do? Which command(s) are you running, how do they fail?
Are you running the command(s) under the bikejunkie identity?
What filesystem type is /media/username/882D-54D6?"

I only showed the directory tree from higher up so the files and folders could both be viewed. But the error that I had was from within the lowest folder (only the files w/ no directories). What I have been trying to do is open a .odt file with LibreOffice. I'm enclosing a screenshot of that as well if it makes things more clear.
The filesystem for 882D-54D6 is FAT32 (I use this drive with both linux and with certain windows programs.

"Can you share what exactly you are trying to do? Which command(s) are you running, how do they fail?
Are you running the command(s) under the bikejunkie identity?
What filesystem type is /media/username/882D-54D6?"

At first I was simply trying to open the file in LibreOffice which worked fine dozens of times before. But periodically this drive has had file permission issues which is why I learned chmod/chown. When the failure happened, I went into terminal and used 'sudo chmod 777 filename' there was no error in the terminal, but LibreOffice wouldn't open.

I just performed the command again and LibreOffice finally did open it.
Thank you
I would call this issue resolved, except that the file still reads '-rw-r--r--' as do all of the other files. I did 'sudo chmod -R 777 foldername' and this did not change the permissions state of the files within the folder.
Is it possible that these permission errors are due to the FAT32 system?
Attached Thumbnails
Click image for larger version

Name:	tmp-file-permission.png
Views:	20
Size:	31.8 KB
ID:	33411  
 
Old 06-14-2020, 10:07 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
FAT32 (and the other types of FAT, including exFAT) doesn't have the notion of owner or file permissions. For this reason, chmod has no effect.

Your computer probably uses the vfat filesystem module (I am 99% certain). In this case, you can change both ownership and permissions at mount time. See the Linuxquestions wiki page on vfat, or search the internet for details. If you mounted that drive via the GUI, or it was mounted automatically, I can't advise you, but I am sure there are solutions.

Last edited by berndbausch; 06-14-2020 at 10:08 PM.
 
1 members found this post helpful.
Old 06-14-2020, 11:33 PM   #8
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by berndbausch View Post
If you mounted that drive via the GUI, or it was mounted automatically, I can't advise you, but I am sure there are solutions.
Use, from the commandline. as root, the "remount" option with the right permissions.
Quote:
remount
Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writable. It does not change device or mount point.

The remount functionality follows the standard way how the mount command works with options from fstab. It means the mount command doesn't read fstab (or mtab) only when a device and dir are fully specified.
 
Old 06-15-2020, 12:47 AM   #9
Roken
Member
 
Registered: Oct 2011
Location: Warrington, UK
Distribution: Arch local, Debian on VPS, several RPIs.
Posts: 300
Blog Entries: 1

Rep: Reputation: 55
Have you also played with chattr and possibly set the immutable bit on any of those files?

To test, on any one of them, try:

Code:
 sudo chattr -i filename
 
  


Reply

Tags
permissions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chmod: changing permissions of `/usr../bin': Read-only file File System Issue cdhar Linux - Newbie 3 12-31-2012 06:17 AM
[SOLVED] What's the difference between chmod 0755 file and chmod 755 file? cola Linux - Newbie 6 04-19-2010 04:29 PM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration