Restoration - files/groups/permissions (75 Views)
Reply
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 1 of 28 (75 Views)
Accepted Solution

Restoration - files/groups/permissions

Hi,

As per my other thread and after lots of advice, i have managed to get my legacy server up and running, RAID configured and O/S v5.1B installed (thanks for the help).

My next dilema was that i was expecting the users to be brought back in the "Account Manager" screen within daily admin - though this doesnt seem to be the case?? - do i have to recreate each user/group again (their home directories have been restored successfully)

My 2nd query is to do with groups/permissions. Again i naively thought that all groups etc would be restored along with the correct ownerships/permissions on each file that had been restored as before. If i create some groups, is there any easy way just to allow all users access to each file. (i realise this isnt good paractice, but all i need to do is get an oracle database up and running to be queried). So i need to be able to be at the top (root) of the oracle installation e.g /u01/oracle and is there someway to cascade the 777 permission recursively down this section of the file system??

1 last query - do environment variables have to be manually restored again after a fresh install/file system restoration??


thanks again in advance - this is a steep learning curve so all help is much appreciated

cheers

barry
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 2 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Barry,

1. Can you let us know what you've done so far to get things restored...

I know you've rebuilt things from CD, but have you restored anything from tape etc. ?

As you may know users and groups are stored in the files /etc/passwd and /etc/group Were those files restored ?

2. You can do a recursive chmod using the -R option. So for example:

cd /u01
chmod -R 777 oracle

although I'd only go down that route as a last resort.

3. Environment variables could be stored in a number of places. Eg. /etc/profile or in the .profile in each users home directory. Again it depends how you restored things as to whether these will came back.

Cheers,

Rob

P.S. If we are managing to help you out, you might want to assign points to people's responses...
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 3 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Rob,

I thought i had assigned points with the last responses?? - well i tried to and i will deffo make sure i have :)

I went through the install process, then have restored my backup from a DLT drive. I created the domains/filesets as before (had a note of them). I used the default (/ root files) that are created at install then created 2 mount points /u01 & /u02. I have then restored the file systems to the required mount points. so to be honest i suppose i have just used the default root installation and mounted my 2 files systems so that is perhaps when my problems are stemming from.

Looking at your points i didnt restore the /etc directory i dont think which i will now go and do - so thanks for that

thanks for your help

barry
Honored Contributor
Ivan Ferreira
Posts: 6,957
Registered: ‎05-07-2004
Message 4 of 28 (75 Views)

Re: Restoration - files/groups/permissions

1. If you reinstalled the OS, you must manually recreate users and groups or restore the /etc/passwd and /etc/group files. More files are required if you where using enhanced security.

2. Don't grant world write access to files, create a common group for users that need to write to files/directories and add the users to that group. You can use something:

chown -R root.group directory/
chmod -R root.group directory/

To apply permissions recursivelly. You can also do a "find":

find . -type f -exec chown root.group {} \;
find . -type f -exec chmod 664 {} \;
find . -type d -exec chown root.group {} \;
find . -type f -exec chmod 775 {} \;

3. Yes, environmental variables must be restored from a backup if you have one. They can be in /etc/profile or in the user $HOME/.profile (depending of the shell).
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 5 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi,

Thanks for the advice. I decided to start again with all the advice you guys have given me, i.e keep the RAID config and reinstall the O/S by booting from CD.

This seemed to be going fine but have now got an error when i boot:-

Errors: Cluster() Local () Cluster/Local 34 Total:34

bcheckrc: device naming failed initial check.

run "dn_setuo -sanity_check" and if command is successful, exit or type ctrl-D to continue booting.

Have tried both options and it still wont boot (as the O/S has prob not finished installing??). Tried ctrl-D and was given option of level 0-9, picked "0" and am still stuck in single user mode.

again totally confused and any help would be great

cheers again

barry
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 6 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Barry,

You're not having much luck...:-(

