Folder reading error

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BrianGP

Folder reading error

Post by BrianGP »

I obviously did something that I have no idea as to how to remedy. I am running LM 17 with MATE on a dual boot system. It goes like this:

After rebooting I can log into a users desktop <mine or someone else's, it doesn't seem to matter>, I can go to the file manager and access all the files just fine to include the OS folder of the NTFS partition and go to any Windows User files. Everything works fine until I logoff and go to another user desktop. Now after, I can go to the user's desktop I can select their their home file system and browse the files just fine, but if I were to select the OS folder it provides an error messag: Could not display "/media/<user name of original user to use the desktop after rebooting>/OSThe location is not a folder". Now if I were to reboot, and login, say to any other user, I would find the same condition if I were to access another persons desktop and who ever was the first one to log in after the reboot, theirs become the new path in the error message display.

I know this is rather convoluted, but as an inexperienced, somewhat of a newbie, user, I am not sure what to do. I would appreciate any help.

Repectfully,
BrianGP
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Kalyk
Level 5
Level 5
Posts: 769
Joined: Wed Mar 12, 2014 5:29 pm
Location: The Netherlands

Re: Folder reading error

Post by Kalyk »

Hello and welcome to this forum!!

When you login and go to your file manager you have the possibility to click on an NTFS device that isn't opened yet.
You have the privilege to open that device and it mounts it under your user account.
It sounds like the device is not dismounted when you logoff.
When you then login under another user and try to open the device Linux sees it's mounted already and tries to use it.
But as it is mounted under the other user it doesn't have any privileges and you get an error.

To solve it you can first try dismounting it before you logoff, this would probably work.
If you want any user to be able to use it then you should have the system mount it at boot, for example by using /etc/fstab.
There are quite a few examples in this forum which describe how to use fstab.

By the way: when you logout then the right behaviour would be to dismount the NTFS partition, but if you choose to switch user then the right behaviour is that the first user keeps the partition mounted.
Add (Solved) to the topic-title of the first post when appropriate so others know they might find a solution here.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Folder reading error

Post by Flemur »

To solve it you can first try dismounting it before you logoff, this would probably work.
If you want any user to be able to use it then you should have the system mount it at boot, for example by using /etc/fstab.


Here's an example /etc/fstab line:

LABEL=NTFS /mnt/NTFS ntfs-3g user,windows_names 0 0

LABEL=a value you give it="NTFS" (or use UUID=funky_number)
/mnt/NTFS=a directory you made and users can access:
$ sudo mkdir /mnt/NTFS
$ sudo chmod a+w /mnt/NTFS


"user" (in fstab line) = user(s) can access the partition CHECK WHETHER ITS "user" or "users" for more than one login (IIRC, it's backward of the way it sounds).
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Folder reading error

Post by altair4 »

LABEL=NTFS /mnt/NTFS ntfs-3g user,windows_names 0 0
...
"user" (in fstab line) = user(s) can access the partition CHECK WHETHER ITS "user" or "users" for more than one login (IIRC, it's backward of the way it sounds).
"user" in fstab allows an ordinary user ( i.e., not root ) to mount the partition but only after it has been unmounted by whoever has mounted it. The "user" option by itself has nothing to do the ability of that user to actually access the partition. That is determined by other options in the mount statement or what has been determined as the default mounting options for that filesystem.

Since fstab is executed by root at boot time the "user" option will do absolutely nothing - unless the "noauto" option is used in which case it won't be auto mounted at all.

The "users" option allows anyone to unmount the partition but again has nothing to do with the ability of any user to actually access the partition. And besides why would you want to allow any user to unmount the partition.

And changing permissions on the mount point for any filesystem will have no affect on the permissions after the mount. And changing permissions on a mounted ntfs partition after the mount will have no affect at all.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BrianGP

Re: Folder reading error [SOLVED]

Post by BrianGP »

Thank you all so much for providing this quick and insightful help in solving this problem. Definitely, dismounting the device prior to logging off cured the problem when accessing it from a standard user account. Kalyk, though I haven't been through all the FSTAB possibilities, my first option will be to apply the FSTAB statements you have provided Flemur, and will be keeping in mind the nuances of its application of "user" verses "users", altair4.

I appreciate all of your wisdom and understanding of Linux. It makes me want to deepen my own understanding of this great OS.

Respectfully,
BrianGP
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Folder reading error

Post by Flemur »

Since fstab is executed by root at boot time the "user" option will do absolutely nothing - unless the "noauto" option is used in which case it won't be auto mounted at all.

"noauto" was originally in my fstab line - so users could mount it - but I removed "noauto" for this post. But thanks for the clearing-up!
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Locked

Return to “MATE”