Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot su to root 4

Status
Not open for further replies.

june54

Technical User
Jun 4, 2003
160
US
Hello

One my tech issued a chmod -R 777 to /usr by accident .. No we cannot su to or rsh to root .. is there a quick way fix .. Do I need to restore /usr from mksys or go into the management shell and change the su to included the sticcky bit ... Really need help for a quick fix ..

Thnks
 
Our mksysb is created via NIM ... Is there a way just restore just the /usr directory ... or do I need to restore the entire MKSYSB ......
 
Hi,

since /usr holds the AIX Fileset Inventory with requisites information and links to other Files/Filesystems, I fear there's no other way to get your machine back into a consistant state than restoring/reinstalling from an actual mksysb.

good luck!
Martin
 
I totally agree with what my friends say above but if i were you i would first try to restore /usr first and see if that will fix the problem and if not then i will restore the whole mksysb from the nim

First copy the image from the NIM server to your server (or use nfs mount for that) and issue the following command:

Code:
# restore –xdvqf mksysb_image ./usr

I hope this will solve the problem :)

Regards
Khalid
 
Do you have another server you could manually or script a global chmod from the permission on the other server.

find /usr -perm 700 > one
find /usr -perm 770 > two
....
....
....

sed s/^/chmod 700 / < one >> ch.perms.sh

not perfect I know.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Plamb

what is sysck -t going to do .... I did man on sysck I did not see an arguement for -t ......

thanks
 
If you have room enough on this (or another) server, you might try restore the /usr dir there, then use a script to chmod-ify the dirs and files in your garbled /usr from, let's say, "/restore/usr"

cd /restore/usr
find . \( -type f -o -type d \) -ls|awk '{
perms=$3
operm=0
if (substr(perms,2,1)=="r") operm+=400
if (substr(perms,3,1)=="w") operm+=200
if (substr(perms,4,1)=="x") operm+=100
if (substr(perms,4,1)=="s") operm+=4100
if (substr(perms,4,1)=="S") operm+=4000
if (substr(perms,5,1)=="r") operm+=40
if (substr(perms,6,1)=="w") operm+=20
if (substr(perms,7,1)=="x") operm+=10
if (substr(perms,7,1)=="s") operm+=2010
if (substr(perms,7,1)=="S") operm+=2000
if (substr(perms,8,1)=="r") operm+=4
if (substr(perms,9,1)=="w") operm+=2
if (substr(perms,10,1)=="x") operm+=1
if (substr(perms,10,1)=="t") operm+=1001
print "chmod",operm,$NF
}' >/tmp/restoreperms.sh

then cd to your garbled /usr and run the generated script
cd /usr
sh /tmp/restoreperms.sh

after that you can remove /restore/usr

No guarantees, but it might work.


HTH,

p5wizard
 
Hello

I am trying to restore /usr from my NIM server ..I mount the /nim_mksysbs filesystem and issue the following command
restore -xdvqf mksysb_image ./usr.... The system wants me to mount a VOLUME 1 on /dev/rcdo .. Please let me know what I am doing wrong .....

Thks
 
you have nfs-mounted /nim_mksysbs on the server you are trying to restore to?

cd /nim_mksysbs
ls ==> note the name of the image you want to restore from

cd /restore_fs OR cd / ==> depends where you want to restore to

restore -xdqf /nim_mksysbs/filename_of_mksysb_image ./usr

make sure you didn't mistype the name of the image file.


HTH,

p5wizard
 
I would agree with p5wizard :)

but sometimes the backup doesn't have the dot so if this command doesn't work for some reason try this

Code:
restore -xdqf /nim_mksysbs/filename_of_mksysb_image /usr

Best wishes,
Khalid
 
Thanks Folks


I am good to go ............Again thanks for all the reponses to my problem ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top