I've not come across that particular error, but something appears to have got a bit confused with the device naming somewhere.

Rather than trying to fix this, if you let people know what you've got, in terms of hardware, backup tapes, etc. it will probably be easier to start again.

For example you should be able to boot off the installation CD, then get out to a shell.

From there you should be able to reconfigure the hardware, get your file domains created etc. and restored, without having to go through a complete installation.

Obviously this is dependant on you having a full backup on tape to be able to restore from...

Cheers,

Rob
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 7 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi,

These are the errors i get when trying to boot: (sorry if they are repetitive!!)

on typing dsfmgr -K

we get the following error

dsfmgr: Error: ADD inconsistent datum for registered device: kevm.pterm HWID-BIND was: 5-3, is: 4-2

NOTE: probable cause was previous failure of command: "dsfmgr -R hwid 5"

dsfmgr: Error: ADD inconsistent datum for registered device: kevm.debug HWID-BIND was: 5-3, is: 4-2

NOTE: probable cause was previous failure of command: "dsfmgr -R hwid 5"

dsfmgr: error: create node: node type: /dev/ is:directory sb:character special

dsfmgr: Error: ADD inconsistent datum for registered device: random HWID-BIND was: 63-12, is: 68-16

NOTE: probable cause was previous failure of command: "dsfmgr -R hwid 63"

dsfmgr: Error: ADD inconsistent datum for registered device: urandom HWID-BIND was: 64-13, is: 69-17

NOTE: probable cause was previous failure of command: "dsfmgr -R hwid 64"

i then tried dsfmgr -v -F which explains

Dev Nodes:
Warning: (c)_scsi_scsi device prefix wrong. IS:_sc Sb:scp
Warning: (c) status record not found for HWID 3:c'scp_scsi'
NOTE: to fix execute "dsfmgr: -K"
Warning: (c) scp device prefix wrong. Is:scp Sb:kevm
WARNING: status record not found for HWID for: c 'kevm'
WARNING: status record not found for HWID for: c 'scp.ptrem'
WARNING: status record not found for HWID for: c 'scp.debug'
WARNING: node not found in status file: /dev/
Warning:node wrong file type "/dev/" Is:directory Sb:character special
Memory Fault

If i then type dsfmgr -K as suggested and i get a locking file error.

The hardware i have is a DLT backup drive, cdrom, 2 x 3 member RAID drives in a storage shelf, 1 system drive (as 1 failed) and scsi bus.

Again any advice would be great, getting so far then seem to get a set back. Have learned more about Tru64 in the last week than i my life!!!!

thanks again

barry
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 8 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Yuck...!

What do you get out of the command :

hwmgr view devices

If you get back to the SRM prompt (P00>>>) what do you get from :

show dev

Cheers,

Rob
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 9 of 28 (75 Views)

Re: Restoration - files/groups/permissions

hi Rob,

Not a good start by the sounds of "yuck" haha.

hwmgr show device

HWID Device Name Mfg Model Location
3: (unknown)
4: (unknown)
11: (unknown) SWXCR xcr0
12: (unknown) SWXCR ctrl-0-unit-0
13: (unknown) SWXCR ctrl-0-unit-1
42: (unknown) 3.5in fdi0-unit-lun-0
57: (unknown) COMPAQ CD-224E bus-0-targ-0-lun-0
58: (unknown) COMPAQ SDT-9000bus-4-targ-6-lun-0
65: (unknown) COMPAQ DLT8000 bus-5-targ-6-lun-0
66: (unknown)
68: (unknown)
69: (unknown)

>>> show dev

all devices seem to be shown ok, big list but i could type it if you wish??, all major h/w seems to be identified with no errors

cheers

barry
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 10 of 28 (75 Views)

Re: Restoration - files/groups/permissions

I don't like the look of all the unknown device names.

You should expect to see something like this:

