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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
01-15-2006, 02:00 PM
|
#1
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Rep:
|
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.
|
|
|
01-15-2006, 02:21 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
01-15-2006, 02:27 PM
|
#3
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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!
|
|
|
01-15-2006, 03:11 PM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
sorry, i prove myself to be an idiot again, by getting my raid levels wrong :-s
|
|
|
01-15-2006, 04:29 PM
|
#6
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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.
|
|
|
01-15-2006, 05:58 PM
|
#7
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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.
|
|
|
01-16-2006, 08:48 AM
|
#8
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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.
|
|
|
01-16-2006, 10:23 AM
|
#9
|
LQ Newbie
Registered: Jan 2006
Posts: 9
Rep: 
|
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.
|
|
|
01-16-2006, 10:40 AM
|
#10
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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.
|
|
|
01-16-2006, 11:13 AM
|
#11
|
LQ Newbie
Registered: Jan 2006
Posts: 9
Rep: 
|
Well - let's have a look.
Please answer me one question: This 35GB hard drives, are they SCSI, SATA or ATA
|
|
|
01-16-2006, 06:02 PM
|
#12
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
They are both SCSI on channel 1.
|
|
|
01-17-2006, 01:13 AM
|
#13
|
LQ Guru
Registered: Jan 2002
Posts: 6,042
Rep: 
|
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.
|
|
|
01-17-2006, 07:45 AM
|
#14
|
LQ Newbie
Registered: Jan 2006
Posts: 9
Rep: 
|
@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.
|
|
|
01-17-2006, 08:16 AM
|
#15
|
Member
Registered: Nov 2004
Location: New Prague, MN
Posts: 80
Original Poster
Rep:
|
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 11:45 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|