1834100 Members
2480 Online
110063 Solutions
New Discussion

Ooops...

 
SOLVED
Go to solution
Frederic Wartner
Frequent Advisor

Ooops...

Seems I've made a big mistake.

I used SAM to gain disk space by removing files that were supposed to be unused. I thought it was some backup directory, and went on...
and realized shortly after that these files were not unused at all, and some were definitely esential.
This is not a severe issue because it's not a production machine- that's why I've got no backup...- but it bothers me, first because I feel (and surely am) stupid, and second because I don't know how I'll be able to re-install anything, as the network services are gone, and there's only a floppy and no CD drive in this machine.

So, is there a way to undelete the files?

Thanks in advance.
41 REPLIES 41
Pete Randall
Outstanding Contributor

Re: Ooops...

Unix, unlike windoze, has no undelete facility. That's why backup is emphasized so much. Which section of SAM were you in?

Pete

Pete
Frederic Wartner
Frequent Advisor

Re: Ooops...

I think it was "remove selected files" or something like that (I can't verify because SAM has gone too).
It showed a list of files/programs and specified they were unused.
As there were files which I knew were in use, I thought it was a backup directory - but it appears it wasn't :-(
Jeff Schussele
Honored Contributor

Re: Ooops...

Do you have a make_recovery tape?
Doesn't matter how old if these are OS binaries - they don't change.
If they're config files, at least you can get them back & modify after restoring.

Good Luck,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Frederic Wartner
Frequent Advisor

Re: Ooops...

I'm afraid I've got absolutely no backup. I got this machine a few days ago, and wanted to try it on my network.
Vincent Fleming
Honored Contributor
Solution

Re: Ooops...

Well... you could use fsdb to restore the files, if you really, really knew what you were doing - like Windoze, UNIX essentially only marks the inode as deleted. The data blocks themselves are not modified (except in trusted systems). You need to rebuild part of the inode, and then rebuild it's directory entry.

Of course, you cannot write anything to the filesystem between when you deleted the files and when you attempt restoration - otherwise, it's unlikely that you would be successful as some of the datablocks you want back would probably be re-used.

I've done this, but it was way ugly, and no fun at all. I also had an developer from Veritas on the phone. It's easier to re-install the machine from scratch for most folks. (in my case, it was a database file that was lost - a *very* big database file. The customer said, "Backups? We don't do backups - that's why we have RAID!") Unfortunately, RAID doesn't protect you from your operators. ;-}

Consider this a lesson in using that 'root' account. It's a good policy to always log in as yourself, and only 'su' when absolutely necessary, and exit the su as soon as you've typed your 1 or 2 commands that needed root privs.

Don't think you're stupid, either - it happens occasionally to even the best administrators. That's why there's backups! Did you know that approx. 30% of all system downtime is a direct result of the Systems Administrator??? Human Error. It's what makes us all human.

If you want to feel better, somewhere on this forum is a thread asking people to fess up their greatest blunders - oh, boy, there are some *really* good ones there! ;-}

Good luck, and I hope your re-load goes smoothly.

-Vince
No matter where you go, there you are.
James R. Ferguson
Acclaimed Contributor

Re: Ooops...

Hi Fredrick:

Oh, the 'freedisk' utility is what you ran. No, I wouldn't have done that. Have a look at the man pages for 'freedisk' for more information, although I wouldn't trust it nor use it! I trust you have an Ignite recovery tape.

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: Ooops...

Do you have another similar system with the same OS AND a floppy drive?

If you know which files were removed you could tar them up off the other system & extract them onto this one.

If not, it looks like it's time to get a CD hooked up & reload that puppy.

Good Luck,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Frederic Wartner
Frequent Advisor

Re: Ooops...

In fact I just need to run a ftp client to get what is missing... maybe I could put the necessary files on one or more floppy disk(s)?
Frederic Wartner
Frequent Advisor

Re: Ooops...

I realize I've not made it clear, but the OS is still there: the system boots and I can log in.
Jeff Schussele
Honored Contributor

Re: Ooops...

Well....You said the network services were gone, so I thought you couldn't ftp them over from another system.
If you can, that's the ticket.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Steele_2
Honored Contributor

Re: Ooops...

Sounds like the /usr file system is gone since you can still boot. What run level do you come up to?

who -r

If you're all the way up to run level 3 then you may have just lost some of the command set, typically this is mostly in /usr.

In order to get a good idea, run this command:

swverify -v -x check_permissions=true \*

If still there, then swverify will run for 10 or 15 minutes. Observe the swverify.log and swagent.log files and attach both in another reply.

Also, you might be able to copy of the /usr file system from another 10.20 O/S, (* this is the 712 work station, right *) but it has to probably be from another 712 work station. Work stations work a little differently than the 800 series of enterprise servers, so, as the man above suggested, it might be time to get a CD device and reload that puppy. And then make a make_tape_recovery tape ASAP!
Support Fatherhood - Stop Family Law
Steven E. Protter
Exalted Contributor