# hwmgr view devices
HWID: Device Name Mfg Model Location
------------------------------------------------------------------------------
3: /dev/dmapi/dmapi
4: /dev/scp_scsi
5: /dev/kevm
12: /dev/cport/scp0 SWXCR xcr0
13: /dev/disk/dsk0c SWXCR ctlr-0-unit-0
14: /dev/disk/dsk1c SWXCR ctlr-0-unit-1
50: /dev/disk/floppy0c 3.5in floppy fdi0-unit-0
59: /dev/disk/cdrom0c DEC RRD47 (C) DEC bus-0-targ-5-lun-0
61: /dev/random
62: /dev/urandom

I'd be tempted to start again (again !).

Have you got a complete backup on tape ?

Rob
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 11 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Rob,

Yeah i have a complete backup tape but i cant get into the system after the install. I get so far then after the install loads the subsets and reaches 100%, it goes through the kernel load re-boot type screens then gives me that error, so how can i complete a fresh install (if i havent confused you??)

So i'm kind of confused why it is still giving me these messages after i do a fresh install booting off of the o/s disk??

better to break the RAID - reinitialise a new array, then boot the new install from the o/s disk??

cheers

barry
Honored Contributor
Ivan Ferreira
Posts: 6,957
Registered: ‎05-07-2004
Message 12 of 28 (75 Views)

Re: Restoration - files/groups/permissions

>> better to break the RAID - reinitialise a new array, then boot the new install from the o/s disk??

Yes. Because during installation, the installer will try to save your old hardware configuration. It's better if you don't have anything on your disks for the initial installation.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 13 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Barry,

You shouldn't need to do a complete install as you've got everything on tape...

According to some Disaster Recovery notes that I've got here, you need to make sure that you unset the SRM variable bootdef_dev. This will stop the installation procedure looking for any previous hardware references...

P00>> set bootdef_dev ""

Boot off the OS install CD, and after selecting your language you'll get into an X session. If you select File -> Exit to Shell you get a command prompt from where you can reconfigure (relabel) your boot disk, create relevant file domains, file sets etc. and then restore things from your tape...

I've got a step by step procedure if you need it, but only a hard copy at the moment...

Cheers,

Rob
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 14 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Rob,

Reconfigured the RAId, re-installed o/s, created domains/filesets etc - all went well....until i brought back data from the tape. I brought back everything really from the root (/) backup that looked relevant /var, /etc, /usr, /dev however something in /usr/slib dxaccount i think would not allow me to open any terminal windows etc and i got some errors in the log window. I decided just to re-install the o/s again and only bring back the /etc directory at (/ root level) and use the rest of the frsh install files.

I did this but got the same error as yesterday so have had to start all over again breaking the RAID which is almost complete and one final o/s install.

I assume i can just bring back /etc from backup and i dont need /var /usr (i have a saveset called /usr anyway that contains all home directories, profiles etc)??

thanks for your help and i'll let you know how i get on after this attempt

cheers again

barry
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 15 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi,

Now got an o/s installed on the server.

restored only the /etc directory so far (which was successfull), however when i go into the GUI for account manager, all accounts restored have been locked, inc root. (this happened before and i rebooted and couldnt even change the root password in single user mode)

the error i get when trying to unlock the users i get the following error

Errors encountered while modifying the user:root
Unspecified error accessing the extended profile database

Bearing in mind i have only restored /etc, is there anything else essential that i should restore to enable me to unlock the root user??

cheers

barry
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 16 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Also when i try su - (su:your own ID is unknown), if i type passwd i get "change password:root: unknown user)

however if i try who i get root returned

getting even more confused

barry
Honored Contributor
Rob Leadbeater
Posts: 3,582
Registered: ‎08-14-2002
Message 17 of 28 (75 Views)

Re: Restoration - files/groups/permissions

That sounds like the password databases might have got out of sync...

If you:

# cat /etc/passwd

Do you see the users you're expecting ?

If so try running

# vipw

to edit the passwd file and then resave it with :wq. That *might* help...

