[Gllug] RAID on RAID

Mike Brodbelt mike at coruscant.demon.co.uk
Thu Nov 11 22:20:22 UTC 2004


On Thu, 2004-11-11 at 18:20 +0000, Tethys wrote:
> Rich Walker writes:
> 
> >> Which reminded me that I'd been meaning to ask about that. As far as
> >> I can see, the only way to do mirroring in Linux is with md, which
> >> sits below LVM. This is a hideously broken design. Say I add a new
> >> disk to my system, and decide I want to mirror the old disk. It can't
> >> be done because the mirror needs to be created before the filesystem.
> >
> >I just created two LVM volumes, and then built a raid-1 array from them.
> 
> Now having never used md under Linux, I don't know for sure, but doesn't
> it blow away the contents of the devices used?

Yes, indeed it does.

> I want to mirror the disk
> after it has a filesystem on it, without destroying the data, and without
> needing to go through a backup/restore cycle.

You can (sort of) do this. Add your second disk, partition it (or use
LVM), and then configure the RAID 1 arrays to span the new disk and the
current disk. When you setup the config (either with raidtab or mdadm),
specify the current data disk as "failed-disk". By doing this you can
create the arrays and filesystems, mount them, copy the filesystems
across, amend the new fstab, re-run lilo, and reboot running off the
mirror set. At that stage you just blow away the old data disk, clone
the partition table, and raidhotadd to resync the arrays.

I've used this procedure on a number of occasions when installing Debian
Woody on software RAID systems. I install a minimal system, grab the
raidtools, build a new kernel with RAID support, then move the system
onto the RAID setup. Use sfdisk to clone the partition tables. I've not
as yet done this with LVM, but will doubtless get around to trying one
of these days :-).

Mike.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list