1 Break the mirrors.
# metadetach –f d1 d12
# metadetach –f d2 d22
# metadetach –f d3 d32
# metadetach –f d4 d42
# metadetach –f d5 d52
1.1 Replaces current Disk 2
1.1.1 If the disks are hot swappable
Take the current disk 2 out the slot.
Insert the new 36GB disk in the slot.
Run devfsadm –c disk
1.1.2 If not
Shutdown system
Take the current disk 2 out the slot.
Insert the new 36GB disk in the slot.
Reboot
Run devfsadm –c disk
1.2 format the new disk
Use format to create the partitions wanted on the target drive. New numbers are approximate.
1.2.1 OLD partition table
Part Tag Flag Cylinders Size Blocks Partition Disksuite
0 root wm 0 - 869 1.95GB (870/0/0) 4099440 (/) d1
1 swap wu 870 - 2608 3.91GB (1739/0/0) 8194168 d2
2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
3 var wm 2609 - 3478 1.95GB (870/0/0) 4099440 (/var) d3
4 unassigned wm 3479 - 4348 1.95GB (870/0/0) 4099440 (/opt) d4
5 unassigned wm 4349 - 7500 7.08GB (3152/0/0) 14852224 (/multi) d5
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7501 - 7505 11.50MB (5/0/0) 23560
1.2.2 NEW partition table
Part Tag Flag Cylinders Size Blocks Partition Disksuite
0 root wm 0 - 869 3.9GB (870/0/0) 8198880 (/) d1
1 swap wu 870 - 2608 7.82GB (1739/0/0) 16388336 d2
2 backup wm 0 - 7505 36GB (7506/0/0) 35368272000
3 var wm 2609 - 3478 3.9GB (870/0/0) 8198880 (/var) d3
4 unassigned wm 3479 - 4348 3.9GB (870/0/0) 8198880 (/opt) d4
5 unassigned wm 4349 - 7500 14.16GB (3152/0/0) 29704448 (/multi) d5
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7501 - 7505 11.50MB (5/0/0) 23560
Label the disk when partitioning is complete. Exit format.
1.2.3 Create the Database State Replicas
# metadb –a –c 3 –f /dev/dsk/c0t1d0s7
1.2.4 Create submirrors and initial one-way mirrors
# metaclear d12
# metainit –f d12 1 1 c0t1d0s0
# metainit d10 –m d12
# metaroot d1
# lockfs –fa #locks currently mounted file systems i.e. the one with the data
# metaclear d22
# metainit –f d22 1 1 c0t1d0s1
# metainit d20 –m d22
# metaclear d32
# metainit –f d32 1 1 c0t1d0s3
# metainit d30 –m d32
# metaclear d42
# metainit –f d42 1 1 c0t1d0s4
# metainit d40 –m d42
# metaclear d52
# metainit –f d52 1 1 c0t1d0s5
# metainit d50 –m d52
# newfs /dev/md/rdsk/d10
# newfs /dev/md/rdsk/d30
# newfs /dev/md/rdsk/d40
# newfs /dev/md/rdsk/d50
1.2.5 Copy Data
Make directories for the new partitions on the source drive. (not needed for swap and backup)
# mkdir /newroot
# mkdir /newvar
# mkdir /newopt
# mkdir /newmulti
Mount each of the new filesystems from the source drive (not needed for swap and backup)
# mount /dev/md/dsk/d1 /newroot
# mount /dev/md/dsk/d3 /newvar
# mount /dev/md/dsk/d4 /newopt
# mount /dev/md/dsk/d5 /newmulti
Enter the following command for each of the filesystems to move:
# ufsdump 0f - /dev/rdsk/c0t0d0s0 | (cd /newroot;ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t0d0s3 | (cd /newvar;ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t0d0s4 | (cd /newopt;ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t0d0s5 | (cd /newmulti;ufsrestore xf -)
When each dump is complete answer ‘Y’ to the “set owner/mode for .?” and “Directories already exist, set modes anyway? (y/n)” questions.
1.2.6 Update /etc/vfstab and make bootable
Update /etc/vfstab on the newroot partition. NOTE: This is extremely important. Make sure you are on the target drive. Leave the source /etc/vfstab as is.
# cd /newroot
The target /etc/vfstab should look something like.
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no -
/dev/md/dsk/d20 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no -
/dev/md/dsk/d40 /dev/md/rdsk/d40 /opt ufs 2 yes -
/dev/md/dsk/d50 /dev/md/rdsk/d50 /multi ufs 2 yes -
swap - /tmp tmpfs - yes -
1.2.7 Tidy up filesystem
Unmount each of the filesystems mounted:
# umount /newroot
# umount /newvar
# umount /newopt
# umount /newmulti
Run the installboot program to install the boot blocks on the target drive.
# cd /usr/platform/`uname -i`/lib/fs/ufs
# installboot bootblk /dev/md/rdsk/d10
1.2.8 Shutdown, set boot disk and reboot
Shutdown the system. /usr/sbin/shutdown -y -i0 -g0
From the ok prompt:
ok setenv boot-device disk1 (reassign the boot device from the source to the target)
ok reset (recycle the prom monitor)
As a confidence check we might want to boot from the new disk to check it works before continuing.
ok boot (boot from the target drive/new boot device)
1.3 Replace Current Disk 1
1.3.1 If the disks are hot swappable
Take the current disk 1 out the slot.
Insert the new 36GB disk in the slot.
Run devfsadm -v (or drvconfig and disks) to identify the new disk.
1.3.2 If not
Shutdown system
Take the current disk 1 out the slot.
Insert the new 36GB disk in the slot.
Reboot
Run devfsadm -v (or drvconfig and disks) to identify the new disk.
1.4 format the new disk
Use format to create the partitions wanted on the target drive.
1.4.1 OLD partition table
Part Tag Flag Cylinders Size Blocks Partition Disksuite
0 root wm 0 - 869 1.95GB (870/0/0) 4099440 (/) d1
1 swap wu 870 - 2608 3.91GB (1739/0/0) 8194168 d2
2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
3 var wm 2609 - 3478 1.95GB (870/0/0) 4099440 (/var) d3
4 unassigned wm 3479 - 4348 1.95GB (870/0/0) 4099440 (/opt) d4
5 unassigned wm 4349 - 7500 7.08GB (3152/0/0) 14852224 (/multi) d5
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7501 - 7505 11.50MB (5/0/0) 23560
1.4.2 NEW partition table
Part Tag Flag Cylinders Size Blocks Partition Disksuite
0 root wm 0 - 869 3.9GB (870/0/0) 8198880 (/) d1
1 swap wu 870 - 2608 7.82GB (1739/0/0) 16388336 d2
2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
3 var wm 2609 - 3478 3.9GB (870/0/0) 8198880 (/var) d3
4 unassigned wm 3479 - 4348 3.9GB (870/0/0) 8198880 (/opt) d4
5 unassigned wm 4349 - 7500 14.16GB (3152/0/0) 29704448 (/multi) d5
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7501 - 7505 11.50MB (5/0/0) 23560
Label the disk when partitioning is complete. Exit format.
1.4.3 Create the Database State Replicas
# metadb –a –c 3 –f /dev/dsk/c0t0d0s7
1.4.4 Create submirrors and Attach
#metastat
# metaclean d11
# metaclean d21
# metaclean d31
# metaclean d41
# metaclean d51
# metainit –f d11 1 1 c0t0d0s0
# metainit –f d21 1 1 c0t0d0s1
# metainit –f d31 1 1 c0t0d0s3
# metainit –f d41 1 1 c0t0d0s4
# metainit –f d51 1 1 c0t0d0s5
# metattach d10 d11
# metattach d20 d21
# metattach d30 d31
# metattach d40 d41
# metattach d50 d51
#metastat