LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   My 1st Attempt at Software RAID on Debian (https://www.linuxquestions.org/questions/debian-26/my-1st-attempt-at-software-raid-on-debian-544377/)

carlosinfl 04-08-2007 05:27 PM

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?

rtspitz 04-08-2007 05:40 PM

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.

carlosinfl 04-08-2007 05:45 PM

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.

Quakeboy02 04-08-2007 06:22 PM

"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?

carlosinfl 04-08-2007 07:52 PM

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>


rtspitz 04-09-2007 07:15 PM

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 !

carlosinfl 04-10-2007 09:00 AM

Thanks! Seems to be working.


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