LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-27-2005, 06:17 AM   #1
ElmPie
LQ Newbie
 
Registered: Aug 2003
Distribution: Debian
Posts: 12

Rep: Reputation: 0
Software RAID1 on Debian Sarge


Hi,


I have been trying to get Software RAID1 running on my Debian Sarge.

I've been reading alot and looking at alot of howto's but I still fail to get it working

In my case for now they are on the same IDE bus but I will change this later.

Here is what I'm doing :

---------------------------FIRST STEP ------------------------------------------

My First Harddrive :

fdisk /dev/hda -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 851 6835626 83 Linux
/dev/hda2 852 4998 33310777+ f W95 Ext'd (LBA)
/dev/hda5 852 1028 1421721 82 Linux swap
/dev/hda6 1029 4998 31888993+ 83 Linux


I don't know what the W95 Ext'd (LBA) is doing there but it looks like my SWAP device is on the same cylinders. So I don't think this is a problem.

This is my second drive :

fdisk /dev/hdb -l

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 851 6835626 fd Linux raid autodetect
/dev/hdb2 852 1028 1421721 fd Linux raid autodetect
/dev/hdb3 1029 4998 31888993+ fd Linux raid autodetect


--------------------------- SECOND STEP ----------------------------------

mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/hdb1
mdadm --create /dev/md1 --level 1 --raid-devices=2 missing /dev/hdb2
mdadm --create /dev/md2 --level 1 --raid-devices=2 missing /dev/hdb3

Result :

cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 ide/host0/bus0/target1/lun0/part3[0]
31888896 blocks [2/1] [U_]

md1 : active raid1 ide/host0/bus0/target1/lun0/part2[0]
1421632 blocks [2/1] [U_]

md0 : active raid1 ide/host0/bus0/target1/lun0/part1[0]
6835520 blocks [2/1] [U_]

unused devices: <none>

Everything looks to be alright.

-----------------------------THIRD STEP ------------------------------------

mkfs.ext3 /dev/md0
mkfs.ext3 /dev/md1
mkfs.ext3 /dev/md2

Now I mount the drives

mount /dev/md0 /mnt/root/
mount /dev/md2 /mnt/home/

And I change my initrd (/etc/mkinitrd/mkinitrd.conf) to
ROOT=/dev/md0

This should be the boot device right?
Then :
mkinitrd -o /boot/initrd.img-2.4.27-1-386 2.4.27-1-386-raid
And make the entry in the /boot/grub/menu.lst to boot from this :

title Debian GNU/Linux, kernel 2.4.27-1-386 RAID1
root (hd0,0)
kernel /boot/vmlinuz-2.4.27-1-386 root=/dev/md0 ro
initrd /boot/initrd.img-2.4.27-1-386-raid
savedefault
boot

---------------------------------- FOURTH STEP -------------------------------
COPY the data

rsync -auHx --exclude=/proc/ --exclude=/mnt /* /mnt/root/
rsync -auHx --exclude=/proc/ /home/* /mnt/home/

mkdir /mnt/root/proc
chmod 555 /mnt/root/proc

---------------------------------- FIFTH STEP -------------------------------

I change my /mnt/root/etc/fstab file to :

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
#/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
#/dev/hda6 /home ext3 defaults 0 2
#/dev/hda5 none swap sw 0 0
/dev/md0 / ext3 defaults,errors=remount-ro 0 1
/dev/md2 /home ext3 defaults 0 2
/dev/md1 none swap sw 0 0


I reboot and I select the new boot option.

Then I only see /dev/md0 and not the others? So I get errors because he can't find the home directory and so on.

Why doesn't he find md1 and md2 ??

I hope I included all required information. If not please ask

Any help is welcome!

Thanks in advance!

Added

This is in my

initrd/script file when I tell mkinitrd not to delete the directory when making the file :

ROOT=/dev/md0
unload_unused_ide 'yes' pdc202xx_new adma100 aec62xx alim15x3 amd74xx atiixp cmd640 cmd64x cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc90e66 triflex trm290 via82cxxx
mdadm -A /devfs/md/0 -R -u c74c9a07:3dd634d7:1deda842:01e9dd44 /dev/hdb1


It only adds md/0 ? Shouldn't this file include lines for all 3 devices?


Last edited by ElmPie; 03-27-2005 at 04:01 PM.
 
Old 05-20-2005, 01:07 AM   #2
xrado
Member
 
Registered: Dec 2004
Distribution: Zenwalk/Slackware
Posts: 98

Rep: Reputation: 15
check this out

http://xtronics.com/reference/SATA-RAID-Debian.htm
 
  


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
Software RAID1 monitoring Sushy Slackware 1 10-05-2005 08:52 AM
Creating Software Raid1 Jimi_l Suse/Novell 3 04-29-2005 04:54 AM
How to remove software at Debian sarge? Mathsniper Linux - Newbie 6 02-16-2005 08:51 AM
software firewall for debian sarge r.stiltskin Linux - Security 1 11-27-2004 07:53 AM
Debian sarge netinstall software raid major problem araldit Linux - Newbie 0 07-22-2004 05:58 PM


All times are GMT -5. The time now is 12:17 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration