PDA

View Full Version : [ubuntu] add a new H/D using mdadm


andyrowe
May 18th, 2009, 11:09 AM
Hi all
I created a Raid1 disc array when seting up a storage server running ubuntu server. One of the two (1TB) Seagate hard drives was bad. My question is how to add a new hard drive to the existing array? Do I have to partition and format the drive first?

fjgaude
May 19th, 2009, 12:08 PM
I believe you can partition the new drive. But first make you get the bad drive out of the existing array correctly. In mdadm --fail the drive then --remove it. The you will be able to add the new drive to the array. Notice, read these links:

http://radu.rendec.ines.ro/howto/raid1.html
http://linux-raid.osdl.org/index.php/Main_Page

andyrowe
May 19th, 2009, 12:46 PM
Thanks for replying fjgaude. I will follow the links. I've already failed and removed the drive. I'm getting pretty good with mdadm, but I didn't know if the drive would need pre formated and partitioned before I can add it using mdadm.

EDIT: are the RAIStools suite installed with mdadm? if I have the RAIDtools, can I use raidhotadd without partitioning the drive first? What tool can I use to partition the disk? sorry for noob questions

fjgaude
May 20th, 2009, 04:35 PM
The RAIDtools are only techology, dont' use. Use only mdadm. Study its man pages... very powerful, but complex.

Use gparted to partition the drive. Yes, partition the drive and then add it using mdadm command.

andyrowe
May 21st, 2009, 12:37 PM
Use gparted to partition the drive.
I don't have a GUI, I'm using ubuntu with CLI only. Does anyone know of a command line tool I can use?

Alekz_
May 21st, 2009, 12:45 PM
Try `cfdisk` to make a new partition...

fjgaude
May 22nd, 2009, 12:58 PM
Yes, cfdisk, is what I use, much nicer than fdisk. You might have to do a search to find where to download it. I can't recall where I got mine.

Alekz_
May 22nd, 2009, 01:45 PM
`cfdisk` is very nice! :)

The "old" linux(es) installations (Slackware in particular, because I remember that very well!) came with cfdisk.. I still use it nowadays because I don't have a GUI on my servers! :)