tar¿Í ufsdump¸¦ ÀÌ¿ëÇÑ disk-to-disk copy
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2003-10-23 21:06:10
 

tar¿Í ufsdump¸¦ ÀÌ¿ëÇÑ disk-to-disk copy
Á¦°ø : howtosolaris.com
uname –a ¸í·É¾î·Î ³ª¿Â °á°ú¸¦ ²À ¿Ü¿ì°í °¡¼Å¾ß ÈĹݺο¡ ÀÌÇØ°¡ µË´Ï´Ù.

[1] system downÀ» ½ÃÄÑ ok prompt (prom mode) ·Î ÇÕ´Ï´Ù.

# init 0

[2] Scsi device¸¦ È®ÀÎ ÇÑ´Ù.

OK probe-scsi

´Ù¸¥ scsi controller °¡ ÀÖ´Ù¸é ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù.

OK probe-scsi-all

[3] ±âÁ¸ÀÇ µð½ºÅ©¿Í »õ·Î¿î µð½ºÅ©¸¦ ´ÙÀ½°ú °°ÀÌ Á¤ÀÇ ÇÑ´Ù.
T3 ( target 3 ) ÇöÀç OS°¡ ÀÖ´Â µð½ºÅ©
T1 ( target 1 ) »õ·Î¿î µð½ºÅ©

[4]

OK boot -rv


[5.] system ºÎÆÃÈÄ formatÀ» ÇÑ´Ù.
(¿¹Á¦):

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:

1. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@1,
0
2. c0t3d0 <SUN0535 cyl 1866 alt 2 hd 7 sec 80>
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,
0
Specify disk (enter its number): 1
selecting c0t1d0
[disk formatted]


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format> part

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
quit
partition> print

Current partition table (original):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 203 100.41MB (204/0/0) 205632
1 swap wu 204 - 407 100.41MB (204/0/0) 205632
2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 var wm 408 - 611 100.41MB (204/0/0) 205632
5 unassigned wm 612 - 1018 200.32MB (407/0/0) 410256
6 usr wm 1019 - 2034 500.06MB (1016/0/0) 1024128
7 unassigned wm 0 0 (0/0/0) 0


partition>

****** Modify partitions to suit your needs ******
****** Do NOT alter partition 2, backup !!! ******

In this example we'll go with the current displayed partition table listed:

partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 162 80.23MB (163/0/0) 164304

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: o
`o' is not an integer.
Enter new starting cyl[0]: 0
Enter partition size[164304b, 163c, 80.23mb, 0.08gb]: 100.41mb
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 203 100.41MB (204/0/0) 205632
1 unassigned wu 163 - 423 128.46MB (261/0/0) 263088
2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 424 - 749 160.45MB (326/0/0) 328608
5 unassigned wm 750 - 1109 177.19MB (360/0/0) 362880
6 unassigned wm 1110 - 2035 455.77MB (926/0/0) 933408
7 unassigned wm 0 0 (0/0/0) 0

partition> 1
Part Tag Flag Cylinders Size Blocks
1 unassigned wu 163 - 423 128.46MB (261/0/0) 263088

Enter partition id tag[unassigned]:
Enter partition permission flags[wu]:
Enter new starting cyl[163]: 204
Enter partition size[263088b, 261c, 128.46mb, 0.13gb]: 100.41mb
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 203 100.41MB (204/0/0) 205632
1 unassigned wu 204 - 407 100.41MB (204/0/0) 205632
2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 424 - 749 160.45MB (326/0/0) 328608
5 unassigned wm 750 - 1109 177.19MB (360/0/0) 362880
6 unassigned wm 1110 - 2035 455.77MB (926/0/0) 933408
7 unassigned wm 0 0 (0/0/0) 0

partition> 4
Part Tag Flag Cylinders Size Blocks
4 unassigned wm 424 - 749 160.45MB (326/0/0) 328608

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[424]: 408
Enter partition size[328608b, 326c, 160.45mb, 0.16gb]: 100.41mb
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 203 100.41MB (204/0/0) 205632
1 unassigned wu 204 - 407 100.41MB (204/0/0) 205632
2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 408 - 611 100.41MB (204/0/0) 205632
5 unassigned wm 750 - 1109 177.19MB (360/0/0) 362880
6 unassigned wm 1110 - 2035 455.77MB (926/0/0) 933408
7 unassigned wm 0 0 (0/0/0) 0

partition> 5
Part Tag Flag Cylinders Size Blocks
5 unassigned wm 750 - 1109 177.19MB (360/0/0) 362880

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[750]: 612
Enter partition size[362880b, 360c, 177.19mb, 0.17gb]: 177mb
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 203 100.41MB (204/0/0) 205632
1 unassigned wu 204 - 407 100.41MB (204/0/0) 205632
2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 408 - 611 100.41MB (204/0/0) 205632
5 unassigned wm 612 - 971 177.19MB (360/0/0) 362880
6 unassigned wm 1110 - 2035 455.77MB (926/0/0) 933408
7 unassigned wm 0 0 (0/0/0) 0


partition> 6
Part Tag Flag Cylinders Size Blocks
6 unassigned wm 1110 - 2035 455.77MB (926/0/0) 933408

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[1110]: 972
Enter partition size[933408b, 926c, 455.77mb, 0.45gb]: $
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 2036 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 203 100.41MB (204/0/0) 205632
1 unassigned wu 204 - 407 100.41MB (204/0/0) 205632
2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 408 - 611 100.41MB (204/0/0) 205632
5 unassigned wm 612 - 971 177.19MB (360/0/0) 362880
6 unassigned wm 972 - 2035 523.69MB (1064/0/0) 1072512
7 unassigned wm 0 0 (0/0/0) 0

partition> label
partition> q
format> q

< ÁÖÀÇ >±âÁ¸ÀÇ OSÆÄƼ¼Ç°ú »õ·Î¿î µð½ºÅ©ÀÇ ÆÄƼ¼ÇÀ» °°°Ô ÇÑ´Ù.


c0t3d0 ( Solaris 2.6ÀÌ ÀνºÅç µÇ¾î ÀÖÀ½ ) À» c0t1d0 ( t3 diskÀÇ Solaris 2.6 slices/partitionsÀ» copyÇÒ µð½ºÅ© )
´ÙÀ½°ú °°Àº ÀÛ¾÷À» ÇÒ °ÍÀÌ´Ù.
c0t3d0s0 / -> c0t1d0s0 / º¹»çÇÏ°í
c0t3d0s4 /var -> c0t1d0s4 /var º¹»çÇÏ°í
c0t3d0s5 /opt -> c0t1d0s5 /opt º¹»çÇÏ°í
c0t3d0s6 /usr -> c0t1d0s6 /usr º¹»ç ÇÒ °ÍÀÔ´Ï´Ù


[6] »õ·Î¿î µð½ºÅ©¸¦ ¸¶¿îÆ® ÇϱâÀ§ÇØ newfs (new file system)¸¦ ½ÇÇà ÇÕ´Ï´Ù.


°¢°¢ÀÇ ÆÄƼ¼ÇÀ» ´ÙÀ½°ú °°ÀÌ ½ÇÇà ÇÕ´Ï´Ù.

# newfs -v /dev/rdsk/c0t1d0s0
# newfs -v /dev/rdsk/c0t1d0s4
# newfs -v /dev/rdsk/c0t1d0s5
# newfs -v /dev/rdsk/c0t1d0s6


[7] fsck ¸¦ ½ÇÇà ½ÃÄѼ­ ¸¶¿îÆ®¸¦ ¼øÁ¶·Ó°Ô ÇÕ´Ï´Ù.

# fsck /dev/rdsk/c0t1d0s0
# fsck /dev/rdsk/c0t1d0s4
# fsck /dev/rdsk/c0t1d0s5
# fsck /dev/rdsk/c0t1d0s6

[8] ¸¶¿îÆ® Æ÷ÀÎÆ® µð·ºÅ͸®¸¦ ¸¸µì´Ï´Ù.

±âÁ¸ µð½ºÅ©ÀÇ ÆÄƼ¼Ç ¼ö¸¸Å­ µð·ºÅ͸®¸¦ ¸¸µì´Ï´Ù.

# mkdir /root2
# mkdir /var2
# mkdir /opt2
# mkdir /usr2

[9] »õ·Î¿î ÆÄƼ¼ÇÀ» À§¿¡¼­ ¸¸µé¾î ³õÀº µð·ºÅ͸®·Î ¸¶¿îÆ® ÇÕ´Ï´Ù.

# mount /dev/dsk/c0t1d0s0 /root2
# mount /dev/dsk/c0t1d0s4 /var2
# mount /dev/dsk/c0t1d0s5 /opt2
# mount /dev/dsk/c0t1d0s6 /usr2

[10] ÀÌÁ¦ºÎÅÍ ¿Å±é´Ï´Ù ~~

# cd /
# ufsdump 0f - /dev/rdsk/c0t3d0s0 | (cd /root2; ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t3d0s4 | (cd /var2; ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t3d0s5 | (cd /opt2; ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t3d0s6 | (cd /usr2; ufsrestore xf -)

# cd /usr
# ufsdump 0f - /usr | (cd /usr2; ufsrestore xf - )


DUMP: Writing 32 Kilobyte records
DUMP: Date of this level 0 dump: Wed Dec 10 17:33:42 1997
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t3d0s0 (tmpdns:/usr) to standard output
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 317202 blocks (154.88MB)
DUMP: Dumping (Pass III) [directories]
DUMP: Broken pipe
DUMP: The ENTIRE dump is aborted


[11] fsck¸¦ ½ÇÇà Çؼ­ º¹»çÇÑ µð½ºÅ©¸¦ Á¤¸® ÇÕ´Ï´Ù.

# fsck /dev/rdsk/c0t1d0s0
# fsck /dev/rdsk/c0t1d0s4
# fsck /dev/rdsk/c0t1d0s5
# fsck /dev/rdsk/c0t1d0s6

[12.] »õ·Î¿î µð½ºÅ©ÀÇ /mount_point/etc/vfstab ÆÄÀÏÀ» ¼öÁ¤ ÇÕ´Ï´Ù.

# cd /root2 (±âÁ¸ÀÇ t3ºÎºÐÀ» t1À¸·Î ¹Ù²ß´Ï´Ù.)
# vi /root2/etc/vfstab

ÁÖÀÇ Çϼ¼¿ä !!
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t1d0s1 - - swap - no -
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no -
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 1 no -
/dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /var ufs 1 no -
/dev/dsk/c0t1d0s5 /dev/rdsk/c0t1d0s5 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -

:wq!

[13] ÀÌÁ¦´Â »õ·Î¿î µð½ºÅ©¿¡ installboot À» »ç¿ëÇÏ¿© bootblk À» ¼³Á¤ÇÏ´Â ÀÛ¾÷
ÀÔ´Ï´Ù.
½Ã½ºÅÛÀ» halt ÇÏ½Ã°í ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.

ok boot cdrom -sw

Solaris 2.5 ³ª ±× ÀÌ»óÀÇ ¹öÀüÀº ÀÌ·¸°Ô ÇÏ½Ã¸é µË´Ï´Ù.
/usr/platform/`uname -i`/lib/fs/ufs/bootblk
<ÁÖÀÇ> À§¿¡¼­ ¡®uname &#8211;a`´Â ½Ã½ºÅÛ ±¸µ¿½Ã¿¡ È®ÀÎÇÑ ½Ã½ºÅÛ »ç¾çÀ» ÀÇ¹Ì ÇÕ´Ï´Ù.

Solaris 2.4 ³ª ±× ÀÌÇÏ ¹öÀüÀº ÀÌ·¸°Ô Çϼ¼¿ä
/usr/lib/fs/ufs/bootblk

Solaris 2.5 ÀÌ»óÀÌ¶ó °¡Á¤ ÇÏ°í ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
/dev/rdsk/c0t1d0s0


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