Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System and data backup for Solaris 2.6

Status
Not open for further replies.

victorgo

ISP
Dec 19, 2000
10
HK
1. How can I Backup all the system and data files to tape drive with solaris 2.6.
2. How can I use Server with Tape drive to backup another systems.

Thanks.
 
1. look at 'ufsdump' and 'ufsrestore' ... they're great tools ...

(also look at the 'mt' command)

this allows incremental backups (saving only files that have changed since the last backup)

another alternative that we use is the 'tar' command directly to the tape device.

I have heard of people using 'cpio' but this seems far to difficult to me :)

2. if the device can be accessed on the remote system, it is possible to backup that system if ... (you really shouldn't do this if you can help it) you have a '.rhosts' file for root on the machine with the tape drive ... and you can use ufsdump and ufsrestore to access it ...

...


Hmm.
 
I am looking into using ufsdump/ufsrestore, from my understanding you must either have the system in single user mode (run level 1), or unmount the file systems to use the command. From personal experience this is correct but everytime I try to unmount '/export/home' I get a device busy. If no one is on the system using the home directory, then what is the problem? Do I still have to switch to run level 2? I don't wish to do this as we have a backup operator who doesn't know much.

Any help is appreciated, thanks.

- Stuart
 
ok ... you don't really need to switch to a different run level to do backups ...

however if you are ever doing a level 0 dump then it is advisable, since this is your base backup

i'll copy an example of one of our files. (this is the full system backup):

Code:
#
#       /
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s0
#
#       /usr/openwin
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s1
#
#       /var
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s3
#
#       /opt
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s5
#
#       /usr
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s6
#
#       /export/home
ufsdump 0fu /dev/rmt/1n /dev/dsk/c0t0d0s7
#
#       eject tape
mt -f /dev/rmt/1 offline

we go down to 'init S' to run the full system backup ... but we don't change the init state for each of the other backups

the same style of file is run each thursday; with a minor change ... the level 1 backup is used '1fu'
on friday level 2 is used (but without the eject at the end)
monday; level 3
tuesday; level 4
wednesday; level 5

so that it repeats automatically (using crontab):
0 23 * * 1 /dumpmonday
0 23 * * 2 /dumptuesday
0 23 * * 3 /dumpwednesday
0 23 * * 4 /dumpthursday
0 23 * * 5 /dumpfriday

we have 10 weeks of repeated weeklies, and then do a manual full backup

hope that helps.
 
victorgo:

I agree with jad regarding system and filesystem backups.

To backup other (remote) systems this works great - spacing and upper/lower case of the parameters is critical - type it carefully & correctly:

On the remote host type: tar cvfb - 20 filename/directory | rsh remote-hostname dd of=/dev/rmt/0 obs=20b Al
 
you do know what the difference between /dev/rmt/0 and /dev/rmt/0n is don't you ?

the n meants that it's a no-rewind device (ie doesn't rewind when it's finished writing to the tape.)
very useful if you're wanting to store a weeks worth of backups on the same tape. (this also works for tar)
 
Jad:

Gee, how observant, but my example was for one (1) copy, not a week's worth. Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top