Solaris / OpenSolarisThis forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I accidentally used some other 3rd party software and used their labeling tool and labeled the root disk of serverA (now it won't boot...stupid me). ServerA and ServerB are *exactly* the same (hardware, partitions, hard-drive geometry, CPU, mobo, RAM) except for the ip configurations.
I need to clone the hard-drive in ServerB to ServerA. How would I do this? I google'd and found out that since the harddrives are the same geometry and model, you just need to do:
Code:
dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2
This copies the "backup" tag. So, I'm going to put ServerA's hard-drive into serverB. But how do I copy the boot block? If put the 2nd hard-drive back to ServerA, would it boot? Do I need to format it or label it? I'm a bit lost.
PS. I would like to do this with dd. Thank you so much!
You don't need to specify the partition because you don't want to clone a partition. You want to clone a disk. And that's the hardware allocation of the disk. Btw, I'm not a Solaris guru. I thought I was replying to the linux section. But dd is the same throughout as far as I know.
And you use single user mode because you don't want any files in use as you attempt to clone them. Just SOP.
s2 is (unless you twiddle with you vtoc) spanning the whole solaris partition, so dd'ing it will effectively copy everything on the Solaris fdisk partition.
It won't restore the mbr though.
To restore it, you can do something like
Thanks, I'll try those and test it out? Unfortunately, I can't do this in single user mode because ServerB is active serving connections. Would it be *very* unwise to do a dd when a server is under run level 3?
Also, this is on sparc. Thanks for the help guys!
bash-2.05# uname -a
SunOS jones 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Fire-V240
Ok, I was thinking you were running Solaris on x86 as mostly everyone on this LinuxQuestions forum is doing so.
Forget my previous advice (fdisk or writing p0), the command and the device are x86 specific.
I would be very unwise to do a dd from or to a mounted partition actually, even in single mode ... an fsck would maybe recover should you do it if you manage to stop anything running though.
If you are on SPARC, you also need to copy the label (fmthard) and boot block (installboot), parameters may differ slightly too.
Thanks for the quick response as always . On the link you provided, they use fmthard and installboot when they are doing ufsdump/ufsrestore. But I'm using dd. The links says I don't need to do installboot as a separate step if done in dd. So far I have done:
dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t2d0s2
Still waiting for this to be finished. Then the document says that I should probably fsck this which I will do once it's done. Then I should be good to go yes?
Thanks for your help. Wow, default is 512 bytes. That would take years on a 72GB hard-drive. So I killed the process and added bs=128k to it. Now, IO is much much higher and I probably saved a couple days! Thanks for the help..
Yes, dd default block size was set in the seventies, when 512 bytes was a serious amount of data, and 72 GB storage was requiring many thousands of hard disks ...
It never changed for upward compatibility reasons.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.