1833806 Members
3155 Online
110063 Solutions
New Discussion

Re: lost files

 
SOLVED
Go to solution
Gerald Virden
Advisor

lost files

I have a system where for some reason there was a login set up twice, one with ID 801 and one with ID 258. ID 801 was the current valid ID so I went through the system and every file I found with ID 258, I performed a chown to 801. I then removed the login for ID 258. However, about a week later, some files were missing and we tracked it to files owned by this user (I don't know which ID). The old ID has not been reused so any files associated with ID 258 have not been assigned to anyone else. Would this situation cause files to disappear?
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: lost files

Doing a chown could not cause files to be removed. The only thing that I can think of is that if you used SAM to remove the login, it has an option to also delete files. You might have missed a few files with your chown but SAM used a find command and found the ones that you missed. That's my best guess.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor
Solution

Re: lost files

Hi Gerald:

Removing an account from '/etc/passwd' does not, per se, cause files to disappear.

You might want to search your system for files not owned by any current users (i.e with IDs not defined in the passwd database:

# find / -nouser

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: lost files

Hi Gerald,

One of the options you can select when removing a user is
"Remove all files owned by this user?"
If you selected this option then that could account for the missing files.
May have to restore from backup to retrieve if this was the case.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Gerald Virden
Advisor

Re: lost files

I did not do any of this through SAM. I performed the chown then removed the line entry from the password file.
Rodney Hills
Honored Contributor

Re: lost files

Gerald,

Using "chown" will not directly remove files. But... If you had a cron job that attempted to "cd" to a folder owned by the old ID number and now the uid is different, then the "cd" might fail and unforseen events may occur.

A long time ago, I had a clean up script where it would "cd" to a folder and then start removing files. The script assumed the "cd" always would work. One day permissions changed on the folder and the "cd" failed. The script then started removing folders and files that I hadn't planned for it to do. I now never assume a "cd" will always work and have modified my scripts accordingly.

My 2 cents...

-- Rod Hills
There be dragons...