Re: Ooops...

If the /usr filesystem still exists, you might be able to rebuild as follows:

This is unsupported.

Go to a workikng system of the same OS, make a tar file of everything in /usr

cd /usr

tar xvf /tmp/usr.tar *

ftp the file to the afflicted server.

tar cvf usr.tar

Some things will still not work, but it might give you a basis to avoid reinstalling the OS.

BTW, I would reinstall the OS.
Then Apps from the Apps cd

Then December 2002 patch set.

Then third party applications.

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
Frederic Wartner
Frequent Advisor

Re: Ooops...

Actually, the system boots and I can log in, but most of the commands are not recognized and I can't use the network: no ping, no ftp, etc..
I don't have another HPUX machine, no backup and no installation media.
Maybe I can find essential files on the Web? If so, I could download them on my PC, install on the Wks from floppy discs (no CD drive) the files that are necessary to use ftp, and then get the other ones via ftp...
If not, is there a way to download the whole thing? Then I would burn a CD, borrow an SCSI drive and reinstall all...
melvyn burnard
Honored Contributor

Re: Ooops...

No can do.
You will need to get hte media and borrow a supported CD drive to hook up, and install form htere.
The only other way would be if you had an Ignite Server out on hte lan somewhere, but as you have nother HP-UX systems.......
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Volker Borowski
Honored Contributor

Re: Ooops...

Hi,

did you verify, that the files are indeed gone ?

find / -name ping -print

Or could it be, that you activated restricted shell via SAM by accident (which might look the same, because acces to some programms is not allowed any more ?)

Actually how long did this "remove unused filesets" did run ? secs, minutes, hours ?

Volker
Michael Steele_2
Honored Contributor

Re: Ooops...

By the way, what exactly is in your $PATH variable?

echo $PATH

You should see /usr/bin, /usr/sbin, etc. for root.

And again:

swverify -v -x check_permissions=true
-or-

which swverify

-or-

which ping

or any command with "which".
Support Fatherhood - Stop Family Law
Frederic Wartner
Frequent Advisor

Re: Ooops...

Thanks for the tips.
Finally network files are still there, and I can ping the PC by IP but not by name, while the PC pings the wks by IP and name.
Is there a way, other than ftp which is really gone, to transfer files from the Linux PC?
If not, can I get on the Net a compatible ftp client that I would install from floppy discs?
Also, will I get back the lost system files after installing the latest cumulative patch and quality pack?
Michael Steele_2
Honored Contributor

Re: Ooops...

Well don't keep us in the dark Frederic what happended? There was a flurry of postings and then silence!?x!

Re-run:

set_parms hostname
set_parms ip_address

rcp is an alternative to ftp.

ftp is compatiable between Linux and HP-UX and should be uncommented in inetd.conf file.

Yes, load the latest patches

NOTE: But if swverify reports too much corruption, then your copy of HP-UX is in an unknown unsupported state and should be reloaded.

Anything else, sir?
Support Fatherhood - Stop Family Law
Frederic Wartner
Frequent Advisor

Re: Ooops...

Sorry, my wife doesn't like that I spend 100% of my time on the computers... ;-)

So it seems that news are good, I should be able to mend the system.

But... there's only a 1GB hdd on my wks (as I didn't get it new, I don't know if there was another one originally=. Is it enough to run HPUX 10.20?
Michael Steele_2
Honored Contributor

Re: Ooops...

1 gb is enough for 10.20 but you'll be hard pressed to store any user or application data.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: Ooops...

PS Can you assign some points in this and the other postings please? This is what we all live for.
Support Fatherhood - Stop Family Law
Frederic Wartner
Frequent Advisor

Re: Ooops...

Of course, I'll do it right now, as you kindly helped me!
Frederic Wartner
Frequent Advisor

Re: Ooops...

Well, no more vi, no more ftp, and no more rcp... it won't be as easy as I hoped.
Any idea to put them back, keeping in mind I have to use floppy discs?
Maybe I could download the files somewhere, or someone could email them to me?
Volker Borowski
Honored Contributor

Re: Ooops...

Hi,

guess you have to check., whats left :-)

remshd / rshd -> are you able to rsh the box ?
tar ?
rexec / rlogin ?
telnetd ?
C-Compiler ?

If rsh can be set up
(i.e. "echo '+' > /.rhosts" if you have no vi) and tar is still available, you can do from linux to HP:
tar -cvf - /etc/hosts | rsh bad_box_ip tar xvf -

If you have none of the r-tools working, you could try to upload programs via x-Modem / y-Modem / z-modem, if telnet is working, or you have to connect directly to the serial port with an upload-capable sw.
I.e Reflection has a small filetransferagent in its telnet, that might be able to be uploaded and can be used to restore smallfiles (ftpd ....), it is lousy slow, but better than nothing.
With Refelection you can use the telnet-client even if you connect to the serial-port.

Even good old MS-hyperterm has some basic functionalities.

But I guess this will take some time.
Volker