RAID Set

Rashkae ubuntu at tigershaunt.com
Thu May 17 15:22:35 UTC 2007


Replying to myself :) Errata will be interspaced:

Rashkae wrote:
> Ryan Nichols wrote:
>> What is the best way to make a RAID 1 set out of my existing system? 
>> I've got a 320GB Sata Drive and I want to add a 2nd one and make it 
>> RAID... What is the best way to do this? I want to keep the data intact.
>>
>> Thanks,
>> Ryan
>>
> 
> I'm going to paraphrase these commands.  I apologize if I make some 
> slight syntax errors, but I'm sure you'll get through it with a bit of 
> perseverance :)  Always have a backup before you start something like 
> this, in case something goes wrong.
> 
> Lacking any other information, I'm going to assume, for example, that 
> your current drive has 1 Linux partition, and one swap partition, sda1 
> and  sda2 respectively.  Your new drive will be sdb.
> 
> First, you need to partition the drive using any partition tool you are 
> familiar with.  fdisk, cfdisk, gparted, qtparted, etc.  The partition 
> that is destined to be your new filesystem must *not* be any larger than 
> your current sda1.  Smaller is ok, but any size difference will just be 
> wasted space later.  Change the partition type to Linux Raid Autodetect 
> (type FD).  While you're in the partition software, you might as well 
> add a swap partition on the new drive as well.

As well as creating the swap partition, you need to make swap on it.

mkswap /dev/sdb2


> 
> Use mdadm to create a new Raid 1 Array, with 2 devices, one will be the 
> newly created sdb1, the other is missing.
> 
> mdadm create /dev/md0 -l 1 /dev/sdb1 missing
> 

I forgot to specify the number of devices.  this command should be

mdadm --create /dev/md0 -l 1 /n 2 /dev/sdb1 missing


> mdadm manage /dev/md0 -a /dev/sdb1
> 
> 

mdadm --manage /dev/md0 -a /dev/sdb1





More information about the ubuntu-users mailing list