LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-08-2007, 05:27 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
My 1st Attempt at Software RAID on Debian


OK - I decided to play around today and re-try this software RAID as a (RAID1) configuration and here is what I did.

I am using two identical 250 GB S-ATA drives from Western Digital but obviously I lose one to mirroring in a RAID1 array.

I decided to keep my swap space outside of the RAID1 array since mostly all test show that swap perfroms better alone than in a RAID configuration.

Code:
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          62      497983+  82  Linux swap / Solaris
/dev/sda2   *          63       30401   243698017+  fd  Linux raid autodetect

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          62      497983+  82  Linux swap / Solaris
/dev/sdb2   *          63       30401   243698017+  fd  Linux raid autodetect

Disk /dev/md0: 249.5 GB, 249546670080 bytes
2 heads, 4 sectors/track, 60924480 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table
As you can see I have a total of 1GB swap space but I split it 512 / 512 on sda and sdb to keep things even on each disk.

Then I made a RAID partition for sda2 and sdb2 and made them both bootable. ( I have no idea if making them both bootable was the right thing to do but it seemed logical at the time)

So when it asked me to select the two partitions for RAID1, I selected sda2 and sdb2 for a RAID1 mirror and left sda1 and sdb1 as the 1GB total swap space on the system.

Then I formated the RAID1 array as ext3 and set a mount point of / to it and now I am posting from her. Did I do this correctly?
 
Old 04-08-2007, 05:40 PM   #2
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 33
what is the problem then?

as long as it works, all is fine.
my system also complains about the partition table, but as I run lvm ontop of my /dev/md1 I don't care.
 
Old 04-08-2007, 05:45 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
There is no problem. I have never done this before and I am simply asking for someone to review my steps and actions and let me know if I messed up. I RAID is obviously not something you can test unless you know a way to magically make a drive fail so I can make sure the mirror works.
 
Old 04-08-2007, 06:22 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
"RAID is obviously not something you can test unless you know a way to magically make a drive fail so I can make sure the mirror works."

What if you unplug it before you boot?
 
Old 04-08-2007, 07:52 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by Quakeboy02
"RAID is obviously not something you can test unless you know a way to magically make a drive fail so I can make sure the mirror works."

What if you unplug it before you boot?
I would hope that there are more advanced alternatives in Linux OS that supports Software RAID than unplugging a drive and watching it boot.

Code:
cwilliams@maverick:~$ su
Password:
maverick:/home/cwilliams# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda2[0] sdb2[1]
      243697920 blocks [2/2] [UU]

unused devices: <none>
 
Old 04-09-2007, 07:15 PM   #6
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 33
well, you've checked that your raid1 is operational by viewing /proc/mdstat and your system obviously boots.

to verify that hdd 2 will boot the best way ist to unplug disk 1 and put disk 2 in its place.
a 2nd method would be to compare the first few sectors of the 2 disks which is where your bootmanager resides.

for example:

Code:
dd if=/dev/hda of=/tmp/file1.txt bs=2048 count=10 
dd if=/dev/hdb of=/tmp/file2.txt bs=2048 count=10
diff /tmp/file1.txt /tmp/file2.txt
this will read the first 20kb of each disk put it in a text file and compare the two. if identical, chances are good it will work.

but the only REAL test is to actually unplug the disks. better safe than sorry !

Last edited by rtspitz; 04-09-2007 at 07:18 PM.
 
Old 04-10-2007, 09:00 AM   #7
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks! Seems to be working.
 
  


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
Installing Debian after CentOS with software RAID arsham Linux - Distributions 0 11-07-2005 05:12 AM
Nforce 3 ultra software raid while installing debian Devrethman Linux - Hardware 2 08-27-2005 08:25 AM
Debian and software RAID Lleb_KCir Linux - General 2 10-14-2004 04:15 AM
SATA software RAID woes with 2.6.8 debian Jaxon Linux - Hardware 0 10-05-2004 05:29 PM
1st attempt at samba thetruevoice Linux - Networking 8 09-11-2001 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:03 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