How To Do A Disk To Disk Copy-Backup UFSDUMP
How To Do A Disk To Disk Copy-Backup UFSDUMP
2.X October
28, 2008
# init 0
# probe-scsi
# probe-scsi-all
[3.] Attach the new disk with the correct target setting. Run probe-scsi
again to make sure the system sees it. If it doesn't, the disk is
either
not connected properly, has a target conflict, or is defective.
Resolve
this issue before continuing.
# boot -rv
# format
Searching for disks...done
/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
partition>
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 162 80.23MB (163/0/0)
164304
partition> 1
Part Tag Flag Cylinders Size Blocks
1 unassigned wu 163 - 423 128.46MB (261/0/0)
263088
partition> 4
Part Tag Flag Cylinders Size Blocks
4 unassigned wm 424 - 749 160.45MB (326/0/0)
328608
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)
partition> 6
Part Tag Flag Cylinders Size Blocks
6 unassigned wm 1110 - 2035 455.77MB (926/0/0)
933408
NOTE: You will know for certain that your partitioning is correct
if
you add all the cylinder values [the values enclosed in ( )],
like so, 204+204+204+360+1064=2036 which is the same value
for
slice 2 or the whole disk (Tag = backup).
Now label the disk. This is important as this is what saves the
partition table in your VTOC (Virtual Table Of Contents).
It's also always recommended to do the labeling part twice to
be certain that the VTOC gets saved.
partition> label
partition> q
format> q
[6.] For each of the partitions that you wish to mount, run newfs to
contruct a unix filesystem.
# newfs -v /dev/rdsk/c0t1d0s0
# newfs -v /dev/rdsk/c0t1d0s4
# newfs -v /dev/rdsk/c0t1d0s5
# newfs -v /dev/rdsk/c0t1d0s6
# fsck /dev/rdsk/c0t1d0s0
# fsck /dev/rdsk/c0t1d0s4
# fsck /dev/rdsk/c0t1d0s5
# fsck /dev/rdsk/c0t1d0s6
# cd /
(Just ensures that you are in the root's parent/top directory).
The gotcha here is that you can't really specify the directory name
as ufsdump will interpret it as not being a block or character
device.
To illustrate this error:
# cd /usr
# ufsdump 0f - /usr | (cd /usr2; ufsrestore xf - )
Example:
# cd /usr
# tar cvfp - . | (cd /usr2; tar xvfp - )
# fsck /dev/rdsk/c0t1d0s0
# fsck /dev/rdsk/c0t1d0s4
# fsck /dev/rdsk/c0t1d0s5
# fsck /dev/rdsk/c0t1d0s6
# cd /root2
# vi /root2/etc/vfstab
:wq!
# installboot
/cdrom/solaris_2_5_sparc/s0/export/exec/sparc.Solaris_2.5 \
/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0txd0s0
[14.] Now create an alias for the other disk (this may be existent if
it's off of the onboard/first scsi controller).
ok> probe-scsi
ok> devalias
By default this will always boot from the new disk. If you want to
boot from
the old disk you can manually tell it to boot to that alias, like
so:
ok> boot disk
or
ok> boot disk3
(This will boot off from any Target 3/scsi id 3 internal disk).
Also see INFODOC #'s 14046, 11855, 11854 for setting different
boot devalias'es.
# cd /tmp/dev
# tar cvfp - . | (cd /a/dev; tar xvfp - )
# cd /tmp/devices
# tar cvfp - . | (cd /a/devices; tar xvfp - )
# cd /tmp/root/etc
# cp path_to_inst /a/etc/path_to_inst
# reboot -- -rv
[15.] If you plan to move this new disk you copied the OS on, you
MUST ensure that it will be moved to a similar architecture
and machine type as hardware address paths are usually
different from one machine to another.
For more details on why you can't move Solaris 2.X boot disk
between machines please see INFODOC 13911 and 13920.
Also ensure that you have the correct hostname, IP address and
vfstab entries for this new drive if you plan to move it to
another machine.
About these ads