I have a server - which I am installing solaris 9 on.
The server currently has 2 disks. I wish to run solaris 9 on one, and use the other as a mirror for the first one. ie. If the first one should ever fail, then I can swap to the mirror and just replace the first disk and let it re-build.
How do I go about doing this? can this be set at prom level or would it be necessary to buy software to manage this?
I am trying to avoid buying any additional software if possible.
Do you want to setup a raid configuration? That depends on your H/W though.
You could use dump (dd) to copy the disk. You can copy partitions over as a backup.
There are several ways it could be done and everyone will have their own way which suits them best.
What kind of time frame you looking for uptime though? Trying for something like 99-100%? Wouldn't matter if the computer was offline for 30 minutes? 3 hours? a day? That time would really depend what/how you should setup a mirror.
Don't mean to put a downer on your question. I'm just someone who looks right into it and plans for the best whenever I setup anything. I like to do it correct first time or don't bother with doing it.
I could accept 20 mins downtime per day.
H/W not great - no raid controller that I know of..
Compaq Proliant DL380 P6 1390 MHz
I would like for the following:
2 disks.
1 is main disk (root disk)
1 is mirror of the root disk. This should be mirror all of the time.
ie. if root disk fails then mirror will be in sync up until time of failure.
I can then replace failed disk and new disk will re-sync with mirror.
Is this possible? do i need some software constantly updating the mirror with any changes on the root disk?
Would I be better just syncing once a day?
Its a server that will mainly have scripts on it - I could live with the data being 24 hours old if I have to.
Again, use disksuite (in Solaris9 and above known as Solaris Volume Manager)- see How do I mirror root with Disksuite and check out the link above (posted earlier).
With only two disks, you use disk suite ONLY to mirror them. This will run fine. If one disk fails, mirroring won't work anymore. If you reboot, you are right, disk suite is hosed, but the system is usable anyway. When you replace a disk, you need to rebuild the mirrors.
The only real challenge is arranging to boot automaticly from the secondary submirror if the primary submirror dies. To do that, from the ok prompt, build an alias for your 2nd disk and call it disk2 or something. Then set the boot-device variable to "disk disk2".
If you put three metadbs on both disks, then you can still run if one disk fails - this has worked for over 5 years on servers I admin today. And you are right, the documentation states 3 disks.
Example from Solaris 2.6 server build:
metadb -f -c 3 -a /dev/rdsk/c0t0d0s7 /dev/rdsk/c0t1d0s7
metainit -f d10 1 1 c0t0d0s0
metainit d11 1 1 c0t1d0s0
(You can add other partitions - this is only showing /)
metaroot d1
(if you add other partitions - add them into /etc/vfstab here)
lockfs -fa (then reboot)
There is no need to install a boot block on the second disk of a mirror (I�m speaking of Solaris 8/9 SPARC)
You must also (on a SPARC System) modify some OBP variables , so the server can boot automatically from the second half of the mirror. You must also specifiy the second half of the mirror as a diag device which means that coredumps are being saved there.
I'm not sure why you added that Solaris 8/9 qualifier? I'm not really a Sun guy, but my understanding is as follows... The boot block is the first block on the disk. If a partition starts on Cylinder 0, the boot block is in it. If you use that partition for swap or for a filesystem, solaris knows to skip over the boot block. (Not sure about using that partition as a replica data base.) And when you mirror that partition, the boot block will get copied. I believe that this is the case with any version of solaris. I guess you probably would need to install a boot block if you didn't include include cylinder 0 in a partition. (And we have seen stranger setups )
disk mirroring will not protect you from software errors
... you do "rm -rf" from "/" by mistake or have software corruption that affects the box and your box is toast because that error is also propagated to the mirror disk ...
you might want to do snaphot copies of your mirrors to a non-mirrored disk through a nightly cron job using unix backup utilities (i.e., dd, ufsdump, tar, cpio, etc.) just so you can at least recover quickly to a known clean point without resorting to fresh rebuilds and restores from backup tapes ...
ok setenv boot-device disk disk1
ok setenv diag-device disk disk1
And do some sort of nightly snapshot -as the data on disk will not change regularly - I just want to have a copy of the disk incase of disk failure - so that system can boot to the other disk - with fairly up to date data.
Any one know the commands I can use for the snapshot?
By the way - how do I get the full disk name for the prom settings?
fssnap - create temporary snapshots of a ufs file system
? don't know what you mean, if you search for the "solaris"name like cxt0xd0x0, there is no way to get this, if you just look for the hardware names you could try:
probe-scsi-all (on ide: probe-ide)
show-disks
or you look to resolv your aliases then:
devalias
look here for a dump script ... run the script daily from cron at a time when the box is most quiet ...
the prom only requires disk, disk1, disk2, etc. for what you need to set --- you don't need the complete cxtxdx device names ... if you're curious about those --- try