LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   I have two 35 GB hard-drives with Ubuntu installed. How to set up RAID? (https://www.linuxquestions.org/questions/linux-hardware-18/i-have-two-35-gb-hard-drives-with-ubuntu-installed-how-to-set-up-raid-403680/)

Mateo1041 01-15-2006 02:00 PM

I have two 35 GB hard-drives with Ubuntu installed. How to set up RAID?
 
Hi everyone,

I have Ubuntu Linux 5.10 i386 (server edition) installed on one 35 GB hard-drive and the other drive is empty. I'm working to build a file server with possible email capabilities down the road.

What would be the best way to set up RAID? Do I need to do this through the CD I first installed Linux with? I'm thinking RAID 1 would be good with the two hard-drives? Are any specific drives needed, or is everything I'd need on the installation CD?

While I've worked with Linux a little before, I'm pretty new to RAID and setting it up, so any specifics would be very much appreciated.

Thanks much!

- Matt.

acid_kewpie 01-15-2006 02:21 PM

personally i'd say raid1 is pointless to most new users, instead do an LVM setup, as you'll have all the benefits of raid1 with much better flexibility too.

Mateo1041 01-15-2006 02:27 PM

Would LVM (http://www.tldp.org/HOWTO/LVM-HOWTO/whatisvolman.html) offer protection if we lose one of the hard-drives? That's my main concern. I thought RAID was pretty standard for servers.

Or would a setup where we simply do daily backups to the second hard-drive be a better idea?

Thanks for your reply!

acid_kewpie 01-15-2006 03:11 PM

sorry, i prove myself to be an idiot again, by getting my raid levels wrong :-s

acid_kewpie 01-15-2006 03:11 PM

anyway.. this should suit you down to the ground... http://www.debian-administration.org/articles/238

Mateo1041 01-15-2006 04:29 PM

You're probably thinking RAID 0 instead of RAID 1? I know better RAID setups require more than just two hard-drives.

Thanks for the link. Will try that out. I know Ubuntu came from Debian, so the two should be fairly similar.

Mateo1041 01-15-2006 05:58 PM

Ok, I just began going over the link you gave and had some success, although I ran into a problem in that the new drive has different looking partition sizes than the old. Now it doesn't want to make /dev/md1 because the size is too small or something. Here's what I'm seeing:

Code:

Disk /dev/sda: 4427 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sda1  *      0+    29      30-    240943+  fd  Linux raid autodetect
/dev/sda2        30    4426    4397  35318902+  5  Extended
/dev/sda3          0      -      0          0    0  Empty
/dev/sda4          0      -      0          0    0  Empty
/dev/sda5        30+    637    608-  4883728+  fd  Linux raid autodetect
/dev/sda6        638+    819    182-  1461883+  82  Linux swap / Solaris
/dev/sda7        820+    941    122-    979933+  fd  Linux raid autodetect
/dev/sda8        942+  4426    3485-  27993231  fd  Linux raid autodetect

Code:

Disk /dev/sdb: 34732 cylinders, 64 heads, 32 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sdb1  *      0+    235-    236-    240943+  fd  Linux raid autodetect
/dev/sdb2        235+  34726-  34492-  35318902+  5  Extended
/dev/sdb3          0      -      0          0    0  Empty
/dev/sdb4          0      -      0          0    0  Empty
/dev/sdb5        235+  5004-  4770-  4883728+  fd  Linux raid autodetect
/dev/sdb6      5004+  6432-  1428-  1461883+  82  Linux swap / Solaris
/dev/sdb7      6432+  7389-    957-    979933+  fd  Linux raid autodetect
/dev/sdb8      7389+  34726-  27338-  27993231  fd  Linux raid autodetect

Code:

mbaerbock@Shepherd:~$ sudo mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/sdb1
mdadm: /dev/sdb1 appears to contain an ext2fs file system
    size=689596K  mtime=Wed Dec 31 18:00:00 1969
Continue creating array? y
mdadm: array /dev/md0 started.
mbaerbock@Shepherd:~$ sudo mdadm --create /dev/md1 --level 1 --raid-devices=2 missing /dev/sdb2
mdadm: /dev/sdb2 is too small: 1K
mdadm: create aborted

I did type the duplicate partitions command properly and didn't seem to have any trouble with it aside from the need to --force it.

Any ideas?

Please go easy on me if this sounds dumb. I'm pretty new at this RAID stuff and partitions. :-)

Mateo1041 01-16-2006 08:48 AM

I'm pretty positive both hard-drives are the same size. Is there a good way to check this in Linux?

Anyone have any other comments or suggestions?

Thanks,
- Matt.

CrackHarday 01-16-2006 10:23 AM

Hi,

I wonder this works anyway. As far as I'm concerned this will only work correctly if both drives have the same geometry. Lets take your drives as example:

Disk /dev/sda: 4427 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Disk /dev/sdb: 34732 cylinders, 64 heads, 32 sectors/track
Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0

I marked the 'spots' - as you can see the Cyl-Head-Sec/Track values of your drives are different so the OS gets different results when calculating the Units.

1st of all make them equal by using fdisk.

2nd don't try to 'mdadm' your extended partition /dev/sdb2 because it can not be 'mdadm'ed - it is simply neither possible nor is it necessary.

Mateo1041 01-16-2006 10:40 AM

Yes, I noticed those differences too. How would I make them equal with fdisk? Is sfdisk different than fdisk? I had used sfdisk in the following way according to the linked article posted above:

Code:

sudo sfdisk -d /dev/sda | sudo sfdisk /dev/sdb
The article mentioned to do a bunch of things with mdadm. Should I not follow that article?

I guess right now I'm hoping for a list of instructions similar to that article on how to proceed.

Thanks for your help.

- Matt.

P.S. - Should I undo what I've already done according to that article? If so, how would I remove the md0 RAID thing I already created?

CrackHarday 01-16-2006 11:13 AM

Well - let's have a look.

Please answer me one question: This 35GB hard drives, are they SCSI, SATA or ATA

Mateo1041 01-16-2006 06:02 PM

They are both SCSI on channel 1.

Electro 01-17-2006 01:13 AM

A combination of RAID-1 and either LVM or EVMS will work. RAID-1 will give you some reduntancy while either LVM or EVMS will sometimes give you RAID-0. For every addition to the LVM or EVMS device, you need to make a new RAID-1. This means you will have several RAID-1. To some people it may seem to be expensive, but a RAID-1 and LVM or EVMS will be cheaper than RAID-5 which uses a fixed space setup that needs to be backed up before increasing its space.

It is better to use a drive for the OS and use seperate drive(s) for storing e-mail or for a file server.

CrackHarday 01-17-2006 07:45 AM

@Mateo1041:

Wonderful - so it should be easy but you mentioned that you already made some efforts in creating a running md-Raid, right? And your system is running fine with that ??

The ignore the 1st-Step thing I mentioned above.

Better use: Never touch a running system.

I read this article myself and find it very useful. Just continue with your partitions

/dev/sda5 - /dev/sdb5
/dev/sda7 - /dev/sdb7
/dev/sda8 - /dev/sdb8

and all will be fine.

Only if your system is NOT running well then tell me and I will try to help.

Mateo1041 01-17-2006 08:16 AM

Well, my system is still running, although I found I could only go partway through the instructions at: http://www.debian-administration.org/articles/238 as I mentioned in a previous post.

Somehow both hard-drives are not formatted or partitioned equally and that is the problem I'm having. How do you format a drive in Linux anyway?

If this article won't work, I want to undo what I did and forget the RAID thing. It is way too complex and there are just too many roadblocks. I absolutely don't want to be left with a partial RAID setup which is what I have now because the article didn't work for me. :-(

Quote:

I read this article myself and find it very useful. Just continue with your partitions
See, that's the thing...I can't get through the article and finish the job. That's why I might as well undo it and forget RAID. The only way I can see myself being able to finish the article is if both drives are equal so I can properly duplicate the partitioning, etc.


All times are GMT -5. The time now is 02:54 PM.