Solaris 10: how to copy whole disk?

Hi,

i have problems with my system disk (os solaris 5.10) and i'm wondering if there is any way to copy the whole disk to a new one, without reinstalling everything (so to do a mirroring)??

thanks in advance

You could either mirror and split using SVM, or much more simply create a new boot environment on the new disk using live upgrade ( either by 'lucreate' or using the curses bases 'lu' command) then boot from the new disk.

One way is usfdump, ufsrestore to backup & restore the disk

The usual way is to use the 'dd'command - though I've only seen this demonstrated at the OBP (PROM) level i.e. on a Sun SPARC box, not a x86
Also, do a run a ./configure whichever way you choose

assuming c0t0d0 is yur boot disk and c0t1d0 is the new disk or spare disk from another system.

on c0t0d0s0 (assuming root partition) do a command

# touch marbles (it will create an empty file called marbles)

#sync;sync;sync;init 0 (shutdown system to ok prom level)

insert os cdrom

#boot cdrom -s

do a format command to find out where is your OS disk.(controller number may or may not change)

if controller number changed, look for your marbles ') mount s0 of all the disks find out where are your marbles.

assuming c1t0d0s0 is the location of your marbles file so c1t1d0 is the new disk

umount all the disk

partition the new disk geometry to be exactly the same as your OS disk.

then do a command

dd in=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t1d0s2 bs=2048k

then just leave it, once it completes it will say something like
xxxxx records in
xxxxx records out

then you're almost done.

(WARNING!!!! DO NOT COCKUP THE LOCATION OF THE if AND of)

if you accidently put if=empty disk and of=original os disk

YOU WILL END UP WITH ZERO OS DISK.

Next go to your server and find out where physically is your OS disk located, physically take note of the location of the disk slot number.

Whenever you want to use the 'ghosted' disk, remove the OS disk from the slot and replace it with the ghosted disk back into the exact original OS disk slot.

then your're done.