LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software RAID1 on Debian Sarge (https://www.linuxquestions.org/questions/linux-software-2/software-raid1-on-debian-sarge-306605/)

ElmPie 03-27-2005 06:17 AM

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?


xrado 05-20-2005 01:07 AM

check this out

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


All times are GMT -5. The time now is 12:02 AM.