Operating System - HP-UX
1846446 Members
2491 Online
110256 Solutions
New Discussion

what if .. you deleted home dir ?

 
SOLVED
Go to solution
someone_4
Honored Contributor

what if .. you deleted home dir ?

Ok I had a thought. I am still rather new to this HPUX stuff (6 months). But I am learning allot from this forum. So I am thinking of what if's . Not that this would ever happened to me or anyone else. But I am sure it has happened to someone out there, and that would be why you have all theese really cool hats.
So here is my first question. What would happened if you deleted your home dir? And all the users in the dir? How would you fix that?
14 REPLIES 14
James R. Ferguson
Acclaimed Contributor
Solution

Re: what if .. you deleted home dir ?

Hi Richard:

Restore from backup...because you ALWAYS have a current backup tape... ;-)

...JRF...
Patrick Wallek
Honored Contributor

Re: what if .. you deleted home dir ?

If you are talking about deleting all of /home, then James is correct, you would restore it all from backup. The other option would be to manually recreate all the home directories and .?shrc, .login, .profile, etc. files, but that would be a pain in the butt.

Good backups are a must. Testing your backups to make sure you can restore from them is another must.

Look at Ignite/UX if you haven't already. Use make_tape_recovery to do a backup of your root VG.
someone_4
Honored Contributor

Re: what if .. you deleted home dir ?

I might get shot for saying this. I have been reading this forum for a while and I always hear about backups and backing up data and all. But what if .. there is no backup system?
Dont throw tommatos at me !!
Patrick Wallek
Honored Contributor

Re: what if .. you deleted home dir ?

No backup system?!? Make sure you keep your resume updated! :)

You have GOT to have a backup of some sort. Otherwise, if you lose something important, like home directories, or the /etc/passwd file or /etc/group file, then you are SCREWED.

If you have a tape drive on the machine, then there are tools built into HP-UX that you can use. Ignite/UX and fbackup being the two most commonly used.
James R. Ferguson
Acclaimed Contributor

Re: what if .. you deleted home dir ?

Hello Richard:

Backups are only good when you need them. They're insurance policies against disaster. Even with redundant hardware (mirrored and RAID disks), high-availability clusters (MC/ServiceGuard), etc. mistakes will happen, including ones made by you. Removing a file or a directory means its gone! A mirrored disk simply means its gone in two places.

In addition, you need to guard against the malicious attack from the disgrunteled employee.

You should periodically test your backups. After all, the worse time to find out that you can read a tape is when you really need it.

Patrick's pointer to Ignite is very well taken. This is the fastest and easist way to restore your operating system to a functional state. Take a look at the Ignite web page for software and docuementation. Take a look (search) through this forum for pointers on 'make_recovery' [now, 'make_tape_recovery'].

An excellent tool for small system backups and for ad hoc backups is 'fbackup' and 'frecover'. These tools are designed to allow backups on running systems. Files that are in use, but not actively changing during the moments that fbackup is copying them, will be backed up to tape. If a file changes, it will be automatically retried -times. 'fbackup' and 'frecover' handle largefiles (> 2GB) whereas the "old" 'tar' and 'cpio' utilities do not.

Take a look at the man pages for 'fbackup' and 'frecover'. Search this forum, too for a multitude of threads on the same.

http://www.software.hp.com/products/IUX/index.html

Regards, and welcome!

...JRF...
Jim Moffitt_1
Valued Contributor

Re: what if .. you deleted home dir ?

Richard,
Always, always, always, always have a recent backup. Not only should you have a recent backup, but you should have multiple versions of recent backups. Daily's, weekly, monthly's, yearly's. You never know when someone's going to delete something and you need to restore.

But you're question was what if there was no backup and someone delted their home directory.
Besides losing data in the home directory you're not that our of luck. You'll have to recreate the home directories. To do this, print out the /etc/passwd file. Start recreating the home directories from this printout. Next you'll have to recreate the profiles. Copy /etc/skel/* into the home directoris. This will allow the users to log in again. If you have a special profile, say for an oracle user, then you'll have to recreate it from scratch. Hope this helps.
Mark Vollmers
Esteemed Contributor

