Re: restoring permission's on root file system .

From: Shekhar Dhotre (Shekhar.Dhotre@LENDLEASEREI.COM)
Date: Fri Jan 10 2003 - 10:07:56 EST


tar/compress worked . The system is up .

Q: How would it affect if I use reset.perms.out script created on 4.3.3.10 system to the system(bad) which was on AIX4.3.3.2
to restore original permission's?

Thanks Pablo and all who responded to my problem .

SD

Holger.VanKoll@SWISSCOM.COM
Sent by: IBM AIX Discussion List <aix-l@Princeton.EDU>
01/09/2003 02:15 PM
Please respond to IBM AIX Discussion List

        To: aix-l@Princeton.EDU
        cc:
        Subject: Re: restoring permission's on root file system .

tried to transfer the dosread-command with dd?
something like

dd </usr/bin/dosread >/dev/your_diskdrive

and vice versa on the target system

-----Original Message-----
From: Shekhar Dhotre [mailto:Shekhar.Dhotre@LENDLEASEREI.COM]
Sent: Thursday, January 09, 2003 7:54 PM
To: aix-l@Princeton.EDU
Subject: restoring permission's on root file system .

We are following process to restore permission's on root file
system . Now we have reset.perms.out file on another aix system .
We are trying to copy this file to bad aix system so that we can
execute and restore permission's .unfortunately there is no
doswrite/read commands on target system. since system is booted in
maintenance mode cannot install bos.dosutil file set .
we are trying dd, cpio etc..

Is there a way to copy file from one aix system to another aix
system ? using any other commands than dosread and doswrite ?
or can we bring network up in maintenance mode ? so that we can
ftp this file .

drwxr-xr-x 2 root system 1024 Dec 30 08:49 drinfo

-rw-r--r-- 1 root system 733137 Jan 09 12:34
reset.perms.out.Z (want to copy this file )
drwxr-xr-x 2 root system 512 Jan 09 13:23 reset

spcws01@/tmp>

Thanks
SD

Check this out-

it uses a mksysb tape of the damaged system to generate a script
to fix
perms-

http://www.gruftie.net/ibm/tl/techlib/qna/faxes/html/cmd/cmd31.htm

<http://www.gruftie.net/ibm/tl/techlib/qna/faxes/html/cmd/cmd31.htm>

if you don't have a mksysb tape, you can use the following:

You run the script listed below on A GOOD system with correct

permissions. This will generate a file 'reset.perms.out' which

contains the necessary 'chmod' and 'chown' commands to restore

permissions on the affected system. You can then COPY this file

over to the BAD system and run it.

-- begin script --

#!/bin/ksh

cd /tmp

rm reset.perms.out 2>/dev/null

find / -ls |awk '{print $3,$4,$5,$6,$7,$8,$9,$10,$11,$12}'|

awk '{

if ( NF == "9" )

{

printf ("chown %s.%s %s\n",$3,$4,$9)

{

perms=0

if(substr($1,2,1) == "r")

perms = perms + 400

if(substr($1,3,1) == "w")

perms = perms + 200

if(substr($1,4,1) == "x")

perms = perms + 100

if(substr($1,4,1) == "S")

perms = perms + 4000

if(substr($1,4,1) == "s")

perms = perms + 4100

if(substr($1,5,1) == "r")

perms = perms + 40

if(substr($1,6,1) == "w")

perms = perms + 20

if(substr($1,7,1) == "x")

perms = perms + 10

if(substr($1,7,1) == "S")

perms = perms + 2000

if(substr($1,7,1) == "s")

perms = perms + 2010

if(substr($1,8,1) == "r")

perms = perms + 4

if(substr($1,9,1) == "w")

perms = perms + 2

if(substr($1,10,1) == "x")

perms = perms + 1

if(substr($1,10,1) == "T")

perms = perms + 1000

if(substr($1,10,1) == "t")

perms = perms + 1001

printf("chmod %d %s # %s\n",perms,$9,$1)

}

}

}' >reset.perms.out

chmod 755 reset.perms.out

-pablo

--
Pablo Clifton
UNIX Tech Services
* pablo.clifton@bcbsfl.com
* DCC603-F212
* 904.905.7116/ 210.287.4021 cell
-----Original Message-----
From: Shekhar Dhotre [mailto:Shekhar.Dhotre@LENDLEASEREI.COM]
Sent: Thursday, January 09, 2003 9:47 AM
To: aix-l@Princeton.EDU
Subject: permission's or / (root) changed
Hi all,
Our Junior-while working with Developer changed some permission
on root file
system, I don't have details but he was telling me developer
provided some
script to change permission's and he accidentally executed on
root file
system.
Now we are getting messages processes spawning to rapidly ...
the box is
down. I started working with him to restore this box.
What are our options?
I know I can restore from mksysb.  (He is in doubt about mksysb
tape -
created one year ago :-) and searching one .
Assuming that we don't get mksysb -
Can I install AIX from CD and do importvg on whatever volume
groups were
there?
Or is there any way to set / permission's to original one?
Thank You
SD




This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:28 EDT