I have two 35 GB hard-drives with Ubuntu installed. How to set up RAID?
Linux - HardwareThis 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.
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.
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.
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.
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. :-)
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.
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?
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.