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 04-16-2007, 12:39 PM   #1
Shay
Member
 
Registered: Sep 2003
Posts: 77

Rep: Reputation: 15
chown problems Edit: Whoa! bizarre


As per instructions in another post, I changed the ownership of files copied to my home directory with:
chown -R shay:100 /home/shay/

Worked fine.

Copied some more files, tried this again and have really messed something up.

I have lost permission to write in my Documents directory. Every file with an extension in my entire home directory has been moved to a previously non-existent "bones" directory. Just thrown in there all together, without folders. Very strange. Other users are fine.

Suppose it's unfixable Any ideas what happened?

-Shay

Last edited by Shay; 04-16-2007 at 12:57 PM.
 
Old 04-16-2007, 01:19 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Output of ls -al on the affected directories would help us to see what is up..

Usually when I chown files I do a chown -R shay:shay /home/shay/
Not sure why they had you assign home directory group permissions to group 100.
100 must be the users group ?

Regardless of who now owns those files root should be able to re-assign permissions to them.
 
Old 04-16-2007, 01:25 PM   #3
Shay
Member
 
Registered: Sep 2003
Posts: 77

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by farslayer
Output of ls -al on the affected directories would help us to see what is up..
Here's one:
ls
(nothing)

ls -al
total 8
drwxr-xr-x 2 shay users 4096 2007-04-16 11:58 .
drwxr-xr-x 44 shay users 4096 2007-04-16 11:58 ..

I thought the files were still there, but I was wrong. As I put in my edit, they were all moved to a single directory.

Thanks
-Shay
 
Old 04-16-2007, 01:37 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Nothing chown does would move files to another directory. What else have you done with the system? (not implying you did this, but that it might be the side effect of another process)
 
Old 04-16-2007, 01:37 PM   #5
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
that's the listing for an empty directory..
it only lists
.
..
but no files..

Got anything else ? listing for the mysterious bones directory perhaps ?
 
Old 04-16-2007, 01:41 PM   #6
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
You are leaving out some steps you did.

But yes, if all your documents is now in the bones directory you will want to work from there to restore them.

User config files tends to reside in ~ (/home/<user>/) as dot (.) files or dot directories.

you want to ensure you still have those:

so ls -al ~

The -a switch shows all files (even the hidden dot ones).

There are things you could do, but probably best to assume the structure is lost, and just create a new one.

Whenever you see -R or -r in a command you need to pause, that is generally a recursion call, if you get the next bit just slightly wrong it will end up affecting everything down the tree from that point.

Often you are better off changing things without recursion first, then move to recursion when you get fed up of doing things over and over, by that time you will have a better understanding of the implications and the workings.
 
Old 04-16-2007, 01:58 PM   #7
Shay
Member
 
Registered: Sep 2003
Posts: 77

Original Poster
Rep: Reputation: 15
Thanks all. I cannot remember having done anything else, and this is < hour ago. I did restart my system, made a new user and tried copying some files to the new user (with Mepis assistant), Started up Konq and looked around. That's it afair. I certainly never typed the word 'Bones'.

Strangest to me is that only files with periods somewhere in their names (files with extensions, hidden files) were moved. Everything is there, so I'm going to move it all to another user and delete my home directory. Config files are there and I appear to have proper permission and ownership of all files.

I do need to be more careful in the future. My music folders weren't backed up and will be far to much of a PITA to rebuild. Everything else is backed up to another drive.

What are these "things I could do", Zention? Worth a try, I think.

-Shay
 
Old 04-16-2007, 02:04 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Taking a look at your .bash_history file might help you remember anything you might have done (that can be sorted out). You'd need a weird command to accomplish what has happened, something like:
Code:
find ~ -name '*.*' -exec mv {} Bones \;
 
Old 04-16-2007, 02:31 PM   #9
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
The other things revolve around harddrive recovery of deleted files and tables of inodes.

I don't do it often enough to give you explicit instructions on recovery, I would have to wade into the nuance of it. It would not be guaranteed as files have been moved, and probably take longer.

It sounds like you moved something, in which case the inode tends to get remapped, so it may also be a hiding to nothing.

But if you wish to go down that road:

http://www.linuxquestions.org/linux/..._Recovery_Tips
http://www.ibiblio.org/pub/Linux/doc...ndeletion.html

There is a few good ones on the web, but I am starting to suspect people are migrating to companies and taking down their info

I will have to write an article myself at some point so I have a good reference for it, it comes up every now and again, but it is still sort of voodoo stuff.
 
Old 04-16-2007, 02:34 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Did you maybe use a GUI utility to change your username by mistake. Maybe you are looking in the wrong home directory. Where is this bones directory? If it is /home/bones, then this may be the case.

Quote:
Originally Posted by farslayer
Usually when I chown files I do a chown -R shay:shay /home/shay/
Some distros like Mandriva set up a group by the same name as the user when you create a new user. Others, such as SuSE do not. I created such a group manually and made it my default group.
Using "chown -R shay:users /home/shay/" would be a better way of doing it to prevent mistakes in remembering GID numbers.

Were you working on files in your home directory as root? It wouldn't be possible to move files to a system directory by mistake if you work as a regular user.

If they do exist somewhere, you might try using the find command to locate them.
For example: "find /home -ctime -2" will locate files created (or moved) in the /home directory in the last two days.

Last edited by jschiwal; 04-16-2007 at 02:43 PM.
 
  


Reply



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
chown lsu420luv Linux - Newbie 3 04-18-2006 05:08 PM
chown loopoo Linux - Newbie 5 08-09-2005 09:38 AM
problems with chown and chgrp apax Linux - Software 6 11-03-2003 03:44 PM
chown problems phantom0810 Linux - General 11 04-26-2003 12:04 PM
chown Sathe Linux - General 13 10-14-2002 11:25 AM

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

All times are GMT -5. The time now is 02:01 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