I see what you are talking about. Basically you did not assign cylinder 524 through 2495. Your problem however is the available cylinders are not contiguous cylinders to /opt cylinders and if you tried to add the space it would destroy other partitions.
You need to have contiguous cylinders available.
this link will give you the jist of using ufsdump drive to drive. Of course some of it is not relevant to you. I have to say that I have done this multiple times on Sparc based units and not on the x86 systems(this is something I will need to try myself).
you would not want to use prtvtoc to create the partitions on the new drive because you want to change that.
for the bootblk it is different in x86 than solaris sparc see below.
Example - SPARC(R) Platform:
[ root ] # /usr/sbin/installboot/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
NOTE: The previous examples are based on the assumption that the boot disk is c0t0d0 and the root partition is s0; modify your commands as appropriate for your configuration.
Example - Sun x86 Platform:
[ root ] # /usr/sbin/installboot/usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
/dev/rdsk/c1t0d0s2
The most appropriate commands to create a copy of a non encapsulated boot disk are ufsdump and ufsrestore.
As described, the operation will be made booted from another Solaris Image (CDROM/Net) to fulfill the ufsdump requirements to be run on unmounted/read-only file systems. This document gives details of the procedure to perform this operation.
Solution
This procedure assumes the following:
*
The boot disk to be backed up is c0t0d0 and partitioned as follows:
o
s0 is tagged root and mounted on /
o
s1 is tagged swap and is a swap device
o
s2 is the backup (the whole disk)
o
s4 is tagged var and mounted on /var
o
s5 is tagged unassigned and mounted on /opt
o
s6 is tagged usr and mounted on /usr
*
The boot disk copy is c1t0d0
*
PATH=/usr/sbin:/usr/bin
1. Bring the system down to the ok prompt.
# init 0
2. Either boot from a Solaris CDROM or from the net if a Boot Server is installed on the subnet.
ok boot cdrom -s # Boot from a Solaris CDROM
ok boot net -s # Boot from a Solaris Image on the net
3. Ensure that the original filesystems on the boot disk are consistent.
# fsck /dev/rdsk/c0t0d0s0
# fsck /dev/rdsk/c0t0d0s4
# fsck /dev/rdsk/c0t0d0s5
# fsck /dev/rdsk/c0t0d0s6
Do not fsck slice 1 (swap, a raw device without a filesystem on it) or slice 2 (backup).
4. Partition the intended boot device.
If you want an exact copy of c0t0d0, assuming that c1t0d0 is of the same capacity and similar in type, simply copy the VTOC (Volume Table of Contents) from c0t0d0 to c1t0d0 using the following command:
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2
If c1t0d0 is a different hard drive and/or you want to get a different slice configuration with greater slices, use the format command. Enter the partition menu and for each slices (0, 1, 4, 5 and 6 in our example) set up as required. Type print to check then label to save the partition table on to the disk.
5. Run newfs to create a Unix File System on each created partition (except 1 and 2).
# newfs /dev/rdsk/c1t0d0s0
# newfs /dev/rdsk/c1t0d0s4
# newfs /dev/rdsk/c1t0d0s5
# newfs /dev/rdsk/c1t0d0s6
6. Mount the newly created root partition and perform backup and restore from slice 0 on the source disk (c0t0d0s0) to slice 0 on the target disk (c1t0d0s0)
# mount /dev/dsk/c1t0d0s0 /a
# ufsdump 0f - /dev/rdsk/c0t0d0s0 | (cd /a ; ufsrestore xf -)
7. Mount the other partitions and perform their backup/restore in the same way.
# mount /dev/dsk/c1t0d0s4 /a/var
# mount /dev/dsk/c1t0d0s5 /a/opt
# mount /dev/dsk/c1t0d0s6 /a/usr
Note: The var, opt and usr mount points do no need to be created because they are directories from slice 0 created by the backup/restore process in in step 6.
# ufsdump 0f - /dev/rdsk/c0t0d0s4 | (cd /a/var ; ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t0d0s5 | (cd /a/opt ; ufsrestore xf -)
# ufsdump 0f - /dev/rdsk/c0t0d0s6 | (cd /a/usr ; ufsrestore xf -)
8. Modify the /etc/vfstab file in the root partition on the new disk to change the device names to reflect the new disk (for instance: c0t0d0 to c1t0d0). You can use the vi editor for this or sed as follows:
# cd /a/etc
# mv vfstab vfstab.old
# sed '1,$ s/c0t0d0/c1t0d0/g' vfstab.old > vfstab
9. Unmount all the partitions attached to /a.
# cd / ; umountall
10. Run the installboot command to install a new boot block on that disk. Not loading a boot block will leave this disk in an unbootable state as the boot strap program is contained within the boot block.
# cd /usr/platform/`uname -i`/lib/fs/ufs
# installboot bootblk /dev/rdsk/c1t0d0s0
NOTE: for SunOS 5.4 and earlier, the boot block is in /usr/lib/fs/ufs.
11. At this step, the new boot device is ready to be used. Just need to go back to the ok prompt (init 0) and update some OpenBoot PROM variables if necessary.
1.
Check and if necessary create an alias for this disk using devalias.
2.
Use this alias to update the boot-device variable if required.
3.
Boot from this alias to confirm the whole operation:
ok boot disk1