Re: what if .. you deleted home dir ?

How do you go about testing the backup tapes? The obvious answer is to delete something and then restore it, but I'd hope that there is another way.
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
someone_4
Honored Contributor

Re: what if .. you deleted home dir ?

I was wondering that my self Mark.
Hope someone answers.
James R. Ferguson
Acclaimed Contributor

Re: what if .. you deleted home dir ?

Hi Richard:

Yes, one way to test your backup strategy is to remove a file and then restore it from backup. Essentially you are testing both your familarity with the process and you are spot-checking the health of your tapes.

BTW, don't forget to clean tape drives, track how many times tapes are used, and discard old tapes after, say 75-100 uses.

Ideally, if you have a development server, you could Ignite it using your production server's Ignite recovery tape; restore all your production application data; and verify that you ended up with a functional business system.

Another "nice" thing to do with your backup tapes is to get a tape directory after the backup and check it to make sure you backed-up what you intended to do.

'frecover' will generate this for you to a file that you can review (see the man pages). With 'tar', you can redirect the tape directory to a file of your choice.

Your questions are good ones. You're thinking on the right track!

...JRF...
Patrick Wallek
Honored Contributor

Re: what if .. you deleted home dir ?

Depending on how you do your backup, you don't necessarily have to delete a file to be able to restore. You could just arbitrarily pick a file, and then restore it to some other directory, like /tmp. This will test your familiarity with the backup and restore process, and also test you to make sure you can restore a file to a different location. You may not always want to restore the file to its original location because a user may want to make sure a file is OK by checking the restored version against the version that is currently on the system.
William E. Sisson, Jr.
Occasional Advisor

Re: what if .. you deleted home dir ?

I pretty much agree with what everybody else has said here. Just wanted to point out that dump and vxdump work pretty darn well. These utilities allow you to do full and incremental backups locally to another disk/tape or across the network to another machine. I've been in this business for over ten years and its not a matter of IF I lose my data but WHEN.
John Bolene
Honored Contributor

Re: what if .. you deleted home dir ?

Most of our servers are cookie-cutter designed.
We use make_recovery -vAC -d /dev/rmt/0m to back up everything on the production terminal servers. Since these servers don't change much, we use the tape to restore any machine that has had a failure.
The other servers are backed up with Omniback.

The DNS servers, I just keep a tar backup of /etc/hosts and the /usr/local/domain directory. I can restore a server fairly quickly with just these files. The tar backup for all DNS machines is stored on all these machines so if any one of them fails, I can get the backup from one that is still living.
I run 15 DNS machines all around the world.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Dave Wherry
Esteemed Contributor

Re: what if .. you deleted home dir ?

Just to chime in with every one else, and they are all good points. As William said it is just a matter of when you will lose data. Whether you do it, a disgruntled employee, a user making a mistake or hardware failure, it will happen to you.
It's really about disaster recovery on different levels. If a user deletes their resume it's really not critical to the business. It might be a disaster to them, low level to you. If production data is lost it can be devastating to a business, and your career if you were responsible for the backups.
There are many ways to backup your data - fbackup, tar, cpio, dump, OmniBack and other packages. Use make_recovery to protect the OS.
There really is not a "standard" way to handle this. It depends on your system and environment. Does your data change often? If so, back it up often. Is the data static? You don't need to back it up as often. Many variables.
Since you started this thread with the possibility of /home being deleted, it brings me back to the disaster recovery and resume issues menioned earlier. If you have your resume on the system it likely would be in your home directory. As Tim said keep it up to date and remember the first item of a good disaster recovery plan is the off-site resume. It's protected.
Edgar Canaan
Occasional Advisor

Re: what if .. you deleted home dir ?

About backups and redundant hardware...have anybody worked with HP XP512 ??

Is is all they said???
In a world without walls there is no need for gates and windows...