LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-15-2006, 02:00 PM   #1
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Rep: Reputation: 15
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.
 
Old 01-15-2006, 02:21 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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.
 
Old 01-15-2006, 02:27 PM   #3
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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!
 
Old 01-15-2006, 03:11 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
sorry, i prove myself to be an idiot again, by getting my raid levels wrong :-s
 
Old 01-15-2006, 03:11 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
anyway.. this should suit you down to the ground... http://www.debian-administration.org/articles/238
 
Old 01-15-2006, 04:29 PM   #6
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.
 
Old 01-15-2006, 05:58 PM   #7
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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. :-)

Last edited by Mateo1041; 01-15-2006 at 06:01 PM.
 
Old 01-16-2006, 08:48 AM   #8
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.
 
Old 01-16-2006, 10:23 AM   #9
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Location: Germany, near Bonn
Distribution: SUSE 8/9
Posts: 9

Rep: Reputation: 0
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.
 
Old 01-16-2006, 10:40 AM   #10
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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?

Last edited by Mateo1041; 01-16-2006 at 10:41 AM.
 
Old 01-16-2006, 11:13 AM   #11
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Location: Germany, near Bonn
Distribution: SUSE 8/9
Posts: 9

Rep: Reputation: 0
Well - let's have a look.

Please answer me one question: This 35GB hard drives, are they SCSI, SATA or ATA
 
Old 01-16-2006, 06:02 PM   #12
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
They are both SCSI on channel 1.
 
Old 01-17-2006, 01:13 AM   #13
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 01-17-2006, 07:45 AM   #14
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Location: Germany, near Bonn
Distribution: SUSE 8/9
Posts: 9

Rep: Reputation: 0
@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.
 
Old 01-17-2006, 08:16 AM   #15
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Hard Drives In Ubuntu MSBeckman Linux - Hardware 8 03-13-2005 07:41 PM
Help Mounting Hard Drives on Ubuntu! MSBeckman Linux - Newbie 3 03-13-2005 05:37 PM
RAID, hard drives, etc mrmike Linux - Newbie 0 10-09-2004 04:08 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM
Dual Boot with RAID and Two Hard Drives MoePhish Linux - Hardware 16 04-13-2003 02:22 AM


All times are GMT -5. The time now is 01:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration