ufsdump & ufsrestore
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2003-12-31 17:25:44
 

The ufsdump/ufsrestore command

ufsdump´Â tar¿Í ÇÔ²² °¡Àå ³Î¸® ¾²ÀÌ´Â Backup commandÀÌ´Ù. BackupÀ̶ó´Â Ãø¸é¿¡¼­¸¸ º»´Ù¸é tarº¸´Ù ¿©·¯°¡Áö ¸é¿¡¼­ À¯¿ëÇÑ commandÀÌ´Ù. tar¿Í ºñ±³¸¦ Çغ¸¸é ÀÏ´Ü, ufsdump´Â multi-volume backup ÀÌ °¡´ÉÇÏ´Ù. µû¶ó¼­ TapeÀÇ »ç¿ëÈ¿À²À» ³ôÀÏ ¼ö°¡ ÀÖ´Ù. ¶Ç, incremental backupÀ» ±âº»ÀûÀ¸·Î Áö¿øÇϱ⠶§¹®¿¡, Á¤±âÀûÀÎ backup ÇÁ·Î±×·¥À¸·Î´Â ´ëºÎºÐ ufsdump¸¦ »ç¿ëÇÑ´Ù.
tar¿Í ´Þ¸® ufsdump´Â FileSystem´ÜÀ§·Î BackupÀ» Çϱ⠶§¹®¿¡, Àüü backupÀ» Çϱâ À§Çؼ­´Â °¢°¢ÀÇ FileSystemÀ» ´Ù ¹é¾÷ ÇØ¾ß ÇÑ´Ù.

- backup
ufsdumpÀÇ »ç¿ë¹ýÀº ¾Æ·¡¿Í °°´Ù.
ufsdump [option] [argument] filesystem

option
0-9 Specify the dump level option. 0 is the lowest level(called the epoch level or a full dump), and level 9is the highest level.
u update the dump recrd(/etc/dumpdates) with the date and dump level of this file system backup
c Set the blocking factor to 126 for all catridge tape drives. This causes the dump to write 63-Kbyte records instead of the default 32-Kbyte records.
a Create an on-line archive of the file names dumped to tape.
f Specify the device to which the files are written. It requires an argument that is the device name.
v Verifies data on tape against data on file system.

argument
¿©±â¼­´Â targetÀÌ µÈ´Ù. ±âº»ÀûÀ¸·Î targetÀº /dev/rmt/0À¸·Î µÇ¾î ÀÖÁö¸¸, remote backupÀ̳ª, incremental backupÀ» À§Çؼ­´Â ÁöÁ¤ÀÌ ÇÊ¿äÇÏ´Ù.

¿¹ ) file system 1°³¸¦ tape 1¹ø° volume¿¡ backupÇÏ´Â ¿¹.
e250 [ root{63} ~ ] df -k
ÆÄÀϽýºÅÛ          K¹ÙÀÌÆ®    »ç¿ë    °¡¿ë  ¿ë·®    ¼³Ä¡ÁöÁ¡
/dev/dsk/c0t8d0s0      96975      10  87268    1%    /test_fs
e250 [ zeronine{5} ~ ] ls /test_fs
ÃÑ 18              16 lost+found/    0 nice            0 zero
  0 good            0 min            2 test
e250 [ root{64} ~ ] ufsdump 0uf /dev/rmt/0 /dev/dsk/c0t8d0s0
  DUMP: Writing 32 Kilobyte records
  DUMP: Date of this level 0 dump: 2001³â 4¿ù 30ÀÏ ¿ù¿äÀÏ ¿ÀÀü 11½Ã 45ºÐ 27ÃÊ
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t8d0s0 (e250:/test_fs) to /dev/rmt/0.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 132 blocks (66KB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: Tape rewinding
  DUMP: 126 blocks (63KB) on 1 volume at 1000 KB/sec
  DUMP: DUMP IS DONE
  DUMP: Level 0 dump on 2001³â 4¿ù 30ÀÏ ¿ù¿äÀÏ ¿ÀÀü 11½Ã 45ºÐ 27ÃÊ

¿¹) 2¹ø° volumeÀÇ ³»¿ë¿¡ backup À» ¼öÇàÇÏ´Â ¹ý
e250 [ root{76} /home/zeronine ] mt -f /dev/rmt/0 rew
e250 [ root{76} /home/zeronine ] mt -f /dev/rmt/0n fsf 1
e250 [ root{77} /home/zeronine ] ufsdump 0uf /dev/rmt/0n ./comtec
  DUMP: Writing 32 Kilobyte records
  DUMP: Date of this level 0 dump: 2001³â 5¿ù  2ÀÏ ¼ö¿äÀÏ ¿ÀÈÄ 06½Ã 40ºÐ 30ÃÊ
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t0d0s3 (e250:/home) to /dev/rmt/0n.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 1756 blocks (878KB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 1726 blocks (863KB) on 1 volume at 2458 KB/sec
  DUMP: DUMP IS DONE


- Restore
ufsrestoreÀÇ »ç¿ë¹ýÀº ¾Æ·¡¿Í °°´Ù.
ufsrestore [option] [source dump file] [volume number]

option
i Perform an interactive restore(ÇϳªÇϳª¾¿ ¹°¾î°¡¸é¼­ÇÏ´Â °Í)
r Restore the entire backup Àüü´Ù ¹é¾÷ÆÄÀÏÀ» restore
t List the table of contents of the backup.
x Restore only the files named on the command line.

a archive_file
Take the table of contents information from the named archive_file rather than the tape. Until you actually need to extract a file, the backup volume does not need to be mounted.
f dump_file
Specify a specific dump_file instead of the default /dev/rmt/0 as the file to restore from. Typically, the dump_file option specifies a tape or diskette drive, but it may be a disk file.

s n Skip to the dump_file indicated by the number and use it for the restoration.

v Display path names as they are being restored(verbose mode). Note that this sis different from the v(verify) option used with the ufsdump command.

restore½Ã¿¡´Â ¸í·ÉÀ» ¼öÇàÇÑ °÷À» ±âÁØÀ¸·Î(»ó´ë°æ·Î·Î) restoreÇϱ⠶§¹®¿¡, restoreÇÒ ¶§ ¸í·ÉÀ» ¼öÇàÇÒ Àå¼Ò¸¦ Àß ¼±ÅÃÇØ¾ß ÇÑ´Ù.

¿¹) restoreÇϱâ Àü¿¡ tape¿¡ backupµÈ ³»¿ëÀ» È®ÀÎÇÏ°í restoreÇÏ´Â ¹æ¹ý.
e250 [ zeronine{3} ~ ] ufsrestore tf /dev/rmt/0
        2      .
        3      ./lost+found
        4      ./min
        5      ./nice
        6      ./good
        7      ./zero
        8      ./test
e250 [ root{48} / ] mkdir test_fs_back
e250 [ root{49} / ] cd test_fs_back/
e250 [ root{50} /test_fs_back ] ls
ÃÑ 0
e250 [ root{51} /test_fs_back ] pwd
/test_fs_back

e250 [ root{52} /test_fs_back ] ufsrestore xf /dev/rmt/0
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 <-º¼·ýÀº "1"ºÎÅÍ ½ÃÀÛÀÌ´Ù.
set owner/mode for '.'? [yn] y
e250 [ root{53} /test_fs_back ] ls -l
ÃÑ 4
  0 -rw-r--r--  1 root    other          0  3¿ù 27ÀÏ  08:23 good
  2 drwx------  2 root    root        512  3¿ù 27ÀÏ  08:12 lost+found/
  0 -rw-r--r--  1 root    other          0  3¿ù 27ÀÏ  08:22 min
  0 -rw-r--r--  1 root    other          0  3¿ù 27ÀÏ  08:22 nice
  2 -rw-r--r--  1 root    other        17  4¿ù 30ÀÏ  11:44 test
  0 -rw-r--r--  1 root    other          0  3¿ù 27ÀÏ  08:23 zero

