Re: An easier way to mirror drives

From: Paul Robertson (probertson_at_unixway.com)
Date: 05/30/03


Date: Fri, 30 May 2003 13:31:05 GMT

hal@nospam.com writes:

> I have a reburb 4500 that has two internal disks, both which were
> layed out prior to purchase. I wish to mirror the disks for fault
> tolerance. The OS is installed on one drive. The partitions are not
> layed out the same. I know how to manually delete and recreate
> partitions, and use metatools to create the partition by partition
> mirror, but this seems so antiquated and tedious. Is there an easy
> tool to tell the system to mirror one drive to the other, at the same
> time automagically recreating partitions on the second drive to match
> the first? Seem like there should be an easier way, but I am finding
> nothing in the docs.
>
> Thanks,
>
> Hal
>

Hal,

I wrote a script called "sdsinstall" that does just what you are
asking about. Assume that your existing operating system is installed
on c0t0d0, and that you want to setup a disksuite mirror to c1t0d0.
Finally, assume that you have slices c0t0d0s5 and c0t0d0s6 available
for state database replicas. The following command will setup the
metadevices, update the vfstab and dumpdevice, and synchronize the
mirrors once the system reboots:

 sdsinstall -p c0t0d0 -s c1t0d0 -m s5 -m s6

Note that this script will blow away anything on c1t0d0, and warns you
accordingly. I've used the script successfully on several hundred
installs. You can find it referenced on the following page:

 http://unixway.com/vm/disksuite/mirroros.html

As always, I'm interested in improving it and would appreciate any
feedback.

Cheers,

Paul

-- 
Paul Robertson
probertson@unixway.com


Relevant Pages

  • Hand on gmirror (Was: Re: gmirror bugs, how many?)
    ... > All I'm saying is that you first should create a mirror, ... > partitions on ad0 you'll overwrite gmirror metadata. ... sigesc::root jcmendes gmirror list ...
    (freebsd-hackers)
  • Re: RAID 1
    ... >> mirror whole drives because raid devices are not partitionable ... You create mirrored partitions. ... > drive containing the still-working mirror partition bootable, ... You will have more problem with getting grub to ...
    (comp.os.linux.networking)
  • Re: RAID 1
    ... > mirror whole drives because raid devices are not partitionable ... You create mirrored partitions. ... drive containing the still-working mirror partition bootable, ... You will have more problem with getting grub to ...
    (comp.os.linux.networking)
  • Re: Best practices for using gjournal with gmirror?
    ... particularly when used with gmirror. ... the same physical disks as the mirror, is it better to mirror at the slice ... level (journal and fs on different partitions in the same mirror) or at the ... last few seconds before the crash, gmirror will not resync them on boot, ...
    (freebsd-hackers)
  • Re: XP multiple install earth to bruce hello?
    ... > and another set of partitions for pagefiles. ... >>> wanted to have for the other installs and pagefiles and then installed ... >> for their pagefile and tell each OS the same size ... fire up the virtualization and boot ...
    (microsoft.public.windows.group_policy)