Backup, Copy, Cloning mounted disk partition on Solaris

This is how to manual backup, copy or cloning mounted disk partition on Solaris:

source: c0t0d0s0
destination:c0t1d0s0 (will be mounted on /mnt/root-backup)

*copy the disk partition layout
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s – /dev/rdsk/c0t1d0s2

* create UFS file systems on disk c0t1d0s0
# newfs /dev/rdsk/c0t1d0s0

*mount disk:
# mount /dev/dsk/c0t1d0s0 /mnt/root-backup/

*initiate backup and restore in single line command:
# cd /mnt/root-backup ; ufsdump 0uf – /dev/dsk/c0t0d0s0 | ufsrestore rf –

*do similar step for another slice (newfs, mount and initiate backup/restore)

*install the bootblock for c0t1d0s0:
installboot /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.