Hi lidiomozi,
If you have two identical HDs, soupdragon's commemt will work for you (I mean use the "dd" command).
If you have different HD (different in size and made).
you better use "format" command to partition the new HD,
you can make it to have the same number of partions (the size of the partition can be the same, or just bigger than the data size, or bigger).
Assume that your first HD is c0t0d0, 2nd disk is c0t2d0
(use format command to find out the names in your system).
you can then use "ufsdump + ufsrestore" to dump the partition one by one, then make the diskbootable.
eg: your first harddisk have /, /var, /usr, /export
4 filesystems(partitions) refer to /etc/vfstab for details.
let's say you want to dump the / filesystm to 1st partion of the 2nd HD, you do:
# mount the target partition
mount /dev/dsk/c0t0d0s0 /mnt
/usr/sbin/ufsdump 0cf - / | (cd /mnt; ufsrestore rf -)
where finish file transfer, you do:
rm /mnt/restoresymtable
umount /mnt
repeat the above procedure to cope the other partitions
Perform fsck to all the partions in the 2nd HD.
Make the 2nd HD bootable:
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
/dev/rdsk/c0t2d0s0
That's it. It should work for you.
Main Topics
Browse All Topics





by: soupdragonPosted on 2003-04-02 at 15:53:38ID: 8257735
Assuming you're doing this on the Sun box, use dd to copy the entire disk.
As root
# format </dev/null -- check path of existing disk
# df -k -F ufs -- note partitions on above disk
# touch /reconfigure -- ensures that new hardware is seen
# init 5 -- power down
Add new disk
Power up system Solaris will add new disk device on boot
As root
# format </dev/null -- note down new disks path
E.g. existing disk c0t0d0 new disk c0t1d0 - slice 2 represents the whole disk.
# dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=128k
Since the system is running new disks partitions will be marked dirty so fsck each partition on the new disk - these will be the same noted from df -k on the existing disk except on c0t1d0.
# fsck -y /dev/rdsk/ct1d0sX -- marks partition as clean
# mount -Fufs /dev/dsk/c0t1d0s0 /mnt -- test mount root
# df -k -- Check root on c0t1 is ~ same size as root on c0t0
# cd /mnt -- ensure files are there
# umount /mnt
# init 5 -- power down
Remove second disk for spare
Power up system