LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   restored from tape, but having permissions problems (https://www.linuxquestions.org/questions/linux-newbie-8/restored-from-tape-but-having-permissions-problems-694551/)

davidstvz 01-02-2009 02:57 PM

restored from tape, but having permissions problems
 
The strangest thing is that I'm having problems in directories that weren't restored from tape. For example, the openwebmail directory in /usr seemed to lose it's group writing privelege so the mail account couldn't use it for openwebmail.

Now I'm having trouble with pine/sendmail and god knows what else. Whatever I did I doubt there's an easy fix.. but I'd like to at least figure out what I did.

While I was restoring from tape, I was in single user mode which mounted / as read only initially. /usr wasn't mounted at all. I mounted them manually in read/write mode and restored the bad drive and partitions (/local /scratch /soft and /var). Everything seemed to go fine, so I don't know how the permissions could have changed.

jailbait 01-02-2009 03:24 PM

When you are in single user mode you are running as root. Any files that you create will be owned by root. You can get around that by telling the program you are restoring with to preserve permissions. Actually you have to preserve permissions on both the backup and the restore. For examples of what I am talking about look in the man pages for the tar command and check out the -p, --same-permissions, and --preserve-permissions options. Look at the man pages for the cp command and check out the -a, -p, and --preserve options. Look at the man pages for rsynch and check out the -a and -p options.

I would like to repeat that if you are preserving ownership then you must do so on both the backup and the restore. If you backup everything as root without saving permissions then the restore will have root permissions regardless of what you tell the command you restore with.

----------------
Steve Stites

davidstvz 01-02-2009 03:40 PM

You're saying that everything I restored is going to be owned by root:root whether it should be or not?

I just checked however, and that is not the case (thank god!)

I archived using:

tar -cvf /dev/nsa0 /var

and restored using:

tar -xvf /dev/nsa0 var

I shouldn't have had the / before var when archiving, but the tar program said it was removing the leading slashes for me, and the restore seems to have gone just fine.

Got any other ideas or comments on this?

By the way, my particular problem at the moment is that sendmail doesn't want to send when I use pine (though it works fine when I use open web mail to send; I assume OWM is sending via sendmail, but I'm not sure).

davidstvz 01-02-2009 03:50 PM

ok:

the /var/spool/clientmqueue directory apparently needed permissions as follows:

rwxrwx--- however, it had rwxr-x---

but the owner and group were preserved properly as smmsp

It seems like write permissions just disappeared on a lot of public directories that needed them, but nothing else was lost. What a mess.

davidstvz 01-02-2009 08:46 PM

Just to make sure this is perfectly clear:

1) One of these weird permissions problems occured in the /usr partition which is NOT on one of the hard drives that failed. The only thing I did with this harddrive was manually mount and unmount it a few times using the following commands:

mount -uw /usr
mount -ur /usr
umount /usr

2) The problem also occured on the /var partition which is one of the ones I restored. I didn't use -p when I tarred or untarred, but all group assignments and permissions seemed to be retained anyway... except the group write permissions on a few folders as noted.

In fact, I think all of the problems so far have been that group write permissions simply vanished on each folder where I had a problem. Maybe I accidentally issued a chmod command that had the effect of "chmod g-w" on a big space I didn't intend (I don't recall doing anything other than "chmod g+w" specific files much less anything like "chmod -R g-w /*", but who knows).


All times are GMT -5. The time now is 08:14 PM.