[SOLVED] Error Opening File Permission Denied on all 3 drives
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Error Opening File Permission Denied on all 3 drives
After reading this I'm thinking that I need to use the chmod command because I can not access the files from LM when I have Arch Linux up and running and vice versa.
BTW this is not my machine so I have to be careful.
Arch is installed to the 500 GB WD drive, LM KDE is installed to the 128 SSD, & LM Cinnamon to the 120 Hitachi HDD.
Code:
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000688b0
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 246069247 123033600 83 Linux
/dev/sda2 246069248 250068991 1999872 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004454a
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 972771327 486384640 83 Linux
/dev/sdb2 972771328 976771071 1999872 82 Linux swap / Solaris
Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x912f676e
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 230436863 115217408 83 Linux
/dev/sdc2 230436864 234440703 2001920 82 Linux swap / Solaris
There are too many files to chmod a+x one at a time.
Code:
-rw-r--r-- 1 1000 1000 86927645 Oct 14 2014 'CC Applications For Fighting In Tai Chi Pushing Hands Tui Shou In Details 1.mp4'
-rw-r--r-- 1 1000 1000 120896934 Oct 14 2014 'CC Applications For Fighting In Tai Chi Pushing Hands Tui Shou In Details 2.mp4'
-rw-r--r-- 1 1000 1000 154404213 Oct 14 2014 'CC Applications For Fighting In Tai Chi Pushing Pands Tui Shou In Details 3.mp4'
-rw-r--r-- 1 1000 1000 104588632 Oct 14 2014 'CC Applications For Fighting In Tai Chi Pushing Pands Tui Shou In Details 4.mp4'
-rw------- 1 1000 1000 3777505 May 4 2014 'CC Bladder 57 Info.mp4'
-rw-r--r-- 1 1000 1000 163839032 Apr 18 2015 'CCD Feng Zheng Bao Bagua.mp4'
-rw-r--r-- 1 1000 1000 383246496 Apr 18 2015 'CCD Liang Style BaGua Basic Exercises.mp4'
-rw-r--r-- 1 1000 1000 254819595 Apr 18 2015 'CCD Liang Style BaGua Old Eight Mother Palms.mp4'
-::-Before I installed Apricity (based on Arch) I was able to mnt any HDD or SSD and cp and paste to any directory I wanted to.
-::-I'm not sure what changed that.-::-
I know how to chmod on one file at a time but that would take all day and there are many files that have to be copied.
The UID and GID are 1000, you have no matching user in your running Linux, thus you cannot access those files. When running multiple Linux versions or accessing files over NFS I suggest you use same UID for your user in all boxes.
Are the first things I'd use, however for the chmod, you can also use the -R switch to cause it to be recursive.
Per Emerson's point, and why I posted the chmod/chown command examples, I had a similar situation with a LIVE boot USB that had the default user and mounted other flash drives were mounted as root thus making the mounted flash drives read-only to that default user. My solution was to do the first command and change all ownership and grouping of the entire mounted drive. That's a one-time thing unless I changed my LIVE boot system to something else, I usually don't.
The UID and GID are 1000, you have no matching user in your running Linux, thus you cannot access those files. When running multiple Linux versions or accessing files over NFS I suggest you use same UID for your user in all boxes.
^ this
Your user has a different UID/GID on the different systems, and Linux file permissions use UID/GID, not name. Your best bet is to migrate your UID/GID on one of the systems to match the other. You can do this by logging out as your user, logging in as root on a TTY, and running the following:
Code:
usermod -u newID "user"
groupmod -g newID "group"
find / -user oldID -exec chown newID {} \;
find / -group oldID -exec chgrp newID {} \;
Replacing oldID and newID with the ID you're changing from/to respectively.
Last edited by suicidaleggroll; 03-15-2016 at 03:17 PM.
Are the first things I'd use, however for the chmod, you can also use the -R switch to cause it to be recursive.
Per Emerson's point, and why I posted the chmod/chown command examples, I had a similar situation with a LIVE boot USB that had the default user and mounted other flash drives were mounted as root thus making the mounted flash drives read-only to that default user. My solution was to do the first command and change all ownership and grouping of the entire mounted drive. That's a one-time thing unless I changed my LIVE boot system to something else, I usually don't.
Do I need to run those cmd's on all three distro's that have their own HDD's?
Your user has a different UID/GID on the different systems, and Linux file permissions use UID/GID, not name. Your best bet is to migrate your UID/GID on one of the systems to match the other. You can do this by logging out as your user, logging in as root on a TTY, and running the following:
Code:
usermod -u newID "user"
groupmod -g newID "group"
find / -user oldID -exec chown newID {} \;
find / -group oldID -exec chgrp newID {} \;
Replacing oldID and newID with the ID you're changing from/to respectively.
You said to log in as root on a TTY. Do you mean a virtual terminal (console mode only)?
It is not clear to me what the oldID is and how would I arrive or create a name for the newID.
I've used the usermod cmd before but this is new to me.
Will the cmd's that you have advised me to run conflict with the ones that rtmistler has suggested and should I just go with one solution or do I need to perform both to fix the problem?
-::-Remember these 3 distro's are on 3 seperate drives each of their own in this desktop pc and I have to be very careful; it's not my machine.-::-
Yes a text-only console. You need to be COMPLETELY logged out of your regular user, if you run ps -ef you shouldn't see anything related to your normal user, as changing your UID can screw up any active processes.
The oldID is whatever it currently is. You should log into each of the three distros independently, and on each one open a terminal and run "id", then write down the uid and name and gid and name. Once you have this info for all of your distros, pick one the be the master, and change the other(s) to match. Then when you log into a distro, oldID would be whatever it was on the distro, and newID would be what you're changing it to.
chown and chgrp are not a good solution. You'd have to constantly change the permissions of all shared files/dirs back and forth every time you boot a different distro. It's not maintainable. Changing your UID/GID so they're the same on all distros, while a bit more involved, is a permanent solution.
Start by just logging into each distro and writing down your UID/name and GID/name for each of them, then we can go from there.
Start by just logging into each distro and writing down your UID/name and GID/name for each of them, then we can go from there.
I can do that-
Just confirming....I need to run 'id' to get the UID name and the GID name?
Thanks for telling me that running chown and chmod is not the solution.
In this case a permanent solution is what the owner wishes and has faith that I can do it with your help.
I do not want to confuse you, but it can done from running just one Linux installation, the one that has proper access to files.
Find out the UID/GID. Mount the other Linux and edit /etc/passwd and /etc/shadow and /etc/group, replace the IDs with correct ones. Then run chown -R <user>:<group> on home directory of this user. Done. Next time you boot into this Linux installation your user will have access to files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.