Can anyone please tell me how safe is the following backup script?
Does it really backing up the WHOLE system or just part of it?
I do that with the system running an oracle database.
Will I be able to restore the system in case of a fault?
The problem is that I can not shut down the database,
needs to be up 24/7.
I know there are some other utilities for that, but I would like to know if it's a full system back up (0 level)
why when I try to ufsrestore interactivily I only see the / (root)level ?
The trailing n in /dev/rmt/0cn means "no rewind". This means that there is no automativ rewind of the tape when the file is closed. So your first statement does an explicit rewind to get the tape at the beginning.
Then the next command backs up root. When it finishes, the tape is left positioned after the root backup.
Then you backup the /usr filesystem. And so on.
So you have several backups on one tape. When you put the tape on and do a ufsrestore, you see only the first backup.
Want to see the second backup? Do:
mt -f /dev/rmt/0cn fsf 1
first. This will skip the first backup and leave you positioned at the second.
mt -f /dev/rmt/0cn rewind // no rewind, so I have everything in the same dat tape
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s0 //mounted on /
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s3 //mounted on /var
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s4 //mounted on /home
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s5 //mounted on /u01
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s0 //mounted on /u02
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s1 //mounted on /u03
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s3 //mounted on /u04
</pre>
So the above commands back up the root filesystem. When it finishes, the tape is left positioned after the root backup.
How do I backup the rest (inside files). I mean when for instance I backup /var/ does this mean that I back up everything inside the /var directory including all the sub-directories?
So I have several backups on the same tape. When I put the tape on and do a ufsrestore, you see only the first backup.(I suppose I have to rewind the tape before the restore , correct?
"Want to see the second backup? Do:
<pre>
mt -f /dev/rmt/0cn fsf 1
</pre>
first. This will skip the first backup and leave you positioned at the second."
what happens when I do a ufsrestore -i
Am I able to choose ??
Hi if you,re using ufsrestore -ivf you got into the first filesystem backed up if you want to see the next one you just type "q" wait for a while and automatically the rmt device got forward the next filesystem.
Information about what filesystem you are step in is displayed at the begining of the next rmt reading so you can read if it is /usr or /var etc
if you're using the same tape for variuos backups then you do not need to rewind the tape if not, rewind it at all and run your script.
Your script is ok BUT if you cant stop DB runing for God's (and you) sake you Must be sure that nobody is logged in even in a telnet session this will avoid garbage in your backup.
1) Yeah ufsdump will get all the files and subdirectories of /var provided that they are all in the same filesystem. If you create a separate mounted volume called /var/adm, well now you have to dump that separately. When you back up root, you get all of /bin and /lib, and so on. But you you still need /usr and /var as separate runs.
2) Yeah, you would need a rewind if you go to the restore immediately after the backup. Usually the restore comes long after the tape has been removed from the drive.
3) Yeah, the -i will let you pick and choose...a very cool feature.
We better go back a review filesystems here. When most kernels boot they initialize the system by automatically mounting root and they fire up init and a few other processes. At this point, the only thing mounted is root:
/dev/dsk/c0t0d0s0 1987399 935141 992637 49% /
If you are going into single user mode, it stops here and that is all you see. If you examined /var or /usr you would only have empty directiores since they are not yet mounted. All of the subdirecties and files that we do see are on /dev/dsk/c0t0d0s0.
But we have another disk device called c0t0d0s3 which we can now mount on /var. Once we do that we suddenly see /var/spool spring into existence. But /var/spool is on c0t0d0s3 while /etc/mail is on c0t0d0s0. They may seem to equally situated in some respects, but the difference is important.
Most people also will have a separate /usr filesystem. Looking again, I see that you don't. So I misspoke earlier when I said that you also needed /usr. In your case, you don't. You could possibly configure your system to only have one very large root filesystem...if you did, one ufsdump would do it all.
When you tell ufsdump to save a copy of c0t0d0s0, that is what it does. Sure it will pick up the /var empty directory that root uses as a mount point, but nothing under /var will be there. That's why we need another run of ufsdump to also save a copy of c0t0d0s3.
The 'kernel' and 'init' issues was a good lesson, things that already new. I appreciate the correction though, now everything is clear. You really confused me when you said that I had to backup /usr as well, beacause I have already gave my file systems (partitions)above.
The reason that I didn't use one large file system is only for reduntancy.
Thank you very much for your help.