[WBEL-users] Raid 1 Software raid

Kirby C. Bohling kbohling@birddog.com
Fri, 19 Nov 2004 12:15:29 -0600


On Fri, Nov 19, 2004 at 01:07:11PM -0500, William Warren wrote:
> i should have clarified..i back up the drive to dvd's every so 
> often.  I would do the same so wiping hte partition IS an option..:)

# fdisk /dev/hdX
# fdisk /dev/hdY
(Change the partitions types to "fd").

# mdadm -C /dev/md0 -l raid1 -n 2 /dev/hdX1 /dev/hdY1

Change X and Y to be the correct respective partitions.

# mke2fs -j /dev/md0
# mount /dev/md0 /mnt

Restore the drives, setup /etc/fstab so it mounts where you want.
Then you probably want to go readup on how to setup /etc/mdadm.conf.

If you are planning to use this as your / or /boot you probably have
to rebuild your initrd.

	Thanks, 
		Kirby

> 
> Kirby C. Bohling wrote:
> 
> >On Fri, Nov 19, 2004 at 11:51:56AM -0500, William Warren wrote:
> >
> >>ok..so how would i make my current 80 gig drive mirroed across to 
> >>as econd 80 gig drive?  I have tried various docs and am not able 
> >>to get it rofl..<G>
> >>
> >>btw the 80 gig drive is not bootable.
> >
> >
> >	Well, that's difficult.  It's very difficult to setup a mirror
> >of an existing drive (I don't know of any tools that will do it for
> >you).
> >
> >	In theory, and only in theory, there should be a way to shrink
> >the filesystem you are working on (so there is enough room at the
> >end of the partition to put the RAID metadata), change the partition
> >type to (fd).  Then partition the other drive exactly the same and
> >then use the mdadm tools to force them to raid together. 
> >
> >	However, that's a really good way to lose your data.  I've never
> >seen it done before, but it should be possible to do.  The metadata
> >on a Linux software RAID is stored in the last 128K of the
> >partition (technically speaking, I believe it's stored in the last
> >full 64K block, which means it can't be any longer then 128K).  If
> >the drives aren't identical in geometry, this might be a problem
> >(I've always partitioned my drives about 1% smaller then they are to
> >ensure that this isn't a problem when I'm buying replacement drives,
> >it really sucks to get a replacement drive that is 4 blocks (2k)
> >sort of letting you rebuild the mirror).
> >
> >	In the end, shuffle all the data off the disks.  Build a fresh
> >mirror.  Shuffle the data back onto the disks.  As long as you have
> >the spare drive space, it's relatively easy to do.
> >
> >	Kirby
> >
> >
> >
> >>William Hooper wrote:
> >>
> >>
> >>>William Warren said:
> >>>
> >>>
> >>>>so if i read this correctly..software raid in linux is restricted to
> >>>>mirroring ont he same drive?
> >>>
> >>>
> >>>No, it says "A software RAID partition must be constrained to one 
> >>>drive." Keep reading.  You create a RAID device out of multiple software 
> >>>RAID
> >>>partitions.
> >>>
> >>
> >>-- 
> >>My "Foundation" verse:
> >>Isa 54:17  No weapon that is formed against thee shall prosper; 
> >>and every tongue that shall rise against thee in judgment thou 
> >>shalt condemn. This is the heritage of the servants of the LORD, 
> >>and their righteousness is of me, saith the LORD.
> >>
> >>-- carpe ductum -- "Grab the tape"
> >>_______________________________________________
> >>Whitebox-users mailing list
> >>Whitebox-users@beau.org
> >>http://beau.org/mailman/listinfo/whitebox-users
> >>
> >
> >
> 
> -- 
> My "Foundation" verse:
> Isa 54:17  No weapon that is formed against thee shall prosper; 
> and every tongue that shall rise against thee in judgment thou 
> shalt condemn. This is the heritage of the servants of the LORD, 
> and their righteousness is of me, saith the LORD.
> 
> -- carpe ductum -- "Grab the tape"
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users@beau.org
> http://beau.org/mailman/listinfo/whitebox-users
>