-------- Original Message -------- Subject: Home directories become owned by root Date: Wed, 04 May 2005 12:32:31 -0700 From: Michael Coxe mcoxe@opsware.com To: toasters@mathworks.com
Hi,
We have a Netapp using shared NFS/CIFS. Yesterday several accounts became owned by root. Users couldn't even cd to their homes via NFS, though from the Windows side all looked OK.
As root from the administration server I couldn't access their directories either. I thought of restoring from .snapshot but those directories (nightly.o, etc) are also onwed by root and are inaccessable from the Unix side.
The only way to allow access was to use SecureShare from the Windows side and change ownership from "root" back to the username.
Files & subdirectories appear to be owned by the user but the Unix permissions are all set to 777, and they can't access these files/directories. I could reset them via SecureShare (and did so for 2 users) but they won't be what the user(s) originally set them to.
Ontap: NetApp Release 6.1.2D1 Filer: F740
Anyone have an idea how I can restore the original ownership & file permissions other that restoring from tape.
-- Michael Coxe, IT mcoxe@opsware.com
Michael,
I pray that by this time, you have fixed your problem!
In the event that you are still wanting to correct lost UNIX permissons (or for in the future), I thought that I would share with the world a simple perl script that I wrote.
This program will take a directory (or directories) and reset the permissions for each found file, based on the file permissions inside of the related snapshot directory.
For instance, if you have:
bash-2.05b# pwd /home/johnk/tmp/netapp bash-2.05b# ls -l total 1264 ---------- 1 root wheel 24 Oct 7 2004 e0_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 e3a-4_20041007_132410.trc ---------- 1 root wheel 1286589 Oct 7 2004 e3a-8_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 e3a_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 e3b_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 e3c_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 e3d_20041007_132410.trc ---------- 1 root wheel 24 Oct 7 2004 lo_20041007_132410.trc bash-2.05b#
and the snapshot looks like:
bash-2.05b# ls -l /home/johnk/tmp/.snapshot/nightly.1/netapp total 1264 -r-------- 1 johnk wheel 24 Oct 7 2004 e0_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 e3a-4_20041007_132410.trc -r-------- 1 johnk wheel 1286589 Oct 7 2004 e3a-8_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 e3a_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 e3b_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 e3c_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 e3d_20041007_132410.trc -r-------- 1 johnk wheel 24 Oct 7 2004 lo_20041007_132410.trc
...this script will reset all of your broken root owned files, to be owned by 'johnk' with the correct permission bits (as found in .snapshot).
http://www.southwestern.edu/~johnk/scripts/NAfixperms/NAfixperms-v1.6.pl
Please use caution when using this script, as I am an amateur perl coder (things may not be done "correctly").
HTH
Sincerely, --johnk
John C. Koen Systems & Network Administrator Southwestern University, Georgetown, TX johnk@southwestern.edu || TEL:512.863.1586 || FAX:512.863.1605