SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Hello. I keep my mp3 files in a separate directory to make it easier to copy them the our USB car drive as needed. The directory I store them is is quaintly named mp3/ This directory is located at /otherstuff/othermp3/mp3/. I did this because there are a LOT of directories and I ran out of space on my /home partition pretty quickly. I had to move it into root space. Root space occupies most of the 1TB drive.
Code:
root@caitlyn:/otherstuff/othermp3/mp3# ls -l
total 715132
-rw-r--r-- 1 michael users 6164026 Jun 5 2017 01-03-\ 1985.mp3
-rw-r--r-- 1 michael users 8040113 Jun 5 2017 01-05-\ 1985\ (Original\ Version)\ [Explicit].mp3
-rw-r--r-- 1 michael users 8372335 Jun 5 2017 01-07-\ Troll\ Doll\ Celebrities\ (Stand\ Up).mp3
-rw-r--r-- 1 michael users 9505644 Jun 5 2017 01-13-\ Troll\ Doll\ Jingles\ Medley\ (Stand\ Up).mp3
-rw-r--r-- 1 michael users 1943528 Jun 5 2017 01-14-\ Spider\ Pig.mp3
-rw-r--r-- 1 michael users 3886783 Jun 5 2017 01\ -\ A\ Mhaire\ Bhruinneall.mp3
-rw-r--r-- 1 michael users 5080418 Oct 24 2017 01\ -\ Angel\ Eyes.mp3
-rw-r--r-- 1 michael users 4440240 Jun 5 2017 01\ -\ Blitzkreig\ Bop\ (Remastered\ Version\ ).mp3
-rw-r--r-- 1 michael users 8134189 Jun 5 2017 01\ -\ Come\ To\ The\ Dance.mp3
-rw-r--r-- 1 michael users 7218199 Jun 5 2017 01\ -\ Don't\ Stop\ Believin'.mp3
-rw-r--r-- 1 michael users 5024770 Jun 5 2017 01\ -\ Drunken\ Sailor.mp3
-rw-r--r-- 1 michael users 5881809 Nov 14 2017 01\ -\ Everything\ Is\ Awesome!!!\ (Feat.\ The\ Lonely\ Island).mp3
-rw-r--r-- 1 michael users 8374521 Jun 5 2017 01\ -\ Half-Truism.mp3
-rw------- 1 michael users 7732591 Jun 5 2017 01\ -\ Helluva\ Life.mp3
-rw-r--r-- 1 michael users 4727801 Jun 5 2017 01\ -\ If\ I\ Should\ Fall\ From\ Grace\ With\ God.mp3
-rw-r--r-- 1 michael users 7420507 Jun 5 2017 01\ -\ I'm\ Gonna\ Be\ (500\ Miles).mp3
-rw-r--r-- 1 michael users 8466999 Feb 18 22:15 01\ -\ Mo\ Ghile\ Mear.mp3
-rw-r--r-- 1 michael users 6837289 Jun 5 2017 01\ -\ Paddy's\ Green\ Shamrock\ Shore.mp3
-rw-r--r-- 1 michael users 5947296 Jun 5 2017 01\ -\ Sir\ Isaac\ Newton\ vs\ Bill\ Nye.mp3
-rw-r--r-- 1 michael users 7379315 Jun 5 2017 01\ -\ Things\ That\ Stop\ You\ Dreaming\ [Explicit].mp3
-rw-r--r-- 1 michael users 9919188 Jun 5 2017 01\ -\ While\ My\ Guitar\ Gently\ Weeps.mp3
NOTE This is just a few of the files in mp3/ The above listing was gathered from the root account. However, when I ask for the same listing from my user account, I see:
Code:
michael@caitlyn othermp3 $ ls -l mp3/total 0
-????????? ? ? ? ? ? 01-03- 1985.mp3
-????????? ? ? ? ? ? 01-05- 1985 (Original Version) [Explicit].mp3
-????????? ? ? ? ? ? 01-07- Troll Doll Celebrities (Stand Up).mp3
-????????? ? ? ? ? ? 01-13- Troll Doll Jingles Medley (Stand Up).mp3
-????????? ? ? ? ? ? 01-14- Spider Pig.mp3
-????????? ? ? ? ? ? 01 - A Mhaire Bhruinneall.mp3
-????????? ? ? ? ? ? 01 - Angel Eyes.mp3
-????????? ? ? ? ? ? 01 - Blitzkreig Bop (Remastered Version ).mp3
-????????? ? ? ? ? ? 01 - Come To The Dance.mp3
-????????? ? ? ? ? ? 01 - Don't Stop Believin'.mp3
-????????? ? ? ? ? ? 01 - Drunken Sailor.mp3
-????????? ? ? ? ? ? 01 - Everything Is Awesome!!! (Feat. The Lonely Island).mp3
-????????? ? ? ? ? ? 01 - Half-Truism.mp3
-????????? ? ? ? ? ? 01 - Helluva Life.mp3
-????????? ? ? ? ? ? 01 - If I Should Fall From Grace With God.mp3
-????????? ? ? ? ? ? 01 - I'm Gonna Be (500 Miles).mp3
-????????? ? ? ? ? ? 01 - Mo Ghile Mear.mp3
-????????? ? ? ? ? ? 01 - Paddy's Green Shamrock Shore.mp3
-????????? ? ? ? ? ? 01 - Sir Isaac Newton vs Bill Nye.mp3
-????????? ? ? ? ? ? 01 - Things That Stop You Dreaming [Explicit].mp3
-????????? ? ? ? ? ? 01 - While My Guitar Gently Weeps.mp3
Can anybody tell me why? I have soft links to all these files in /home/michael/mp3. They all LOOK legitimate, but they all return error code 22. I looked up error code 22 tonight, and it means invalid command. It's obvious to me that some package has gone wrong, but which one? If necessary I can send you any other information you need from me in order to solve this. Thank you in advance for any assistance you can offer in resolution of this issue.
Probably, the permissions of the parent directory do not have the traverse, 'x', attribute set for the user.
What does this say?
Code:
ls -ld /otherstuff/othermp3/mp3
To fix it...
Code:
chmod +x /otherstuff/othermp3/mp3
For files the 'x' attribute is 'execute' and is used to make the file executable, oddly enough.
But for directories 'x' means 'traverse' and allows the relevant users to traverse the directory boundary. Having read permission lets you see the file names which are directory meta data, but you cannot traverse the directory to read the file meta-data or attributes, hence the ???'s.
You should first of all do some fsck on your file. This can be indication is corrupted. Provide all information: partition layout, file system, mounts. You were working as root via login or via su command? Suspend all activities go to runlevel 1. You can try to use mc and see what output is. Be sure that ls really points to /usr/bin/ls. Reinstall coreutils package. I don't understand why there is no backslashes in outptut. Create another user. Just plain. As this another user try access these files. List all configuration files in home directory. What is in .bashrc file? There are some strange file in your home directory? Try to list with full path. What tool have you used to create links?
So you are trying to tell me OP created directory in $HOME with -x permission? It is not possible. For file creation there system wide defaults. Only explicitly issuing command chmod -x on directory can change that. So something is broken. What @astrogeek propose perhaps is a solution but it does not explain why such situation appeared. I might add do all test on your hard drive to verify its health.
Ok I re-read first post more carefully again. I don't know how it was done but for me it seem OP copied files as root - then changing ownership. But no-matter directories owned by root are still readable - say /usr/bin. So how it looks like
Code:
$ ls -ld /otherstuff
$ ls -ld /otherstuff/othermp3
Besides you can as well use different home directory. It is only agreement to put user home directory under /home. Change home directory temporary say under /usr/local move you files there and resize /home. Then switch back. Or create additional user in system: say user mp3, group mp3 with nologin option to have access to your mp3 via group membership. And put home directory for this user say at /usr/local. You won't be messing with /. There are other possibilities. You can set locally http server to have access to your mp3.
The files aren't in /home. You're not reading his post properly, they were copied/moved elsewhere when he ran out of space in /home.
OP didn't state how that was done, so we can only guess, but the directory permissions may well have been lost in that process: maybe he accidentally set umask 333 instead of 222, we simply don't know.
I don't know what the user has done, nor do I care. What is important is the current state, and to work the problem.
Given that I know from experience a missing 'x' permission on a directory would present exactly like this, astrogeek's suggestion to check and rule that out is the most obvious first step. As stated by OP, root can clearly list the files properly which supports the likelihood of a permissions issue on the directory and also makes it less likely to be filesystem corruption.
Once the simple things are ruled out one can move onto the more exotic potential causes. No need to over-complicate things right at the start. If I were a beginner your post asking about everything and the kitchen sink would have had me running for the hills.
$ sudo chmod 775 /media/data -R
$ ls -la /media/data
total 28
drwxrwxr-x 4 root root 4096 Feb 27 17:03 .
drwxr-xr-x 20 root root 4096 Feb 26 03:48 ..
drwxrwxr-x 2 userx users 4096 Feb 27 17:06 Favorites
drwxrwxr-x 2 userx users 16384 Feb 27 08:17 lost+found
here are two bash functions I wrote to deal with links, you can mod them to work with your data types. just put them into a script and make them work. easy enough to figure out, yes/No?
Code:
deleteDeadLinks()
{
echo "Deleting dead Links..."
#Delete any dead links to files
[[ -d "$localEterm" ]] &&
# here if total links are too great, I fixed it by just cd into dir where
#links are kept then delete the bad ones.
{ cd /usr/local/share/Eterm/pix/scale ;
#sudo find . -xtype l -delete ;}
#for FreeBSD
#sudo find -L . \( -lname "*.jpg" -o -lname "*.png" \) -exec rm -v {} \; ;}
#finds bad links in current dir
find -L . \( -lname "*.jpg" -o -lname "*.png" \) -print0 | xargs -0 sudo rm -v ;}
[[ -d "$usrEterm" ]] && { cd /usr/share/Eterm/pix/scale ;
#sudo find . -xtype l -delete ; }
#for FreeBSD
#sudo find -L . \( -lname "*.jpg" -o -lname "*.png" \) -exec rm -v {} \; ;}
find -L . \( -lname "*.jpg" -o -lname "*.png" \) -print0 | xargs -0 sudo rm -v ;}
echo "Done deleting dead links.."
exitCode=$?
}
linkImages()
{
#soft link images into Eterms pix scale dir
echo "Linking Images ..."
while IFS= read -r var
do
file=$(basename "$var")
if [[ -d "$localEterm" ]] ; then
[[ ! -L "$localEterm"/pix/scale/$file ]] &&
{ sudo ln -sn "$var" "$localEterm"/pix/scale ;
echo "HEY "$localEterm"/pix/scale/$file" ; }
elif [[ -d "$usrEterm" ]] ; then
[[ ! -L "$usrEterm"/pix/scale/$file ]] &&
{ sudo ln -sn "$var" "$usrEterm"/pix/scale ;
echo "HEY2 "$usrEterm"/pix/scale/$file" ; }
else
{
echo "I have no Idea where Eterm is, exiting ..."
exit
}
fi
done < <(find "$finalDestanation" \( -type f -name "*png" -o -type f -name "*.jpg" \) )
echo "Done Linking Images..."
}
I don't know what the user has done, nor do I care. What is important is the current state, and to work the problem.
The action of OP was not as user but as root. So you should care. Now OP will be acting as root again so carelessness may cost quite a high price. So it is important to find why this happened.
It is not clear for me does the situation appeared recently - I mean earlier everything was ok but today something happened and OP can't any more read files. This was my first claim. That's why I proposed to verify hard drive and file system. I thought that say yesterday OP can list these mp3 files but today can't. The other scenario is just after OP created directory and copied files into it (as root) it appeared it can't list them. In the first scenario is reasonable presume something wrong with hard drive or/and file system. In the second the first is what was the command used to copy these files. We can have a look into command history. If it was say mc used: I don't know why this happened. The command umask is used to set default file creation permission. Perhaps other tool were used which actually changed umask value recognizing is used by root. Kind of overprotective. I don't know. Perhaps OP allow root to use desktop - and kind of drag and drop action inside file manager. I think desktop file managers are not well suited if at all to work on root account. Some of them issue warnings other work silently. And who knows what's going on under the hood. This is essentially my point view. Oh and one more thing just came to my mind: different file systems on home partition and system partition. Perhaps not all file attributes can be transferred between them. Just guess only.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.