¿¹ ) interactiveÇÏ°Ô backupÀڷḦ º¹±¸ÇÏ´Â ¹æ¹ý
e250 [ root{82} /test_fs_back ] ls
ÃÑ 0
e250 [ root{83} /test_fs_back ] ufsrestore ivf /dev/rmt/0
Verify volume and initialize maps
Media block size is 64
Dump  date: Mon Apr 30 11:45:27 2001
Dumped from: the epoch
Level 0 dump of /test_fs on e250:/dev/dsk/c0t8d0s0
Label: none
Extract directories from tape
Initialize symbol table.
ufsrestore > ls
.:
    2 *./              6  good            4  min              8  test
    2 *../              3  lost+found/      5  nice            7  zero
ufsrestore > add test zero min
ufsrestore > ls
.:
    2 *./              6  good            4 *min              8 *test
    2 *../              3  lost+found/      5  nice            7 *zero
ufsrestore > delete min
ufsrestore > ls
.:
    2 *./              6  good            4  min              8 *test
    2 *../              3  lost+found/      5  nice            7 *zero
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 ./zero
extract file ./test
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] n
ufsrestore > quit
e250 [ root{84} /test_fs_back ] ls
ÃÑ 2          2 test      0 zero

¿¹) µÎ¹ø° volume¿¡ ÀÖ´Â ³»¿ëÀ» restoreÇÏ´Â ¹æ¹ý
e250 [ root{79} /home/zeronine ] mt -f /dev/rmt/0 rew
e250 [ root{80} /home/zeronine ] ufsrestore tsf /dev/rmt/0 1
Dump number must be a positive integer
e250 [ root{81} /home/zeronine ] ufsrestore tfs /dev/rmt/0 1
        2      .
        3      ./lost+found
        4      ./min
        5      ./nice
        6      ./good
        7      ./zero
        8      ./test
e250 [ root{82} /home/zeronine ] ufsrestore tfs /dev/rmt/0 2
        2      .
    33033      ./zeronine
    247697      ./zeronine/comtec
    247698      ./zeronine/comtec/messages
    247699      ./zeronine/comtec/vxprint_ht.result
    247700      ./zeronine/comtec/vxprint_ht_datadg.result
    247701      ./zeronine/comtec/tst_dsk.result
    247702      ./zeronine/comtec/tst_dsk_r.res
e250 [ root{90} /comtec_back ] pwd
/comtec_back
e250 [ root{91} /comtec_back ] ufsrestore xfs /dev/rmt/0 2
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
set owner/mode for '.'? [yn] n
e250 [ root{92} /comtec_back ] ls
ÃÑ 2              2 zeronine/
e250 [ root{93} /comtec_back ] cd zeronine
e250 [ root{94} /comtec_back/zeronine ] ls
ÃÑ 2            2 comtec/
e250 [ root{95} /comtec_back/zeronine ] cd comtec
e250 [ root{96} /comtec_back/zeronine/comtec ] ls
ÃÑ 1522                          240 tst_dsk_r.res
1248 messages                      8 vxprint_ht.result
  2 tst_dsk.result              24 vxprint_ht_datadg.result



How to Restore the root(/) File System

¸ÕÀú ufsdump¸¦ »ç¿ëÇÏ¿© / file systemÀ» ¹é¾÷ ¹Þ¾Æ ³õ°í ½ÃÀÛÇÑ´Ù.
1. Load and boot the release media to run level S.
  ok boot cdrom -s

2. Create the new file system, if necessary.

3. Check the file system with fsck

4. Mount the file system to /a and change to that directory
  # mount /dev/dsk/c0t3d0s0 /a
  # cd /a

5. Restore the root(/) file system.
  # ufsrestore rvf /dev/rmt/0

6. Remove the restoresymtable.

7. Run the installboot program to create the boot block.
  # cd /usr/platform/'uname -i'/lib/fs/ufs
  # installboot bootblk /dev/rdsk/c0t3d0s0

8. Unmount the new file system.
  # cd /
  # umount /a

9. Check the restored file system with fsck.
  # fsck /dev/rdsk/c0t3d0s0

10. Reboot the system.


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