But then having just typed all that, I'm not sure now whether you've got any access to root so you might still be stuck...

Rob
Valued Contributor
jim owens_1
Posts: 67
Registered: ‎11-09-2006
Message 18 of 28 (75 Views)

Re: Restoration - files/groups/permissions

The multiple problems you are having are probably because of file differences between the install media, the patch kit, and the kit the backup was made on.

The hwmgr problem is an example of this that has frustrated me before. The install media is SSB (initial V5.1B release). A later patch kit (I don't remember which) changed the database format. Once you patch up, you can only go backwards via a shell script to fix the database or do what I do and at the console prompt >>> set bootdef_dev (which clears it so it doesn't try to use the device database that won't work with the install.

I install, patch up, then modify or restore only a few critical files. Restoring /etc is a recipe for disaster unless it matches the kit you are at now. If you know the PK of the backup, you could install, patch to that kit, restore, patch to latest kit.

But I think restoring just files like passwd and group may be easier. Note that with some extended security enabled, there are other databases being used as well and you probably have to go through some rebuild steps (I can't help there).



Honored Contributor
Ivan Ferreira
Posts: 6,957
Registered: ‎05-07-2004
Message 19 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Probably your old system had enhanced security configured. After the fresh installation, convert the system to enhanced security, use "sysman secconfig", and then restore your backup data, including /etc and /tcb.

You should restart the system after the restoration.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Honored Contributor
Ann Majeske
Posts: 335
Registered: ‎01-07-2004
Message 20 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Enhanced Security also has data in /usr/tcb directory.
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 21 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Trying an install using v5.1a which i believe was the version running when the backup was taken. have selected the enhanced security option as well

how do i switch off the screensaver which is password protected?? - as if i have no working root password then i will be locked out again???

thanks
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 22 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi,

After installing 5.1A, i have re-created domains, filesets etc.

Have just restored /etc from backup.

When i go into GUI account manager i get the following error

An /etc/AM_is_running Account Manager lock file has been detected. This may indicate that one of the following processes with process-ID 233820 is using an Account Manager Database

dxaccounts useradd usermod userdel groupadd groupmod groupdel

Please remove the lock file if the process does not exist and re-start Account Manager

Perhaps this is why i cannot modify users after the install???

How can i clear this lock file???

I dont have any of these processes working - i have not re-booted since i installed and whe i check processes "ps" i get nothing apart from the 1 terminal window i have open

again any advice would be great

barry
Honored Contributor
Ivan Ferreira
Posts: 6,957
Registered: ‎05-07-2004
Message 23 of 28 (75 Views)

Re: Restoration - files/groups/permissions

After restoring your backup, just use:

rm /etc/AM_is_running

To remove the lock file. It's just that simple.

You can boot in single user mode to remove the file if you cannot login to the system. Halt the system and run:

boot -fl s
mount -u /
rm /etc/AM_is_running
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 24 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi Ivan

Tried that command you suggested - got a response saying lock file did not exist HOWEVER...it let me change the user passwords and enable previously locked accounts so thanks for that.

Perhaps this is me finally getting somewhere. Going to continue restore and see how it goes

thanks all for help so far ....much appreciated

cheers

barry
Advisor
Barry Ashcroft
Posts: 21
Registered: ‎11-24-2003
Message 25 of 28 (75 Views)

Re: Restoration - files/groups/permissions

Hi,

Created 1 file domain, fileset, restored from backup pefectly and mounted the file system

When i go to do the same and try and make a 2nd file domain using mkfdmn /dev/disk/dsk1c (1 large 17Gb partition on the disk) i get the following error

/dev/disk/dsk1c or an overlapping partition is open
quitting.......
mkfdmn can't create new domain 'dat_dmn'

I have tried to re-configure this disk by changing usuage to "unused" then back to "advfs" but still getting this message.

As far as i can see this partition should be empty. Still heven re-booted the server since the install

Is this some sort of bug or is there a way around this latest setback??

cheers

barry
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.