- Layout the partitions on the new hard drive
Code: Select all
%format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848> /pci@1c,600000/scsi@2/sd@0,0 1. c1t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848> /pci@1c,600000/scsi@2/sd@1,0 Specify disk (enter its number): 0 selecting c1t0d0 [disk formatted] Warning: Current Disk has mounted partitions. 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 !<cmd> - execute <cmd>, then return quit partition> p Current partition table (original): Total disk cylinders available: 14087 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 1030 10.01GB (1031/0/0) 20982912 1 swap wu 1031 - 1443 4.01GB (413/0/0) 8405376 2 backup wu 0 - 14086 136.71GB (14087/0/0) 286698624 3 unassigned wm 1444 - 2062 6.01GB (619/0/0) 12597888 4 unassigned wm 2063 - 3093 10.01GB (1031/0/0) 20982912 5 unassigned wm 3094 - 5154 20.00GB (2061/0/0) 41945472 6 usr wm 5155 - 14084 86.66GB (8930/0/0) 181743360 7 unassigned wm 14085 - 14086 19.88MB (2/0/0) 40704
- Make new file systems
Code: Select all
newfs -F ufs /dev/rdsk/c1t0d0s0 newfs -F ufs /dev/rdsk/c1t0d0s3 newfs -F ufs /dev/rdsk/c1t0d0s4 newfs -F ufs /dev/rdsk/c1t0d0s5 newfs -F ufs /dev/rdsk/c1t0d0s6
- Mount the partitions to temp directories
Code: Select all
mkdir /newroot mount -F ufs /dev/dsk/c1t0d0s0 /newroot mkdir /newvar mount -F ufs /dev/dsk/c1t0d0s3 /newvar mkdir /newusr mount -F ufs /dev/dsk/c1t0d0s4 /newusr mkdir /newruser mount -F ufs /dev/dsk/c1t0d0s5 /newuser mkdir /newapps mount -F ufs /dev/dsk/c1t0d0s6 /newapps
- Migrate data from existing disk to the new disk
Code: Select all
ufsdump 0f - /dev/rdsk/c1t1d0s0 | (cd /newroot; ufsrestore xf -) ufsdump 0f - /dev/rdsk/c1t1d0s3 | (cd /newvar; ufsrestore xf -) ufsdump 0f - /dev/rdsk/c1t1d0s4 | (cd /newusr; ufsrestore xf -) ufsdump 0f - /dev/rdsk/c1t1d0s5 | (cd /newuser; ufsrestore xf -) ufsdump 0f - /dev/rdsk/c1t1d0s6 | (cd /newapps; ufsrestore xf -) ufsdump 0f - /dev/rdsk/c1t1d0s7 | (cd /newuser/www; ufsrestore xf -)
- Install boot block
Code: Select all
cd /usr/platform/`uname -m`/lib/fs/ufs installboot ./bootblk /dev/rdsk/c1t0d0s0
After the above steps, the new HD has been made a bootable disk.
The remaining task is to properly update /etc/vfstab to reflect the new partitions.
IMPORTANT: If /etc/vfstab has c1t1d0sX partitions as mount points while booting up from c1t0d0 (or vice versa), it will cause the "read-only" file system and nothing can be written to the file system including root user. Some of the system log files can not be updated and the system will not come up completely. This is a hard lesson I learned from my mistakes. Do not follow my steps.

/etc/vfstab:
Code: Select all
#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 logging
fd - /dev/fd fd - no -
/proc - /proc proc - no -
#/dev/dsk/c1t1d0s1 - - swap - no -
/dev/dsk/c1t0d0s1 - - swap - no -
#/dev/dsk/c1t1d0s0 /dev/rdsk/c1t1d0s0 / ufs 1 no logging
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no logging
#/dev/dsk/c1t1d0s4 /dev/rdsk/c1t1d0s4 /usr ufs 1 no logging
/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /usr ufs 1 no logging
#/dev/dsk/c1t1d0s3 /dev/rdsk/c1t1d0s3 /var ufs 1 no logging
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /var ufs 1 no logging
#/dev/dsk/c1t1d0s6 /dev/rdsk/c1t1d0s6 /apps ufs 2 yes logging
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /apps ufs 2 yes logging
#/dev/dsk/c1t1d0s5 /dev/rdsk/c1t1d0s5 /user ufs 2 yes logging
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /user ufs 2 yes logging
#/dev/dsk/c1t1d0s7 /dev/rdsk/c1t1d0s7 /www ufs 2 yes logging
swap - /tmp tmpfs - yes size=2048m