1834552 Members
3474 Online
110069 Solutions
New Discussion

Re: SAM corrupted

 
SOLVED
Go to solution
Torsten.
Acclaimed Contributor

Re: SAM corrupted

I don't understand what you did:

"/problem = the problem filesystem (in my case, /usr /var and opt)

cp /problem /temp_problem

newfs -F vxfs /problem
cp -r /tmp/problem /problem
"

The line
cp /problem /temp_problem
will do nothing, because the switch -R is missing. So the /temp_problem directory will stay empty. Anyway, if you use the -R, you will change all access rights and ownership to different values.

The newfs command requires "raw" devices, but I assume you did something like
newfs -F vxfs /dev/vg00/rlvol6

But finally you need to rebuild the system now, at least because of your wrong copy action.
Don't waste your time and reinstall the box ;-)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
dictum9
Super Advisor

Re: SAM corrupted


This was more of a high level pseudocode than exact commands, sorry I used the -R switch of course, and the "raw" device when doing newfs.


The system has been rebult... But I want to know what went wrong out of sheer curiosity and the desire to be better so that this doesn't happen again.

In my mind the lesson I see, you cannot use the "cp" command on critical filesystems like that. My guess is, some important files were left out somehow.


A. Clay Stephenson
Acclaimed Contributor

Re: SAM corrupted

Well, there is always the question of what you actually did as opposed to what you think that you did. Those two may have an extremely high correspondence and then again, they may not.

Secondly, cp with or without -R is not a good choice for copying critical files because ownership/group/mode will not be perfectly preserved. You also have to concern yourself with symbolic links. Utilities like tar, cpio, fbackup/frecover are much better at preserving attributes.

In short, the ways to mess up a UNIX box are legion. You obviously have discovered at least one technique.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: SAM corrupted

Shalom,

There are two ways to do this, the professional way with proper tools or you can try and make a tool that is inapprpriate for the job try and do the job.

The options being considered are equal, in my opinion equally bad.

When money is short I've used rsync with ssh to get the job done. Here is the code.

# configuration to control variables like currentnode and othernode.
. /etc/sysconfig/syncftp.sysconfig
currentnode=$(hostname)
# clusternode=$(clustat | grep samba | awk '{print $2}' )
# echo "hostname: $currentnode $othernode"

while true
do
rsync -avH --stats --delete -e ssh /home/ gatec:/home/
rsync -avH --stats --delete -e ssh /home/ gated:/home/
# echo "sleeping now ..... zzzzzz...."
sleep $DELAY
done

Using a utility that is build into your disk storage arrrays at both end is the way to go.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
dictum9
Super Advisor

Re: SAM corrupted

The cp wasn't my idea... and when I doing it, I had serious doubts about it....

Thanks for the code, it's neat.
In this case, it's even simpler, as there is only 1 machine involved. I needed to sync files between different partitions on the same machine.

tar would have been a much better choice.