4. ufsrestore 명령어
4.1 Restoring Entire File System
blue# mount /dev/dsk/c0t0d0s7 /export/home
blue# cd /export/home
blue# mt -f /dev/rmt/0n fsf 1 -> 다음 point로 이동
blue# ufsrestore rvf /dev/rmt/0n
Verify volume and initialize maps
Media block size is 126
Dump date: Sat May 02 12:57:43 1998
Dumped from: the epoch
Level 0 dump of /export/home on blue:/dev/dsk/c0t0d0s7
Label: none
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Warning: ./lost+found: File exists
Make node ./cyberguy
Make node ./dsw
Make node ./dsw/core
Make node ./crash
Make node ./crash/blue
Make node ./test
Extract new leaves.
Check pointing the restore
extract file ./.CPR
extract file ./dsw/core/unix.2
extract file ./dsw/core/vmcore.2
extract file ./dsw/core/threadlist.0
extract file ./dsw/core/threadlist.2
extract file ./crash/blue/vmcore.0
extract file ./crash/blue/unix.0
extract file ./crash/blue/bounds
extract file ./crash/blue/threadlist.0.org
extract file ./crash/blue/threadlist.0
Add links
Set directory mode, owner, and times.
Check the symbol table.
Check pointing the restore
blue# pwd
/export/home
blue# ls
crash dsw restoresymtable
cyberguy lost+found test
blue# rm restoresymtable
4.2 ineractive restore
blue# cd /var/tmp
blue# ufsrestore ivf /dev/rmt/0
Verify volume and initialize maps
Media block size is 126
Dump date: Mon May 11 14:33:16 1998
Dumped from: the epoch
Level 0 dump of /user on blue:/dev/dsk/c0t1d0s3
Label: none
Extract directories from tape
Initialize symbol table.
ufsrestore > ls
.:
2 *./ 2 *../ 3 lost+found/ 4 passwd
ufsrestore > cd lost+found
ufsrestore > cd /
ufsrestore > add passwd lost+found
ufsrestore > verbose
verbose mode off
ufsrestore > verbose
verbose mode on
ufsrestore> delete lost+found
ufsrestore > ls
.:
2 *./ 2 *../ 3 lost+found/ 4 *passwd
ufsrestore > extract
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./passwd
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] n
ufsrestore > quit
4.3 restore files
# ufsrestore xvf /dev/rmt/0 ./etc/passwd
4.4 display the content of the tape
# ufsrestore tvf /dev/rmt/0
5. cpio commands
blue# find . -print | cpio -ovcB > /dev/rmt/0 -> 현디렉토리의 내용을 tape로 backup 받는다.
.
upgrade
upgrade/Agree.ps
upgrade/Announcement.ps
upgrade/Program.ps
upgrade/Refund.ps
upgrade/URCFORM.ps
array
array/DECptscII
array/DECptscII/pkgmap
array/DECptscII/pkginfo
array/DECptscII/root
array/DECptscII/root/kernel
array/DECptscII/root/kernel/drv
array/DECptscII/root/kernel/drv/classes
array/DECptscII/root/kernel/drv/ptscII.52
array/DECptscII/root/kernel/drv/ptscII.53
array/DECptscII/install
array/DECptscII/install/copyright
array/DECptscII/install/postinstall
array/DECptscII/install/preremove
array/DECstgwks
array/DECstgwks/pkgmap
array/DECstgwks/pkginfo
array/DECstgwks/root
array/DECstgwks/root/$TRANSDIR
array/DECstgwks/root/$TRANSDIR/sd.conf
array/DECstgwks/root/$TRANSDIR/trans.Z
array/DECstgwks/root/$TRANSDIR/trans.conf
blue# cpio -ivcB array/DECstgwks/install/space < /dev/rmt/0 -> tape에서 space file을 extract한다.
array/DECstgwks/install/space
8550 blocks
blue# find . -mtime -7 -print | cpio -ovcB > /dev/rmt/0n -> 최근 일주일내에 수정된 file을 tape로 받는다.
.
upgrade
upgrade/Agree.ps
upgrade/Announcement.ps
upgrade/Program.ps
upgrade/Refund.ps
blue# find . -name 'file*' -print | cpio -ovcB > file.list
blue# cpio -ivt < file.list
6. Backup script sample
#!/bin/csh
set verbose
set day = `date +%y%m%d`
mt -f /dev/rmt/0n rew
ufsdump 0uf /dev/rmt/0bn /
ufsdump 0uf /dev/rmt/0bn /usr
ufsdump 0uf /dev/rmt/0bn /var
ufsdump 0uf /dev/rmt/0bn /export/home
ufsdump 0uf /dev/rmt/0bn /opt
echo "now test the backups."
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 1 > /export/home/bert/dumpfile1.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 2 > /export/home/bert/dumpfile2.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 3 > /export/home/bert/dumpfile3.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 4 > /export/home/bert/dumpfile4.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 5 > /export/home/bert/dumpfile5.${day}
7. Sun O/S backup parameter
High density Fujitsu/Xylogics 1/2" tape
# dump 0uf /dev/rmt8 /dev/rxy0
600' QIC-24 9 track 1/4" cartridge tape
# dump 0ucf /dev/nrst8 /dev/rds0h
QIC-150 18 track 1/4" catridge tape:
# dump 0ucsf 1500 /dev/rst0 /dev/rsd0h
Exabyte 8mm catridge tape:
# dump 0usf 145000 /dev/rst0 /dev/rid001h
4.1 Restoring Entire File System
blue# mount /dev/dsk/c0t0d0s7 /export/home
blue# cd /export/home
blue# mt -f /dev/rmt/0n fsf 1 -> 다음 point로 이동
blue# ufsrestore rvf /dev/rmt/0n
Verify volume and initialize maps
Media block size is 126
Dump date: Sat May 02 12:57:43 1998
Dumped from: the epoch
Level 0 dump of /export/home on blue:/dev/dsk/c0t0d0s7
Label: none
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Warning: ./lost+found: File exists
Make node ./cyberguy
Make node ./dsw
Make node ./dsw/core
Make node ./crash
Make node ./crash/blue
Make node ./test
Extract new leaves.
Check pointing the restore
extract file ./.CPR
extract file ./dsw/core/unix.2
extract file ./dsw/core/vmcore.2
extract file ./dsw/core/threadlist.0
extract file ./dsw/core/threadlist.2
extract file ./crash/blue/vmcore.0
extract file ./crash/blue/unix.0
extract file ./crash/blue/bounds
extract file ./crash/blue/threadlist.0.org
extract file ./crash/blue/threadlist.0
Add links
Set directory mode, owner, and times.
Check the symbol table.
Check pointing the restore
blue# pwd
/export/home
blue# ls
crash dsw restoresymtable
cyberguy lost+found test
blue# rm restoresymtable
4.2 ineractive restore
blue# cd /var/tmp
blue# ufsrestore ivf /dev/rmt/0
Verify volume and initialize maps
Media block size is 126
Dump date: Mon May 11 14:33:16 1998
Dumped from: the epoch
Level 0 dump of /user on blue:/dev/dsk/c0t1d0s3
Label: none
Extract directories from tape
Initialize symbol table.
ufsrestore > ls
.:
2 *./ 2 *../ 3 lost+found/ 4 passwd
ufsrestore > cd lost+found
ufsrestore > cd /
ufsrestore > add passwd lost+found
ufsrestore > verbose
verbose mode off
ufsrestore > verbose
verbose mode on
ufsrestore> delete lost+found
ufsrestore > ls
.:
2 *./ 2 *../ 3 lost+found/ 4 *passwd
ufsrestore > extract
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./passwd
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] n
ufsrestore > quit
4.3 restore files
# ufsrestore xvf /dev/rmt/0 ./etc/passwd
4.4 display the content of the tape
# ufsrestore tvf /dev/rmt/0
5. cpio commands
blue# find . -print | cpio -ovcB > /dev/rmt/0 -> 현디렉토리의 내용을 tape로 backup 받는다.
.
upgrade
upgrade/Agree.ps
upgrade/Announcement.ps
upgrade/Program.ps
upgrade/Refund.ps
upgrade/URCFORM.ps
array
array/DECptscII
array/DECptscII/pkgmap
array/DECptscII/pkginfo
array/DECptscII/root
array/DECptscII/root/kernel
array/DECptscII/root/kernel/drv
array/DECptscII/root/kernel/drv/classes
array/DECptscII/root/kernel/drv/ptscII.52
array/DECptscII/root/kernel/drv/ptscII.53
array/DECptscII/install
array/DECptscII/install/copyright
array/DECptscII/install/postinstall
array/DECptscII/install/preremove
array/DECstgwks
array/DECstgwks/pkgmap
array/DECstgwks/pkginfo
array/DECstgwks/root
array/DECstgwks/root/$TRANSDIR
array/DECstgwks/root/$TRANSDIR/sd.conf
array/DECstgwks/root/$TRANSDIR/trans.Z
array/DECstgwks/root/$TRANSDIR/trans.conf
blue# cpio -ivcB array/DECstgwks/install/space < /dev/rmt/0 -> tape에서 space file을 extract한다.
array/DECstgwks/install/space
8550 blocks
blue# find . -mtime -7 -print | cpio -ovcB > /dev/rmt/0n -> 최근 일주일내에 수정된 file을 tape로 받는다.
.
upgrade
upgrade/Agree.ps
upgrade/Announcement.ps
upgrade/Program.ps
upgrade/Refund.ps
blue# find . -name 'file*' -print | cpio -ovcB > file.list
blue# cpio -ivt < file.list
6. Backup script sample
#!/bin/csh
set verbose
set day = `date +%y%m%d`
mt -f /dev/rmt/0n rew
ufsdump 0uf /dev/rmt/0bn /
ufsdump 0uf /dev/rmt/0bn /usr
ufsdump 0uf /dev/rmt/0bn /var
ufsdump 0uf /dev/rmt/0bn /export/home
ufsdump 0uf /dev/rmt/0bn /opt
echo "now test the backups."
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 1 > /export/home/bert/dumpfile1.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 2 > /export/home/bert/dumpfile2.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 3 > /export/home/bert/dumpfile3.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 4 > /export/home/bert/dumpfile4.${day}
mt -f /dev/rmt/0n rew;ufsrestore tfs /dev/rmt/0n 5 > /export/home/bert/dumpfile5.${day}
7. Sun O/S backup parameter
High density Fujitsu/Xylogics 1/2" tape
# dump 0uf /dev/rmt8 /dev/rxy0
600' QIC-24 9 track 1/4" cartridge tape
# dump 0ucf /dev/nrst8 /dev/rds0h
QIC-150 18 track 1/4" catridge tape:
# dump 0ucsf 1500 /dev/rst0 /dev/rsd0h
Exabyte 8mm catridge tape:
# dump 0usf 145000 /dev/rst0 /dev/rid001h