LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-30-2007, 04:48 PM   #1
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Rep: Reputation: 31
mdadm confusion...


Ok, like most, I am wanting to setup a RAID 1 solution on my SuSe 10.2 box. When I installed SuSe, it created three partitions on my drive which are /dev/hda2, udev, and /dev/hda3. Don't know why three damn partitions were created in the first place. Wouldn't it have been easier to just create one partition on the entire drive?? Anyway, I then added a second hard drive, formated it with ext3 and then edited the fstab to create an entry like below

Quote:
/dev/hdd1 /backupdrive ext3 defaults 0 0
.

And then mounted it with "mount -a".

So essientially I have two drives with 4 paritions: /dev/hda2, udev, /dev/hda3, and /dev/hdd1.

Nothing is on the second drive. I added it today so it is emtpy.

Now I'm lost after this. All I want to do is create the raid array and run from there. Anybody have any good links available. I've gone to several websites that seem to show how to use mdadm, but I'm a little cautious as I don't want to blow my primary hard drive as it is being used as a mail, web, and various other services.

Biggen
 
Old 03-30-2007, 05:13 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I don't understand what the udev partition is about. If I were you I would start over and manually prepare the partitions. I think it would be easier booting if you created a smaller partition for the /boot directory, of 60-80MB. Then you don't have to worry about getting the system booting of a software raid.* ( Are you using software raid, or do you have a raid controller card? ) You could also create an identical partition on the second disk and copy the files over when you are done, and have this as a backup in case the first partition goes bad; you can make the 2nd disk active and use grub install to put the mbr on that drive. That will allow you to boot up the system and try to rebuild the first disk. Then create identical partitions on each drive and mark them as raid members. Then add the raid members and define the mount points.

You will get better performance if you use only the master controller and not the slave. This may mean adding another controller but ATA controllers are not expensive.

---
* There is a raid / grub howto that installs grub on a raid-1 mirror but during booting treats the first member as a regular drive. You may be able to have fail-over doing this, where if the first disk goes bad, grub will boot up from the second drive.

Last edited by jschiwal; 03-30-2007 at 05:37 PM.
 
Old 03-30-2007, 05:29 PM   #3
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jschiwal
I don't understand what the udev partition is about. If I were you I would start over and manually prepare the partitions. I think it would be better booting if you created a smaller partition for the /boot directory, of 60-80MB. Then you don't have to worry about getting the system booting of a software raid. ( Are you using software raid, or do you have a raid controller card? ) You could also create an identical partition on the second disk and copy the files over when you are done, and have this as a backup in case the first partition goes bad; you can make the 2nd disk active and use grub install to put the mbr on that drive. That will allow you to boot up the system and try to rebuild the first disk. Then create identical partitions on each drive and mark them as raid members. Then add the raid members and define the mount points.

You will get better performance if you use only the master controller and not the slave. This may mean adding another controller but ATA controllers are not expensive.
Wanting to do software RAID as I don't have a RAID card.

Doing a "df -h", udev is mounted on /dev. It is 188MB in size and only 88KB is geing used. I have no idea what that is for. SuSe created it (and the two others) automatically (guess that is what I get when I don't do it myself) when I installed the OS.

The second hard drive is on the second IDE channel on the motherboard. But it is slaved on that channel (the CD ROM is master but it is never used)


*sigh*, RAID may be out of my realm I'm afriad. Looks like what you are suggesting is fairly complicated. Would it not be simpler to just keep the first drive exactly like it is and partition the second drive exactly like the first (with the two partitions plus the crazy udev)?
 
Old 03-30-2007, 05:58 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It isn't that complicated. You might want to look in the docu/en/ folder of the install disk. It contains the pdf manuals. There will be a section on installing raid. If you create the first partition as the boot partition, then it should be able to boot up with no problem. It makes life so much easier.

It will work best if you have two identical drives. If one is bigger than the other, you can create a regular partition in that extra space. Raid1 is mirrored raid. When I used it on my previous desktop, I partitioned both drives identically. When you select the filesystem, instead of selecting ext3 or reiserfs, select "raid" from the drop down list. You select the filesystem after you add the two members for the raid partition. Then click on edit and chose the filesystem and the mount point. If you get the hang of it, it really is hardly different than partitioning a single drive for linux. You are simply creating identical partitions on a second drive and adding them as raid members.

If you have mdadm installed, which you will if you install SuSE with raid, there will be html documentation on raid in /usr/share/packages/mdadm/. Read through the documentation so that you know what to do if one of the drives fails. You may be able to try rebuilding the bad drive. If that fails, you can replace the bad drive with a new one, and not loose your data. With a third drive, you can even have a hot spare.

You don't need /dev in it's own partition. It is just where the device (special files) are created. You do want a / (root) partition, and I would highly recommend a /home partition. I would also recommend increasing the size that SuSE recommends for /usr by 50%, if you create a separate partition for it. It will grow in size as you install software. More so if this is your personal workstation. Less so if it is a dedicated server.

Udev is the system that creates devices on the fly for removable media. If you insert a pendrive, it will create a device for it, and a helper program will create a directory under /media where will be mounted.

Good Luck!

Last edited by jschiwal; 03-30-2007 at 06:00 PM.
 
Old 04-01-2007, 05:59 AM   #5
carl0ski
Member
 
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872
Blog Entries: 12

Rep: Reputation: 30
udev isnt a real partition on your hard drive its a logical one used by the kernel for things like usb devices.

so you really have /dev/hda (the physical harddrive)
/dev/hda1 (usually your / partition)
/dev/hda2 (usually your Swap partition)
/dev/hda3 (usually your /home partition)

It is usually a good idea to have 3 partitions since since /home can get fragmented/full/backed up easier and keeps your OS healthy.
Swap is separate for the same reason and in windows it is a good idea too.

It is easiest to start with 2 fresh harddrives to create a raid since
it isn't easy to generate a mirror from a drive with existing contents.


Linux raid is handy since it doesnt work on physical disks, but on partitions. mine looks like this


total 200GB HD1 HD2
Partition 1 10GB 10GB raid 0 /
Partition 2 2GB 2GB raid 0 SWAP
Partition 3 180GB 180GB raid 1 /home


You cant just format a drive in YAST2 Partitioner create a new partition select do not format ,
then select Linux - RAID
repeat creating same size partition on the second drive.

Then you may choose create raid from the bottom.
Choose your type 1 or 0 and add the to partitions.

md0 (raid will show up as a harddrive that you can format as per usual.
 
Old 04-01-2007, 05:33 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I use SuSE 10.2 and I don't have a /udev directory, real or psuedo.
 
  


Reply



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
RAID through mdadm rosey Linux - Server 5 04-08-2007 11:57 AM
Trying to upgradepkg mdadm ilhbutshm Slackware 1 09-17-2006 08:33 AM
mdadm and booting Boss Hoss Linux - Software 2 07-11-2006 09:17 PM
dmraid vs mdadm M K Linux - Software 1 02-14-2006 01:54 PM
do you know mdadm? Coldburn Linux - Newbie 1 08-31-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration