# [HOWTO] HPT, Promise, Medley, Intel, Nvidia RAID Dualboot

## irondog

Inportant information about BIOS raid and the dmraid tool

If you are owner of a mainboard with an onboard RAID controller, it's most probably just a normal IDE controller with a BIOS to support some RAID functionality. Some of these controllers also come as a PCI extension card. These FAKE-RAID controllers are just fantastic to dualboot more than one OS from the RAID, while beining able to use exactly the same array in both OS'es. (just like hardware raid)

The dmraid tool can create device-mapper nodes which correspond to the partitions on an array. It reads the metadata the BIOS wrote to the disks and uses it to create the RAID devices.

The following controllers (metadata formats) are supported*:

Highpoint HPT37X

Highpoint HPT45X

Intel Software RAID

Promise FastTrack

Silicon Image Medley

Nvidia Nforce

*Supported doesn't mean it will work in all circomstances

Remember if you are a owner of a BIOS raid controller, the RAID is (in 32bit OS'es) just software based. There is no (remarkable) difference in performace between a dmraid setup or a normal DM/MD setup. Dmraid just enables you to have the same array in Linux as other OS'es like MSDOS, Windows or FreeBSD. People who are not interested in having a dualboot should (in fact) not be interested in this howto.

Warning to all users

Dmraid isn't quite ready yet and could destroy your data (although very unlikely if it maps the RAID correctly). In the future I'll expect more controllers (in fact: metadata formats) to be supported by the tool and some improvements in the detection code which decreases risks test it.

Prerequisites

* Partitioning is already done

* You have Windows installed on the second partition o/t raid

* You have a bootpartition which is allways wise when dualbooting

* The bootpartition is the first partition on the raid (The first partition is going to be used for /boot  :Smile:  )

Why a bootpartition?:

* People having a bootpartition can leave their MBR to the one MSWindows installs (this one searches for the active partition).

* It's very easy to recover the dualboot after re-installing Windows (which allways fucks up your bootloader setup). You just have to make the first partition active and the Microsoft MBR will load GRUB. 

* After formatting the root partition (in case you want to ged rid of Gentoo  :Wink:  ) you bootloader setup will still work an so will Windows!!

[step 1]Download the Gen2dmraid LiveCD and boot it

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-0.99.iso

[step 2]Load the device driver for your SATA controller, IDE users can skip it.

```
modprobe sata_sil

#OR

modprobe sata_promise

#OR

modprobe sata_nv

```

[step 3]Run dmraid and watch the results

```
dmraid -ay

ls -la /dev/mapper/
```

Device nodes should be created for all partitions. You should be able to mount the windows partition and check things are correct.

[step 4]Format and mount partitions (think twice)

```
mkfs.ext3 /dev/mapper/${your_boot_partition}

mkfs.reiser4 /dev/mapper/${your_root_partition}

#reiser4 users should know what they are doing, this ain't a reiser4 howto

mount  /dev/mapper/${your_root_partition} /mnt/gentoo

mount  /dev/mapper/${your_boot_partition} /mnt/gentoo/boot
```

[step 5] Downloading and extracting stage tarball and chroot

```
cd /mnt/gentoo

wget ${url-stage-tarball}

tar -jpxvf ${the_stage3_tarball}

rm ${the_stage3_tarball}

mount -o bind  /dev/ /mnt/gentoo/dev

mount -t proc proc /mnt/gentoo/proc

chroot . /bin/bash --login

```

[step 6] Syncing portage tree and installing grub

```
emerge --sync

emerge grub -pv

emerge grub
```

[step 7] Installing and building a kernel (sata users: dont' forget to compile-in the sata modules)

```
emerge development-sources -pv

emerge development-sources

cd /usr/src/linux

zcat /proc/config.gz >./.config

make oldconfig

make menuconfig

# compile-in dm-mod and The MD core of the RAID flavour you use!!!

# reiser4 needs a patched kernel

make

make modules_install

cp arch/i386/boot/bzImage /boot/vmlinuz
```

[step 8] Creating the initrd like on: http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/

```
cd /root

wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/dmraidinitrd-0.93

wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc-0.93

chmod +x dmraidinitrd-0.93

./dmraidinitrd-0.93 linuxrc-0.93 initrd

cp initrd /boot/initrd

```

[step 9] Installing the bootloader like on: http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/

```
# Grub should not detect bios device names itself! Do this or be a fool!:

/sbin/grub --device-map=/dev/null

grub> device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}

grub> device (hd0) /dev/mapper/${devicename_of_your_raid}

grub> root (hd0,0)

grub> setup (hd0,0)

```

[step 10] Configuring the bootloader

Edit /boot/grub/grub.conf

```
timeout 30

default 0

title  GNU/Linux

root (hd0,0)

kernel /vmlinuz root=/dev/ram0 real_root=/dev/mapper/${your_root_partition} init=/linuxrc

initrd /initrd

title Windows

root (hd0,1)

rootnoverify

chainloader +1

```

Last words:

update: People are talking about Devfs. Don't do that, use UDEV instead!

To use udev make sure you have a recent and stable version of udev and baselayout >= sys-apps/baselayout-1.11.7-r2 (~x86 at moment of writing)

```
emerge udev -pv

emerge udev

mkdir -p /etc/portage

echo 'app-shells/bash ~x86' >>/etc/portage/package.keywords

echo 'sys-apps/sysvinit ~x86'>>/etc/portage/package.keywords

echo 'sys-libs/readline ~x86'>>/etc/portage/package.keywords

echo 'sys-apps/baselayout ~x86'>>/etc/portage/package.keywords

emerge baselayout -pv

emerge baselayout
```

update: baselayout expects dm users (and thus dmraid users) to have /sbin/dmsetup in order to have UDEV working correctly. To use this feature, we need to emerge the device-mapper package:

```
emerge device-mapper -pv

emerge device-mapper

```

Don't use a device tarball! Your dmraid created devices will disappear and bootup will fail!

```
#change /etc/conf.d/rc to set RC_DEVICE_TARBALL="no"

sed -e "s:RC_DEVICE_TARBALL=\"yes\":RC_DEVICE_TARBALL=\"no\":" </etc/conf.d/rc >/etc/conf.d/rc.new

mv /etc/conf.d/rc.new /etc/conf.d/rc

```

After this you must edit /etc/fstab, leave the chroot, unmount the partitions, reboot and cross your fingers that it works.

Don't forget to make the /boot partition active (Fdisk in Linux or somewhere in "control panel" under MS Windows XP)

Your raid can be 0x81 to your bios. In that case grub will fail to load. Repeat steps 9 and 10 and use hd1 instead! You can discover this by testing it with a grub floppy before following the steps described in the howto. Make it your [step0] OR [step11] and hope you'll never have to use it.

----------

## Polo78

So, according to the "Prerequisites", the whole thing won't work if I have Windows installed on the first two primary partitions... Is this the reason why dmraid isn't discovering all my partitions?

----------

## irondog

No. The partition detection code in Dmraid isn't quite complete and bugfree. Once dmraid has created the RAID mapping, you should be able to map the partitions on top of it yourself by doing some investigation with fdisk.

Windows of course isn't needed for dmraid to work. But see my point: why would you want to run this kind of software RAID if you have only one Operating System?

----------

## tcostigl

Will LVM2 work over dmraid?

How about a bootstrapped pure nptl system?

I want my computer to spit fire from the exhaust fans  :Twisted Evil: 

----------

## Polo78

 *irondog wrote:*   

> No. The partition detection code in Dmraid isn't quite complete and bugfree. Once dmraid has created the RAID mapping, you should be able to map the partitions on top of it yourself by doing some investigation with fdisk.

 

I can map all my partitions correctly with dmsetup, but of course it is quite tedious and inflexible, and error-prone. Using dmraid would be the best choice, but I can't do that because it doesn't detect all partitions (see below). While I'm an experienced programmer, I'm still a newbie in the Linux world and therefore I'm not sure I can debug into the dmraid code. But I'll try...

 *irondog wrote:*   

> Windows of course isn't needed for dmraid to work. But see my point: why would you want to run this kind of software RAID if you have only one Operating System?

 

Yes, of course, my doubt was whether it is mandatory to have Windows on the second partition instead of the first partition. This is my partitioning scheme:

1 pri: XP

2 pri: XP

3 pri: Linux (root)

4: [extended]

5 log: Linux (/boot)

6 log: Linux Swap

7 log: Linux (/home)

8 log: Linux (/mnt/spare)

dmraid detects partitions 1 to 6 (and partition 6 seems not to be detected with correct bounds). Partitions 7 and 8 are not detected.

----------

## irondog

 *tcostigl wrote:*   

> Will LVM2 work over dmraid?
> 
> How about a bootstrapped pure nptl system?
> 
> I want my computer to spit fire from the exhaust fans 

 I'm using nptl only. LVM, I don't know why it shouldn't work, but have zero experience with it.

 *Polo78 wrote:*   

> 
> 
> I can map all my partitions correctly with dmsetup, but of course it is quite tedious and inflexible, and error-prone. Using dmraid would be the best choice, but I can't do that because it doesn't detect all partitions (see below).
> 
> 

 Let dmraid setup the raid, and AFTER that use dmsetup to map the partitions which are mapping on top of the mapping dmraid created. So you can use all your partitions pretty safely.

 *Quote:*   

> While I'm an experienced programmer, I'm still a newbie in the Linux world and therefore I'm not sure I can debug into the dmraid code. But I'll try...

 The partition detection code must be improved. The way dmraid will do this in future can be quite different than it does now. The creator of dmraid is thinking to include kpartx into dmraid. Personally I would like to see a library able to fetch info from different types of partition tables. 

dmraid, some kernel helpers and Grub (and maybe even the old-fashioned Lilo) would all be able to use this same library.

So, in kernel 2.7 partition detection code will go into userspace and use this library. (Big chances this WILL happen)

Disk geometry- and partition info are fetched by lilo via this library (rather than using IOCTLS)

Disk geometry- and partition info are fetched by Grub via this library

Disk geometry- and partition info are fetched by dmraid via this library OR dmraid just tells the kernel a new "disk" has been mapped to be inspected for new partitions.

 *Quote:*   

> 
> 
> Yes, of course, my doubt was whether it is mandatory to have Windows on the second partition instead of the first partition. This is my partitioning scheme: [..]

 

Why /boot on the 5th partition? This is so strange!! Normally the harddisk bootsector can only access primary partitions. I know this kind of setups can work, but this is such a weird thing I can't respect it. By the way, the Linux partition is primary in your case, why? Swap it and make things more easy for future problems / OS updates.

----------

## Polo78

 *irondog wrote:*   

> Let dmraid setup the raid, and AFTER that use dmsetup to map the partitions which are mapping on top of the mapping dmraid created. So you can use all your partitions pretty safely.

 

That's how I'm doing it at the moment. I'm also thinking to write a script that uses the output of sfdisk to build the tables automatically, it could be a good reason to learn shell scripting...   :Very Happy: 

 *irondog wrote:*   

> Why /boot on the 5th partition? This is so strange!! Normally the harddisk bootsector can only access primary partitions. I know this kind of setups can work, but this is such a weird thing I can't respect it. By the way, the Linux partition is primary in your case, why? Swap it and make things more easy for future problems / OS updates.

 

This is just the last one of a series of partitioning schemes I've tried in order to make dmraid work, but without success. Thanks for your advices anyway.

----------

## tcostigl

fdisk shows partitions:

/dev/mapper/isw_xxxx_1 (linux) /boot

/dev/mapper/isw_xxxx_2 (NTFS)

/dev/mapper/isw_xxxx_3 (linux) /

/dev/mapper/isw_xxxx_4 EXTENDED

/dev/mapper/isw_xxxx_5 (linux swap)

/dev/mapper/isw_xxxx_6 (linux)

/dev/mapper/isw_xxxx_7 (linux)

/dev/mapper/isw_xxxx_8 (linux LVM)

ls /dev/mapper/ shows:

control

isw_xxxx

isw_xxxx_1

isw_xxxx_2

isw_xxxx_3

isw_xxxx_5

isw_xxxx_6

I'm using the latest dmraid-1.0.5rcf

Where are my other 2 device nodes for partitions 7 & 8?

How do I do what you were discussing above?

----------

## rainyrhythm

Hi, i can't get the dmraid to work.

no matter what i do, it just return no block devices found. 

is dmraid compiled as dietised? i can't ge the verbose or debug working.

i'm using my motherboard's pdc raid0.

----------

## irondog

 *tcostigl wrote:*   

> 
> 
> Where are my other 2 device nodes for partitions 7 & 8?
> 
> How do I do what you were discussing above?

 Your partitions don't show up because there are some problems in dmraid partition detection code.

 *Quote:*   

> Where are my other 2 device nodes for partitions 7 & 8?

 

You can map the other partitions by hand using dmsetup. Search for it in these forums and you will know. Never tried it, but partitions are just linear mapping on the one dmraid created.

Look at this output on your system and you'll understand:

```
#dmsetup table

```

 *rainyrhythm wrote:*   

> Hi, i can't get the dmraid to work.
> 
> no matter what i do, it just return no block devices found. 
> 
> is dmraid compiled as dietised? i can't ge the verbose or debug working.
> ...

 

Are you sure your disks (underlying to the RAID) are detected? I never tested gen2dmraid on Promise ide, but it should work.

----------

## pnp

First of all big thanks for this howto. It allowed me to install gentoo on my A7N8X with sata raid.

One thing I noticed:

You forgot to add init=/linuxrc and it should be "real_root" and not "realroot".

```
kernel /vmlinuz root=/dev/ram0 init=/linuxrc real_root=/dev/mapper/${your_root_partition}
```

@ polo78 and tcostigl

I was having the same problems you have, where dmraid didn't map all my partitions. I think it was because I had resized, added and deleted some partitions, so the partition table probably wasn't as "clean" as it should be. I even had unusable spaces between partitions. Solved it this way:

1. backed up my data to another hard drive

2. deleted the array from the bios and created a new array

4. booted from gen2dmraid cd and used cfdisk to create new partitions

After this, all my partitions were properly mapped by dmraid. I think step 2 was too much, it was probably enough to just delete the partitions and recreate them.

The problem Im having right now is that after booting, there are no entries in /dev/mapper other than control.

dmsetup ls

```
sil_aebiadaadjcdb     (253, 9)

sil_aebiadaadjcdb3    (253, 3)

sil_aebiadaadjcdb2    (253, 2)

sil_aebiadaadjcdb1    (253, 1)

sil_aebiadaadjcdb9    (253, 8)

sil_aebiadaadjcdb8    (253, 7)

sil_aebiadaadjcdb7    (253, 6)

sil_aebiadaadjcdb6    (253, 5)

sil_aebiadaadjcdb5    (253, 4)
```

cat /proc/mounts

```
/dev/mapper/sil_aebiadaadjcdb3 / ext3 rw,noatime 0 0

none /proc proc rw,nodiratime 0 0

none /sys sysfs rw 0 0

none /dev ramfs rw 0 0

none /dev/pts devpts rw 0 0

none /proc/bus/usb usbfs rw 0 0
```

However, the array is properly mapped. So if I want to access any partition other than /root, I have to manually add the device nods for it. This also causes another problem, there is no way for me to have a valid fstab because it gets checked at boot, and obviously I haven't created the device entries then.

Ive read a post by irondog in another topic that says that the devices should be named /dev/mapper/dm-0, /dev/mapper/dm....... after boot using udev. In the same topic another person also said that resolved this problem by reverting to devfs, which I hope I don't have to do.

Do I have to do some special configuration in udev to get this to work? Or in the kernel, or somewhere else ?

I'm using gentoo-dev-sources-2.6.9-r9, udev-046.

Coldplug and Hotplug are started at boot runlevel.

Can anyone help?

----------

## tcostigl

 *Quote:*   

> @ polo78 and tcostigl 
> 
> I was having the same problems you have, where dmraid didn't map all my partitions. I think it was because I had resized, added and deleted some partitions, so the partition table probably wasn't as "clean" as it should be. I even had unusable spaces between partitions. Solved it this way: 
> 
> 1. backed up my data to another hard drive 
> ...

 

I started fresh doing as much as destroy the array in bios and recreating it. Are you using dmraid-1.0.0-rc5f ? Also, maybe it is because I am using intel software raid (isw). I've made so much progress so far thanks to irondog and others. I am so close to having it the way I want it. I am stubborn, I want my machine to be killa. 

Another question: Is it necessary to compile in Raid0 ior Raid1 in the kernel? I thought that was only for mdadm raid setups?

----------

## irondog

 *pnp wrote:*   

> First of all big thanks for this howto. It allowed me to install gentoo on my A7N8X with sata raid.

 I appreciate people are using it and thank YOU for doing that.

 *Quote:*   

> One thing I noticed:
> 
> You forgot to add init=/linuxrc and it should be "real_root" and not "realroot".
> 
> 

 Fixed that. thnx.

 *Quote:*   

> 
> 
> Ive read a post by irondog in another topic that says that the devices should be named /dev/mapper/dm-0, /dev/mapper/dm....... after boot using udev. In the same topic another person also said that resolved this problem by reverting to devfs, which I hope I don't have to do.
> 
> Do I have to do some special configuration in udev to get this to work? Or in the kernel, or somewhere else ?

 

1. Don't use Devfs: it has no future.

2. A correctly installed baselayout with udev will make things work as people want it to work.

3. Ignore the posts in older older topics of mine. The information is correct, but sometimes outdated. Today it should work the way I describe above. Software is changing continuesly and there will be a day the howto above won't work anymore. If Gentoo and dmraid were this easy half a year ago, this howto would have existed half a year earlier!

I updated the howto to explain how we should use UDEV.

----------

## tcostigl

before the root filesystem is remounted durring boot udev seems to get rid of the /dev/mapper/isw_*** nodes. I don't know too much about udev naming. Perhaps someone else can show how to modify udev config so that the device nodes remain. (prefer without using a device tarball). thanks.

----------

## flipy

first, thanks for this how-to! it's being so helpful for newbies like me.

but I've a problem, when I'm trying to install Grub, after the device (hd0,0) /dev/mapper/pdc...  and device (hd0) /dev/mapper/pdc... (i guess that it has to feet my raid partitions), i've get something like

```
error: the selected cylinder exceeds bios maximum
```

 (or something like that  :Razz: )

i've 2 sata drives into a raid-0, with the following partitions (all logicals)

part1 - ntfs

part2 - ntfs

part3 - ext2

part4 - reiser4

i've tryed using hd0 or hd1 (i don't get the point of doing that, i've get the same error...)

and a little question, what dev-sources in the kernel has the reiser4 patch?

i've installed ck, mm and gentoo-dev; do i have to download a specific one? (i cannot tryed any of these sources...)

Thanks!

----------

## tcostigl

flippy: i'm not sure if you want ntfs to be your first partition. If it is and it seems like windows is installed on it, that partition may be too big to boot from. It seems like you want that ext2 partition to be /boot, but then it should be the first partition. Read above about what irondog says about that.  -- I am not an expert so I would get a second opinion --

----------

## flipy

probably you're right tcostigl, but i don't know if it has to be with the cylinder size and the BIOS settings.

i'll try to move the partitions and see what happen!

thanks!

edit

i've moved ext2 partition to be in the first sectors of the raid, but it still mapped as partition3, what do i have to do to make it the first partition of the raid?

----------

## irondog

 *tcostigl wrote:*   

> before the root filesystem is remounted durring boot udev seems to get rid of the /dev/mapper/isw_*** nodes. I don't know too much about udev naming. Perhaps someone else can show how to modify udev config so that the device nodes remain. (prefer without using a device tarball). thanks.

 set RC_DEVICE_TARBALL="no" in /etc/conf.d/rc

Alternatively you can make a device tarball containing the the device nodes you need for dmraid although I would never recommend that.

 *flipy wrote:*   

> first, thanks for this how-to! it's being so helpful for newbies like me.
> 
> but I've a problem, [...], i've get something like
> 
> ```
> ...

 

You will get this specific error when grub doesn't know a certain partition belongs to a certain drive. It's very important you teach grub the bios device names IN THE CORRECT order. Following example will make things clear.

This works:

```

device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}

grub> device (hd0) /dev/mapper/${devicename_of_your_raid}

grub> root (hd0,0)

grub> setup (hd0,0) 

```

This doesn't:

```

device (hd0) /dev/mapper/${devicename_of_your_raid}

grub> device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}

grub> root (hd0,0)

grub> setup (hd0,0) 

```

I'll give you a hand:

 *Quote:*   

> part1 - ntfs
> 
> part2 - ntfs
> 
> part3 - ext2
> ...

 

 *Quote:*   

> 
> 
> i've tryed using hd0 or hd1 (i don't get the point of doing that, i've get the same error...)

  Understand this only makes sense at boot-time. It won't make any difference installing the bootloader. You can use "(hd1," instead of "(hd0," in the example above if your system doesn't boot AFTER 'successful' installation of grub.

 *Quote:*   

> and a little question, what dev-sources in the kernel has the reiser4 patch?
> 
> i've installed ck, mm and gentoo-dev; do i have to download a specific one? (i cannot tryed any of these sources...)
> 
> Thanks!

 Don't use reiser4 if you have no experience with it. It's beyond scope of this topic discussing reiser4.

 *tcostigl wrote:*   

> It seems like you want that ext2 partition to be /boot, but then it should be the first partition. Read above about what irondog says about that.  -- I am not an expert so I would get a second opinion --

 Partition 3 is bootable by a normal MBR so this should carry /boot. Off cource a Microsoft MBR needs this partition to be active! Partition 1 and 2 must not be active! IE if this person wants to get rid of grub, he should re-activate the partition carrying MS Windows.

 *flipy wrote:*   

> probably you're right tcostigl, but i don't know if it has to be with the cylinder size and the BIOS settings.
> 
> 

 Your porblem didn't have anything to do with real geometry errors. You just controlled grub incorrectly.

 *Quote:*   

> 
> 
> edit
> 
> i've moved ext2 partition to be in the first sectors of the raid, but it still mapped as partition3, what do i have to do to make it the first partition of the raid?

 It's number still is 3 no matter if it's the first partition on the disk or not.

* You setup you posted first was OK. 

* With your new setup you might need to run fdisk to set the right numbers. Your new setup should still be a bootable (but IMHO not a very nice) configuration.

Rewind your changes or do it the way I always recommand: make /boot a tiny partition which is the first one.

----------

## flipy

As always, thank you. And sorry for asking too much, I've should done some googleing before ask, as at this point I can boot from Grub (i cannot get any menu as describe in menu.lst).

Just one thing (and i remeber that i've had this error before, but i cannot manage to get it working), when starting the dmraid, it says

```

making /dev/mapper/control with char major 63 minor 10

preparing enviroment for dmraid

calling dmraid

no block devices found

```

i've followed everything in your site and in the how-to, but i've got stuck in here. I remeber you said udev will keep my /dev/mapper nodes, but it seems to be creating them now.

as a beginner, i don't have much idea what's happening, but it seems is a problem with the inital ram disk and its nodes...

any solution?

----------

## tcostigl

 *Quote:*   

> set RC_DEVICE_TARBALL="no" in /etc/conf.d/rc 
> 
> Alternatively you can make a device tarball containing the the device nodes you need for dmraid although I would never recommend that. 
> 
> 

 

I have that set. 

Maybe I jumped to a conclusion when blaming UDEV. Basically Everything goes fine during boot. I see a status message that dmraid ran successfuly. However, after hotplug and udev start my root partition doesn't mount, with an error that it can't be found. I enter my root password to get a console and do: ls /dev/mapper and there are no device nodes, just control.

So I assumed the device nodes were moved elsewhere and renamed by UDEV but I couldn't find anything in /dev that would correspond.

It may not be UDEV it may be something else (perhaps hotplug).

Is there a way to see verbose output from dmraid during boot?

Thanks.

----------

## irondog

 *flipy wrote:*   

> 
> 
> ```
> 
> making /dev/mapper/control with char major 63 minor 10
> ...

 

After this you'll have to open a shell and look what's going wrong.

Type shell and press enter. After that look in /dev/ for the devicenodes of the disks belonging to the raid. For example /dev/sda /dev/sdb /dev/hda etc.. should exist!!

When using devfs device nodes will be called differently

something like this for scsi:

```
/dev/scsi/host0/bus0/target0/lun0/disc
```

something like this for ide:

```
/dev/ide/host0/bus0/target0/lun0/disc
```

Since dmraid doesn't look for these devfs names, it will fail in almost every case to detect the raid when using devfs. Especially if devfs is mounted by the kernel (automatically).

So, I suspect you for using devfs.  :Sad: 

There are also chances my initrd is buggy (It definity IS when using devfs!!). So, please open a shell in the ramdisk, debug this problem and report the results to me for improving the initrd code and never use devfs.

 *tcostigl wrote:*   

> I have that set. 

 Yes, one step is missing in the howto. We need to have dmsetup to create the device nodes. So....

```
emerge device-mapper -pv

emerge device-mapper
```

Never forget to use baselayout >= 1.11.7-r2 or else this brand new feature won't be working.

Updated the howto for this.

----------

## tcostigl

 *Quote:*   

> tcostigl wrote: 
> 
> I have that set.  
> 
> Yes, one step is missing in the howto. We need to have dmsetup to create the device nodes. So.... 
> ...

 

Isn't device-mapper built into the kernel when I check device-mapper option? 

What about (dmsetup) and (libdevmapper)

----------

## flipy

well, it was my fault. i've a ich5 chipset with sata promise pdc378, and i compiled the kernel to access the SATA raid thru ich5, so it was incorrect.

now i've the same problem as many others, after i boot up there aren't raid partitions, and as someone said, root partition it's mounted...

what's wrong with it?

i'm using latest udev, device-mapper (the one in the initdr is .19 and in the portage is .17 as stable) and baselayout.

edit

so it's really weird...

while trying to mount partitions and check for errors, it cannot find them.

but if i do a 

```
dmsetup mknodes
```

 and then exit, the system boots ok and everything it's fine.

so, why does not do that at boot up?

----------

## tcostigl

I am just angstroms away from having my gentoo box fully operational...

Re-iterating what flippy just said.... 

when boot fails and I enter a console and do "dmsetup mknodes", my nodes appear under /dev/mapper/

Now the last step in my dmraid saga: How do I get dmsetup to create the nodes before root tries to mount? Can I edit linuxrc to run that command for me? or add it to rc-update? please help me get fully operational just in time for Christmas.

Thanks,

-Tom

----------

## flipy

well, I solved it. i know it isn't the best way but... it works.

looking at the /etc/init.d scrips, i've found that one of the firsts to execute was checkroot, and i thought that this was the first to access the partitions on the disk so i've edited it adding the line in the first if condition (so making sure it would always be executed).

as for the moment, it works.

i hope anyone can explain a better solution or why device-mapper it's not doing it (i believe it is because first, device-mapper creates /mapper/control and then dmraid is called which sets up the block devices, but do not make tue corresponding nodes)

edit

i've installed grub, but everytime i boot up i just get a grub prompt. is there anything wrong?

I guess the stage2-ext2 is installed on the mbr, but i cannot point to the /boot partition (but i can read from it and boot my box normally).

i've emerged grub 0.95 too, but i've same problems...

any solution?

edit2

i've figured out that has to be something with the device.map file and grub, anyone know how can i tweak it to make it feet my comp?

edit3

nevermind... menu.lst wasn't poiting correctly to grub.conf

----------

## flipy

Since i've been using dmraid and it works fine. Just one thing to complain about... is there any way to use fbsplah, gensplash, bootsplash..?

----------

## irondog

Gentoo users should use gensplash (fbsplash). I'll explain how to do that. Bootsplash should be more easy as users can append bootsplash themes to their initrd, but Gentoo doesn't support bootspash anymore. So I won't discuss it.

Gensplash is easy to set up, but since we are using the initrd for dmraid we 'have to' use initramfs. I'm not sure we MUST, but using the initramfs is the way I recommend.

The idea is easy: Build-in the initramfs into the kernel image (of course a fbsplash patched kernel source tree is needed)

```

emerge splashutils -pv

emerge splashutils

cd /usr/src/linux

splash_geninitramfs -v -g usr/initramfs_data.cpio.gz -r 1024x768 emergence

touch usr/initramfs_data.cpio.gz #not sure this is needed

make

cp arch/i386/boot/bzImage /boot/vmlinuz

```

append splash=silent,theme:emergence to the kernel commandline and your system will have gensplash.

This also counts for people using LVM with a genkernel created initrd. The kernel seems to have no problem having both an initrd and initramfs  :Smile: 

----------

## flipy

Can you please post an grub example?

I'm using 2.6.10 with fb support built-in, and I've tryed all the steps several times and I can't get it to work...

----------

## tcostigl

Flippy, I suspect that the NEW kernel option for fbsplash in the 2.6.9-r10 kernel works differently than the setup irondog has described. 

Try recompiling your kernel without that option or read /usr/src/linux/Documentation/fb/splash.txt to get the new kernel supported version working.

----------

## tcostigl

Well, I upgraded to 2.6.9-r10 with fb built in and my splash that was previously working is no longer working.  Then I tried my own suggestion and recompiled without that option and re-setup as irondog describes... and ... yep ... you geussed.... still not working.

----------

## Erlend

I have the same problem flipy had earlier:

 *Quote:*   

> error: the selected cylinder exceeds bios maximum

 

Except my partition table is just:

part1: ntfs (110GB)

part2: linux swap (512MB)

part3: linux / (110GB)

I've basically installed gentoo using gen2dmraid-0.99, but I cannot install my bootloader (I would slightly prefer to use grub, but I'm not really fussy so long as it works).

 *Quote:*   

> 
> 
> This works:
> 
> Code:
> ...

 

If I do this I still get

```
Error18: Selected cylinder exceeds maximum supported by BIOS.
```

I think hd0 is correct, since if I do the same with (hd0,0) I get 

```
"unknown filesystem, partition type 0x7"
```

but I'm at a complete loss about why grub won't see (hd0,2).

Thanks,

Erlend

Should probably mention that I don't actually have a specific boot partition, just forgot to make one.

----------

## Erlend

Got grub installed simply by using a grub boot floppy and installing from that.

I can't boot though.  Kernel panic, ram0 doesn't exist.  I can't really read any of the problems, since I can't scroll up.  Is there any way of having the kernel errors logged to a floppy, or of getting a terminal so that I can look at what's happened?

Thanks,

Erlend

----------

## anestis

Hello,

I'm trying to install gentoo on my raid-0 ICH5R array and I followed the guide on this thread, the gentoo handbook and the instructions on the gerte web page that has the live cd with the dm step by step. I managed to pass all the stages up to stage 9...

I had spent far too much time reading forum threads and googleing so I won't give up! 

 Here's my config..

I made the following partitions:

1. (PRI) 100MB /boot

2. (PRI)  10GB /

3. (PRI)  35GB windows

4. (EXT)   1GB swap

dmraid recognized all the partitions and named them isw_blabla_RAID_Volume11 to Volume15 with Volume14 being the extended partion itself (not the logical drive in it) and Volume1 the whole raid array. So far so good

When it comes to configuring grub... I get this error:

```

#/sbin/grub --device-map=/dev/null

    GNU GRUB  version 0.94  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB

   lists possible command completions.  Anywhere else TAB lists the possible

   completions of a device/filename. ]

grub> device (hd0,0) /de

Error 12: Invalid device requested

grub> device (hd0,0) /dev/mapper/isw_bfbhjjacda_RAID_Volume11

Error 15: File not found

```

ok... when booting from the gen2dmraid livecd I can see the raid partions ok. But when I'm trying to install gentoo I have to chroot in /mnt/gentoo right? When I chroot, gentoo doesn't see the device mapper so how can I configure grub then? 

What I mean is..

In the chroot :

livecd root # ls /dev/mapper

ls: /dev/mapper: No such file or directory

you see there are no devices in mapper, however if I exit the chroot the devices are there.. so my question then is how can I configure grub?

Any help is greatly appreciated as I'm stuck and can't do nothing about it. From that point on I can keep up with the gentoo handbook..

 :Rolling Eyes:   :Embarassed: 

----------

## Erlend

 *Quote:*   

> When it comes to configuring grub... I get this error: 

 

Looks familiar  :Wink: .  Make a grub bootdisk 

```
Code Listing 2.5: Creating a GRUB bootdisk

# cd /boot/grub

# dd if=stage1 of=/dev/fd0 bs=512 count=1

# dd if=stage2 of=/dev/fd0 bs=512 seek=1

```

(from http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid [scroll down just a little bit]).

Note when you reboot into the boot floppy your devices will be different (they are now actually being mapped by the onboard raid BIOS).  type help if you are stuck.  You can now type the following commands to install grub:

```

# n=partition number of /boot (zero in your case).

grub> root (hd0,n)          (Specify where your /boot partition resides)

grub> setup (hd0,n)           (Install GRUB to the nth partition /boot)

grub> quit                  (Exit the GRUB shell)

```

If you need a little more info:

http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html

 *Quote:*   

> livecd root # ls /dev/mapper
> 
> ls: /dev/mapper: No such file or directory 

 

In /etc/init.d/checkroot, just after 

```
   if [[ ! -f /fastboot && -z ${CDBOOT} ]] ; then
```

you need to insert:

```
dmsetup mknodes # repopulate /dev/mapper!!!
```

You may have to make the /dev/mapper directory yourself, and perhaps also the control node (ask if you need this).

You're not far at all from getting it working!

Erlend

EDIT: remember to set your /boot partition to boot in your partitioning software (i.e. cfdisk).

----------

## irondog

 *Quote:*   

> When it comes to configuring grub... I get this 
> 
> ```
> livecd root # ls /dev/mapper
> 
> ...

 

mount -o bind /dev /mnt/gentoo/dev before entering the chroot!

 *Quote:*   

> 
> 
> ```
> dmsetup mknodes # repopulate /dev/mapper!!!
> ```
> ...

 

When configured correctly Gentoo's rc-scripts (baselayout) will do this!

There is no need to edit rc-scripts if you choose for the latest (~x86) baselayout.

----------

## anestis

Thanks guys, it really worked!   :Shocked:  ... Grub config doesn't give me the 

```
Error 12: Invalid device requested
```

 however I get another error a few lines down   :Mad:   :Crying or Very sad: 

```
grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> device (hd0,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> root (hd0,2)

Error 18: Selected cylinder exceeds maximum supported by BIOS
```

I read the previous posts from flippy and irondog on the very same error but it didn't do me any good. Ok here's my new partition table:

1. (PRI)   35gb      Win     NTFS

2. (PRI) 100mb     /boot   ext3

3. (PRI)   10gb      /         reiser4

4. (EXT)    1gb      swap   swap

Here's what I get from dmraid: 

```
livecd / # ls -ls /dev/mapper/

total 0

0 crw-rw----  1 root root  10, 63 Feb  9 18:21 control

0 brw-r-----  1 root root 254,  0 Feb  9 18:22 isw_bfbhjjacda_RAID_Volume1

0 brw-r-----  1 root root 254,  1 Feb  9 18:22 isw_bfbhjjacda_RAID_Volume11

0 brw-r-----  1 root root 254,  2 Feb  9 18:22 isw_bfbhjjacda_RAID_Volume13

0 brw-r-----  1 root root 254,  3 Feb  9 18:22 isw_bfbhjjacda_RAID_Volume14

0 brw-r-----  1 root root 254,  4 Feb  9 18:22 isw_bfbhjjacda_RAID_Volume15

livecd / # fdisk -l /dev/mapper/isw_bfbhjjacda_RAID_Volume1

Disk /dev/mapper/isw_bfbhjjacda_RAID_Volume1: 247.0 GB, 247044243456 bytes

255 heads, 63 sectors/track, 30034 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

                                   Device Boot      Start         End      Blocks   Id  System

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p1   *           1        4569    36700461    7  HPFS/NTFS

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p2            5886       30034   193976842+   f  W95 Ext'd (LBA)

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p3            4570        4582      104422+  83  Linux

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p4            4583        5885    10466347+   c  W95 FAT32 (LBA)

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p5            5886        6016     1052226   82  Linux swap

Partition table entries are not in disk order
```

As you can see Volume1 is the name of my raidarray, Volume13 is the name of my linux boot, Volume14 is the name of my linux root. 

Now I've tried every single combination on grub always following the order irondog said:

```
livecd / # /sbin/grub --device-map=/dev/null

grub> device (hd0,0) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd0,0)

 Filesystem type unknown, partition type 0x7

grub> device (hd0,1) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd0,1)

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> device (hd0,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> device (hd0,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> root (hd0,2)

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> device (hd0,3) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd0,3)

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> device (hd1,0) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd1,0)

 Filesystem type unknown, partition type 0x7

grub> device (hd1,1) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd1,1)

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> device (hd1,1) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> device (hd1,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd1,2)

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> device (hd1,3) /dev/mapper/isw_bfbhjjacda_RAID_Volume13

grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1

grub> root (hd1,3)

Error 18: Selected cylinder exceeds maximum supported by BIOS

```

....nothing   :Crying or Very sad: 

irondog, I know you said in a previous post that it has nothing to do with the actual geometry of the disk but what am I doing wrong?  :Question: 

----------

## Erlend

 *Quote:*   

>  however I get another error a few lines down Mad Crying or Very sad
> 
> Code:
> 
> grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

Yeah I got this too for a while.  The error isn't "real"; basically it's a grub configuration error, nothing wrong elsewhere.  The only way I know to fix it is with the grub boot disk (floppy) which you should make as I specified above.  For a detailed description read: http://www.gnu.org/software/grub/manual/grub.html#Installation the relevant sections are "Creating a GRUB boot floppy" and "Installing GRUB natively".

 *Quote:*   

> Quote:
> 
> Code:
> 
> dmsetup mknodes # repopulate /dev/mapper!!!
> ...

 

Is this true even for dmsetup (i.e. i'm not using dmraid)?

Erlend

----------

## irondog

 *Quote:*   

> 
> 
> Is this true even for dmsetup (i.e. i'm not using dmraid)?
> 
> Erlend

 

Yes it is. From the Gentoo developpers' point of view device-mapper nodes

shouldn't be handled by udev. In fact, I can live with that. So doing it the

way the Gentoo developpers want things to be, is the way I recommend.

cat /sbin/rc

```

[...]

populate_udev() {

        # Make sure we do not have udevd from initramfs running

        killall -q udevd

        # Now populate /dev

        /sbin/udevstart

        # Not provided by sysfs but needed

        ln -snf /proc/self/fd /dev/fd

        ln -snf fd/0 /dev/stdin

        ln -snf fd/1 /dev/stdout

        ln -snf fd/2 /dev/stderr

        ln -snf /proc/kcore /dev/core

        # Create nodes that udev can't

        [ -x /sbin/dmsetup ] && /sbin/dmsetup mknodes &>/dev/null

        [ -x /sbin/lvm ] && /sbin/lvm vgscan -P --mknodes

--ignorelockingfailure &>/dev/null

        # Create problematic directories

        mkdir -p /dev/{pts,shm}

        # Same thing as /dev/.devfsd

        touch /dev/.udev

        return 0

}

[...]

```

From the code snip above we can see, that if we are using udev and

/sbin/dmsetup exists, things in /dev/mapper will be created automaticly (No

matter if we are using dmraid or something else controlling the

device-mapper.)

Just emerge the right baselayout version and configure it correctly.

 *anestis wrote:*   

> 
> 
> grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> 
> grub> device (hd0,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> ...

 

Wrong order. First do device(hd0,0) device(hd0,1) device(hd0,2). After that device(hd0). Never reverse this order!!!!!

I don't think you need to do (hd0,1), but might be a good idea.

 *Quote:*   

> 
> 
> grub> device (hd0,0) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

Now you are installing on p1, that's NTFS. Reading grub's documentation you could discover grub has it's own filesystem interpreters. Very few builds of grub support NTFS. Don't try to do this, it will fail in Gentoo.

 *Quote:*   

> 
> 
> grub> device (hd0,1) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

I have already explained this error.

 *Quote:*   

> 
> 
> grub> device (hd0,2) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

blind attempt  :Smile: 

 *Quote:*   

> 
> 
> grub> device (hd0,3) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd0) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

Hmn, try explaining grub all partitions: 0,1,2,3

 *Quote:*   

> 
> 
> grub> device (hd1,0) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

Understand you are doing the same as earlier! Using (hd1) won't change anything!

 *Quote:*   

> 
> 
> grub> device (hd1,1) /dev/mapper/isw_bfbhjjacda_RAID_Volume13
> 
> grub> device (hd1) /dev/mapper/isw_bfbhjjacda_RAID_Volume1
> ...

 

?(hd1,0) is unknown?

And your partition table is not in disk order. Fix it!

```

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p1   *           1        4569    36700461    7  HPFS/NTFS

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p3            4570        4582      104422+  83  Linux

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p4            4583        5885    10466347+   c  W95 FAT32 (LBA)

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p2            5886       30034   193976842+   f  W95 Ext'd (LBA)

/dev/mapper/isw_bfbhjjacda_RAID_Volume1p5            5886        6016     1052226   82  Linux swap

```

Besides that, where are all those other cylinders?

One last remark: a partition just CAN exeed the bios limits! use a /boot within a normal offset on the disk.

----------

## Erlend

 *Quote:*   

> From the code snip above we can see, that if we are using udev and
> 
> /sbin/dmsetup exists, things in /dev/mapper will be created automaticly (No
> 
> matter if we are using dmraid or something else controlling the
> ...

 

Yep, it works fine without my additional line in checkroot.  Thanks.

Erlend

----------

## kabage

Thank you for this how-to, I'm having a problem booting to my chrooted env. 

Let me state that another way,  if I do the grub config from the dmraid iso,  (while chrooted in my raid env)  then boot to the array it just boots the CD instead.  

Same from my old ide with mandrake, I do the work in the array (chrooted in to the array)  Then boot to the array it just boots mandrake. 

Without the initrc in my grub.conf I can get to the splash screen but then the kernel panics on boot.  

If anyone has seen this or has any ideas, it would be helpful?

Another chuck of info when I did the dmraidinit script the only way I could get to work was to emerge busybox myself because if could not seem to compile the version it was using.

Oh yeah, I'm on a amd64 if that has something to do with it.

Thank you Kabage

----------

## Erlend

 *Quote:*   

> Let me state that another way, if I do the grub config from the dmraid iso, (while chrooted in my raid env) then boot to the array it just boots the CD instead. 

 

Remove the CD?

 *Quote:*   

> Without the initrc in my grub.conf I can get to the splash screen but then the kernel panics on boot. 

 

That's normal - the initrd is mapping the raid devices in /dev/mapper.  If you don't let the initrd run then the kernel cannot mount / - hence kernel panic.

 *Quote:*   

> Another chuck of info when I did the dmraidinit script the only way I could get to work was to emerge busybox myself because if could not seem to compile the version it was using. 

 

Did you add busybox to the initrd?  You can't just emerge it and hope that works.  I would get the source to a new version of busybox and compile that manually, then add it to my initrd.  There are plenty of howtos around the web on how to do this (google: busybox initrd).

 *Quote:*   

> Oh yeah, I'm on a amd64 if that has something to do with it. 

 

It could well be related.  What's the error?

Erlend

----------

## kabage

- I cant even post a message correctly, why am I using a computer?

 *Erlend wrote:*   

>  *Quote:*   Let me state that another way, if I do the grub config from the dmraid iso, (while chrooted in my raid env) then boot to the array it just boots the CD instead.  
> 
> Remove the CD?
> 
> "of course no just kidding removing the CD or my ide drive that I was working from gives me 'no boot media found'"
> ...

 

Thank you for your response by the way, I got a few hours sleep and hopefully will get this resolved.  

Did anybody else have to patch this script for any reason?

Ok I proved it is a arch problem - so I used busybox-1.00 source , did a test compile , and it works,  then borrowed the .config file and patch the orig dminitrd script to use the .config instead of

Config.h  (is that right)  anyway the dmraidinitrd script ran without complaint.  

Edit:

Then booted and got GRUB Loading stage2Geom  Error

Got the same thing with grub boot disk. 

As usual I'lll do some reading,  but the damn make config in busybox looks like a kernel config its a little intimidating considering I've not used busybox. 

And also if anyone can just verify this busybox .config maybe can solve the problem or am I on the wrong planet.

Just a link is good 

Thank you, Kevin the Kabage

Ok, I add the geometry command to grub , just after the device commands,  this made it boot,  but it is still searching for all devices except itself, gives itself a 

add boot media error if the array is the only thing. 

I guess I'll try to make the first partition active along with the 2nd partition, hmmm what to do.

7:21 pst 2/13 

Did try that and it boots again with a kernel panic regarding not syncing and VFS: unable to mount root fs on unknown-block(1,0)

did change conf file back to hd1 instead of 0,  

*the odd -- A get a splash screen even though I dont have that line in my grub.conf and my kernel doesn't have fb support - could grub be sharing space with lilo on my hda - no way - way -no way

I guess I'm just keeping notes to myself at this point surely some one had dmraid running on an amd64.

8:08 pm 2/13 

Summary -getting closer

went back to hd0  -- no doubt 

my /boot/grub/menu.lst was not a link (wont let me make a link to grub.conf so just copied grub.conf to menu.lst)

I gave grub every device partition and am now getting

kernel panic not syncing no init found try passing init=  (yes already doing that, must be finding  pdc_*6 since not getting root fs error  so why not the 

/boot/linuxrc file in my command line init=/linuxrc

i did try init=/boot/linuxrc also ,  I'm running out of direction 

Have no idea what to try.  I'll start at grub docs and see if it can enlighten me on passing the init info another way or something

I know what it is, I lost my linux wand....       what to do

10:47 pm 2/13 pt 

Summary -- getting nowhere

kernel panic no init found blah blah 

have tried everything not sure if it wants run level or initrd image

seems like it should run initrd before linuxrc, how else is going to find linuxrc without initrd

----------

## Erlend

Your post is very hard to understand.  I'm going to backtrack a few steps...

Assuming Gentoo is installed, and you are at the stage of needing to install grub...

1. Make Grub boot disk

2. Boot off it, grub will correctly automatically find your drive from the BIOS (since there is no device-mapper).

3. At this grub boot screen, type "root (hd<tab>" (meaning press the tab key).  This will give you a list of possible hd's.  Choose one and install to that.  "root(hd0, grub_number_of_your_boot_partition)" - will give you output of the filesystem type: if it matches it's correct, if not - stop and think.

4. You should make sure you grub.conf (menu.lst) looks something like (rough):

```
root (hd0,3)

kernel /vmlinuz-2.6.10-gentoo-r6-3 root=/dev/ram0 real_root=/dev/mapper/[dmraid_dev_node] init=/linuxrc real_init=3

initrd /initrd-2.6.9-gentoo-r1-2
```

The reason you don't include the /boot (i.e. /boot/initrd) is that you have told grub to use the 2nd partition by saying root(hd0,3).

I didn't have to patch anything, except I wrote my own linuxrc (the "init" file inside the initrd).  I had to do this because I'm not actually using dmraid (I'm just using dmsetup and manually mapping the devices).  It's very similar to the dmraidinitrd linuxrc but I can post it is you really want.

As for busybox, I'm not sure if you've got that sorted now.  Read the dmraidinitrd script and either change the version number of busybox that it downloads and compiles (UNTESTED, not sure if that will work) or base your own commands on what the script does.

Erlend

----------

## kabage

 *Erlend wrote:*   

> Your post is very hard to understand.  I'm going to backtrack a few steps...
> 
> Yes I believe I've lost all sanity.
> 
> Assuming Gentoo is installed, and you are at the stage of needing to install grub...
> ...

 

I appreciate the help.  Time 10am pt 2/14

If you also have knowledge of how to eliminate things from my troublshooting loop,  that would be helpful.

11:21am pt 2/14

I've made an assumption that is probably wrong  -  The /linuxrc refered to on the kernel line  should just be a copy of the linuxrc-0.93 that dmraidinitrd-93 uses to make the initrd?  yes

I get the same results from floppy or when booting the array --  kernel panic init not found.

As far as I can see no linuxrc never runs.   Which means it cant be linuxrc since it never runs.

When I do the grub floppy   * by the way the floppy says the array is (hd1) where grub on the array seems to think the array is (hd0)

I put in the line

```

root (hd1,<tab>

```

and I get something like

partition 0

partition 4

partition 5

partition 6

my problem with this is I thought grub looked at partitions in  order like 0, 1, 2, 3  

This probably does not matter at the moment since I want  /linuxrc to run from 0 anyway

New thinking 

from the grub menu, I pick linux  - I go a get a sound card and various thinks loaded --- It Must Have Found The Kernel Image ---

linuxrc must have initrd to run and it is not running or I would some some echoes from it so must be the INITRD with problems ?

I guess to do my own initrd I need some amd64 compatible linux environment inside it with dmraid dev-mapper built in.

If by some miracle I got that far , I dont understand the use of the linuxrc, cant I just run the commands inside the initrd to map devices and transfer the info back to the kernel

Conclusion 

I dont what is going on, not sure I have enough scripting/programming to even accomplish my goal even If I did.

The goal - (boot my array)

----------

## Erlend

 *Quote:*   

> I've made an assumption that is probably wrong - The /linuxrc refered to on the kernel line should just be a copy of the linuxrc-0.93 that dmraidinitrd-93 uses to make the initrd? yes 

 

linuxrc is a file within the initrd image.  You should take a look inside your initrd to check it's there...

```

mkdir /mnt/loop

gunzip initrd

mount -o loop initrd /mnt/loop

cd /mnt/loop

```

If it isn't there copy the file http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc-0.93 into it, umount gzip and cp the image back to /boot/initrd.  NB: you should have called "dmraidinitrd-0.93 linuxrc-0.93 initrd" at some stage to make the initrd: linuxrc-0.93 will have to have been on the filesystem next to the dmraidinitrd-0.93 script.

 *Quote:*   

> linuxrc must have initrd to run and it is not running or I would some some echoes from it so must be the INITRD with problems ? 

 

You do have initrd in your grub.conf - might be an idea to post that here?

 *Quote:*   

> I dont understand the use of the linuxrc, cant I just run the commands inside the initrd to map devices and transfer the info back to the kernel 

 

That's what a linuxrc is: it's just a file (either shell script or binary) that's run before the kernel tries to mount stuff to set up necessary drivers and allow the kernel to mount /.

Erlend

----------

## kabage

 *Erlend wrote:*   

>  *Quote:*   I've made an assumption that is probably wrong - The /linuxrc refered to on the kernel line should just be a copy of the linuxrc-0.93 that dmraidinitrd-93 uses to make the initrd? yes  
> 
> linuxrc is a file within the initrd image.  You should take a look inside your initrd to check it's there...
> 
> ```
> ...

 

Thank you (cubed)

I really do appreciate this.  Got a cold one just for you in the fridge. 

Kevin the kabage

----------

## Erlend

 *Quote:*   

> root (hd1,0) 

 

With your current set up of grub.conf - your boot partition should be on the first partition of hd1.  Boot off the grub floppy again, and use the find comment to search your disks/partitions for initrd - that way you can see the disk as grub sees it.

 *Quote:*   

> Yes linuxrc is in initrd, but could not find dmraid or device-mapper -- Shouldn't that be in the initrd ? 

 

dmraid should be in the initrd - under /sbin i'm pretty sure.  dmraidinitrd should have put it there - check for errors.  That's not really the issue yet though - from what you said grub isn't even seeing your initrd or linuxrc.

----------

## kabage

 *Erlend wrote:*   

>  *Quote:*   root (hd1,0)  
> 
> With your current set up of grub.conf - your boot partition should be on the first partition of hd1.  Boot off the grub floppy again, and use the find comment to search your disks/partitions for initrd - that way you can see the disk as grub sees it.
> 
> (hdX,0) is the first partition actually I changed that to (hd0,0) just now for array boot, floppy boot likes (hd1,0)
> ...

 

----------

## Erlend

Good stuff.  I imagine you'll have learned a bit about the linux boot cycle from this, which is a positive way of looking at it.

Just compile a dmraid static binary and stick it in sbin within the initrd.  You could try running dmraidinitrd as it should definitely do that for you, or just compile it yourself (it's easy).  Do ./configure --enable-static to make sure it is statically linked.  Read dmraidinitrd for help.

Erlend

----------

## kabage

 *Erlend wrote:*   

> Good stuff.  I imagine you'll have learned a bit about the linux boot cycle from this, which is a positive way of looking at it.
> 
> Just compile a dmraid static binary and stick it in sbin within the initrd.  You could try running dmraidinitrd as it should definitely do that for you, or just compile it yourself (it's easy).  Do ./configure --enable-static to make sure it is statically linked.  Read dmraidinitrd for help.
> 
> Erlend

 

Sure enough I had uncommented something I shouldn't have in dmraidinitrd, fixed it up and did another.

Oh thank you it is working I booted gentoo from the array- Whoooooooooooooooooo, feels good.  

Yes I've learned a lot.  Though the more I learn the less I seem to know for sure.  You know how that goes.

Having problems at the moment with windows boot, I think I know what that is .

Thank you

----------

## kabage

I'm not used to having these uniquie problems.

This is unique because 

I cant do what others in this thread have done, by making the 2nd partition active and chainloading win.

If I make the /boot partition inactive, grub does not come up.  

If I make the /boot partition and the second partion active - still no win boot, lin boots fine.

Maybe reverse partitions?

----------

## Erlend

I trust you're using something very similar to this for windows:

```
title=Windows XP

root (hd0,5)

makeactive

chainloader +1
```

Your /boot partition should be marked as "boot", and there should only be one boot marked partition.  Use cfdisk to check and set this.

The active flag means a drive is bootable - only windows uses this.  Boot is different from active.  You don't need to bother setting partitions as active apart from by using the makeactive grub command on windows.

Just a thought - boot linux umount /boot (to make sure it isn't mounted) and browse to /boot - the directory should be basically empty.  If not, I would worry that you might have installed grub on the wrong partition - i.e. on your linux / partition.

----------

## kabage

From irondogs howto 

 *Quote:*   

> Prerequisites
> 
> * Partitioning is already done
> 
> * You have Windows installed on the second partition o/t raid
> ...

 

the 2nd prerquisite - windows installed on second partition.  

I found this virtually impossible --  I made the first partition to small for windows but it still insists on formating and putting a few files like boot ini , sys volume info and at least one other 

So windows will tell you it is installed on d:/ drive - but its boot files are not  

So I did this whole how to on the assumption that that shouldn't matter ( in fact I did get windows to boot at one point.)   Thats probably not an issue  if C:/  drive and /boot are the same place?

(* I actually had grub able to boot windows at one time before I got the initrd working , then as you know I got it to boot gentoo)   

Anyway back to the foundation of this howto,  

1.  I set up a 50 mb partition for the first , then a 100gb or whatever for the real install

2.  I would then try deleting the first partition.

3.    winxp would have something like this

free space 50 mb

d:/   raw  100 gb 99 gb free 

free space (rest of the array)

4. you then pick the partition to install windows only one choice right ?

 But this is where xp screws me.  Saying the it has to put files on the mbr and there is not a compatible win partition -- I must format - the mbr ,   and then gives format choices

5.  I dont how everyone else in this thread is able to setup xp on the 2nd partition , from my point of view its impossible.  it puts 3 or files on the first partition regardless of what you want.

My conclusion is screwed to 

On the one hand it feels like yes 

(hd0,1)  should not work since the boot.ini is at (hd0,0)

But I did get the windows array to boot at least once

(seems unrepeatable though and was back when I was messing with initrd on the lin side)

but also why....

does win have to be on the 2nd partition ?   Cant I just use a /boot directory giving win the first partition 100G and linux the 2nd partition or Rest of the array?

do I need a swap partition?

Currently I have 2 other disks in my array , starting again..  I'm also trying the onchip via this time.  

Maybe I'll really smoke myself and put all 4 disks in  

Anyway I'll experiment with the first two disks tomorow,  but please Master Erlend,   don't give up me!

----------

## Erlend

 *Quote:*   

> do I need a swap partition? 

 

For linux? A swap partition is a good idea unless you've got tonnes of ram.

 *Quote:*   

> (hd0,1) should not work since the boot.ini is at (hd0,0) 

 

Have you moved boot.ini?  You certainly shouldn't have - it should be in the partition windows is actually installed in.

 *Quote:*   

> Cant I just use a /boot directory giving win the first partition 100G and linux the 2nd partition or Rest of the array? 

 

I actually don't have my first parition as /boot - my first partition is Windows, second is linux swap, third is linux /, and fourth is /boot - this isn't really a very nice setup though: it might not work for everyone.

 *Quote:*   

> 5. I dont how everyone else in this thread is able to setup xp on the 2nd partition , from my point of view its impossible. it puts 3 or files on the first partition regardless of what you want. 

 

Use grub "hide (hd0,0)" or more specifically, something like:

```
title Windows XP on 3rd partition

hide (hd0,0)

hide (hd0,1)

unhide (hd0,2)

rootnoverify (hd0,2)

chainloader +1

makeactive

```

This might be helpful:

http://www.faqs.org/docs/Linux-mini/Multiboot-with-GRUB.html#ss2.6

Erlend

----------

## kabage

With this array I have kept it to the minimal to dual boot 

partition 1 (hd0,0)   pdc_hadjcchba1 = winxp  (about 32G so I could keep it a fat filesystem.

partition 2 (hd0,4)   pdc_hadjcchba5 = gentoo (100+ G )

partition 3 (hd0,5)   pdc_hadjcchba6  = swap partition

linux boot fine in this set-up , everytime I ask consistantly.

Win  - NO errors it just boots grub, timer running and everything as if I asked to boot the loader not the first sector. (or first sector + 1 )  if I am understanding

chainloader command correctly.

Did -try 

  unhide (hd0,0)

  hide (hd0,4)

  hide (hd0,5)

to the win section still same results 

```
timeout 30

default 0

title New linux boot

root (hd0,4)

kernel /boot/xdream-v1 root=/dev/ram0 real_root=/dev/mapper/pdc_hadjcchba5 init=/linuxrc

initrd /boot/initrd

title WinXp

root (hd0,0)

rootnoverify 

chainloader +1

makeactive

```

I'm going to give lilo, and yes with the patch a try.

----------

## kabage

Lilo boots gentoo fine 

Winxp at least is giving me a  li 04 04  error (unable to find sector) I guess that beats booting to itself.

I believe it is trying to use sector 63 for winxp , but I'm not sure how to determine the correct sector or tell lilo even if I knew.

Here is my /etc/lilo.conf

```

boot=/dev/mapper/pdc_hadjcchba

#map=/boot/map

#disk=/dev/mapper/pdc_hadjcchba bios=0x81

prompt

timeout=150

delay=50

default="gentoo"

image = /boot/xdream-v1

        initrd=/boot/initrd

        root=/dev/ram0

        append="init=/linuxrc real_root=/dev/mapper/pdc_hadjcchba5"

        label="gentoo"

other = /dev/mapper/pdc_hadjcchba1

        label="winxp"

```

The good stuff....

   I can verify the via on chip and promise 378 on board , both work with dmraid, amd64, asus a8v deluxe.  

Bad stuff...

   Cant find any confirmation of anyone being able to dual-boot raid on am64, asus a8v deluxe mobo. 

TODO 

    I could check many of the new bios options which may be causing a conflict.  This asus has its own boot menu giving you an option of booting any device it sees.  

    Can even set many of the parameters on IDE devices that used to requier hdparm.  Hmmmm maybe settings on my raid array need something? 

    Must find my wand and my pretty red shoes, or I may never get out of the matrix.

    Still have sense of humor after 3 days good.

----------

## kabage

The master key for me, after following this how-to was grub setup .

 *Quote:*   

> step 9] Installing the bootloader like on: http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/
> 
> Code:
> 
> # Grub should not detect bios device names itself! Do this or be a fool!:
> ...

 

The last line quote above is NOT TRUE for dual boot.  At least if winxp is the first partition.

Should be 

```
grub> setup (hd0)
```

So since  (hd0) is MBR and (hd0,0) is really the first boot sector of the first partition, it was overwriting files critical to winXp's boot.

Myfix 

-- bad  -- try to do win rescue  where you press R to get a console when booting the cd but the command 

fixmbr  does just that only the MBR not whatever was missing from the first partition.   So..... the fix

1. Had to reinstall win...

2. Immediatly booted grub floppy after win was through.

then did 

```

grub> root (hd0,4)     #for my linux partition where grub can find its files

grub> setup (hd0)      # critical to put grub in MBR not the first boot sector of the partition

```

What do I say  "All the solutions are simple" 

Of course it would have been a lot simpler if it came to me 3-4 days ago.

So nice, so sweet , yes yes yes....

----------

## Erlend

 *Quote:*   

> grub> setup (hd0,0)
> 
> The last line quote above is NOT TRUE for dual boot. At least if winxp is the first partition. 

 

It is correct if /boot is your first partition - most people will assume it is (as that is the most elegant dual-boot solution).

 *Quote:*   

> Should be
> 
> Code:
> 
> grub> setup (hd0)

 

Only if you want grub in your MBR.  Most people have a /boot partition and install grub to there.  There are a couple of reasons for this:

1. When you boot linux, you don't mount your /boot partition - you only need /boot for grub and when installing new kernels - if you don't have it mounted there is less chance of something bad happening to it.

2. Say something happens to grub and it breaks - you can't boot.  If it is on your /boot partition boot sector then you can just mark another partition (i.e. your windows partition) as bootable and use that temporarily.

But if it works and you're happy with it that's good.

Erlend

----------

## kabage

It would be impossible to have your first partition as boot,  since xp is going to take that partition regardless .

I'm sure there are hacks, to that but in general, just a straight install it is taking (hx,0) and (hx), that is probably an 

NT kernel. ( Am i talking win!) Damn it.  And I guess that is the whole problem with XP is it actually using 

the MBR and the First boot sector no matter what 

Even with the first two disks, since I could not trick xp out of the first partition, I thought there was no reason 

that xp and gentoo could not share a fat partition (I'll get back to them mon probably to see what happens).  

That brings another problem I ran into,  I did try to put grub on another  partiton (2-4) but at least on my hardware 

the partitions are virtual so there is only one partition to boot from as far as grub, lilo or whatever  win calls theirs is concerned.

Even on a regular drive though isnt grub doing the same thing (it must ) put something in the MBR, overwriting xp's 512 bytes 

and then  a partition table and a pointer to whatever partition you want to boot from.    Unless you just put it at (hdX)

So I guess my argument would be if you lose the first 512 you will never boot off of the array again no matter where you originally  put grub.

Like the raid 0 , argument that you double your chance of data loss , I would say booting from anywhere but the MBR doubles your chance of losing 

your boot.  (I know thats what backups are for)

You've probably seen the arguments about where to put the swap partition.  Physically I would guess the middle for best performance but then I never 

really see it used that much.    I would think putting the boot partition at the end since you only use it once in while would be efficient.  

I think I booted more times in the last few days then the last 5 or 10 years put together. 

I appreciate all your help the past few days.  

Thank you.

----------

## Erlend

 *Quote:*   

> That brings another problem I ran into, I did try to put grub on another partiton (2-4) but at least on my hardware
> 
> the partitions are virtual so there is only one partition to boot from as far as grub, lilo or whatever win calls theirs is concerned. 

 

You can only boot off primary partitions as far as I know.

 *Quote:*   

> Even on a regular drive though isnt grub doing the same thing (it must ) put something in the MBR, overwriting xp's 512 bytes
> 
> and then a partition table and a pointer to whatever partition you want to boot from. Unless you just put it at (hdX) 

 

Grub doesn't overwrite the MBR.  It just appends something to the end of it to redirect the booting to your /boot partition where grub is installed.

 *Quote:*   

> booting from anywhere but the MBR doubles your chance of losing
> 
> your boot. (I know thats what backups are for) 

 

You can just reinstall grub at any stage.  Or even use a grub boot disk to get into your system.

Erlend

----------

## irondog

 *kabage wrote:*   

> It would be impossible to have your first partition as boot,  since xp is going to take that partition regardless .
> 
> I'm sure there are hacks, to that but in general, just a straight install it is taking (hx,0) and (hx), that is probably an 
> 
> NT kernel. ( Am i talking win!) Damn it.  And I guess that is the whole problem with XP is it actually using 
> ...

  It's very well possible to have MS Windows installed on the partition 1-4 and having /boot on one of the other four partitions. Problem is, you don't understand you should not touch the MBR written by MS Windows Setup (lets call it a microsoft MBR). So I assume you don't understand the PC bootsequence.

A pc bios supports four (4) partitions. Special partitions (called extended partitions) containing logicall partitions are an execption at this very basic x86 rule. Exteded partitions haven't got a boot record, they have their own partition table instead. Neither extended partitions (containers) nor logical partitions can be booted (very strictly).

A Microsoft MBR boots the partition that's active. That's its typical (any its only) behaviour. Make the Widows partition active => Windows will boot. Make /boot active and Lilo/Grub will boot. Re-install Linux => Windows will stay alive. Reinstall Windows => Linux will stay alive.

Instead of having a normal MBR (created by /sbin/lilo -M or just installed by MS Windows) some people choose to install their first stage bootloader into the first 512 bytes of a disk. When dualbooting, sooner or later these kinds of silly setups will turn out to be a bad choice. When Lilo or grub loses (in any possible way) acces to the other stage images, your setup will be broken. Chainloading NTLDR is very possible to fail if a non-Microsoft MBR is installed. NON-regular MBR users screwing-up a Linux installation (/boot) will screw up the whole system, while Microsoft MBR users just can activate an other partition to make Windows just bootable and happy again.

 *Quote:*   

> Even with the first two disks, since I could not trick xp out of the first partition, I thought there was no reason 
> 
> that xp and gentoo could not share a fat partition (I'll get back to them mon probably to see what happens).  

  Fat is a very evil filesystem. It can be slow and will limit file sizes. Give Windows NTFS wich really is superior above fat in every single way (except write support in Linux). 

You really don't want bootloader stage images in c:\. Imagine you are defragging c:\ => sooner or later that will break Lilo.

 *Quote:*   

> overwriting xp's 512 bytes and [.....]

 My argument: people should _not_ do that. 

Grub is too big to fit in 512 bytes. It will always need some space elsewhere (/boot). This can in fact be anywhere on the disk, but only few choices can be considered as well chosen.

There exist 512 bytes bootloaders (like the FreeBSD bootloader), but in case of Linux or Windows it always needs a cainloader returning into the need of Lilo and GRub to load Linux.

 *Quote:*   

> So I guess my argument would be if you lose the first 512 you will never boot off of the array again no matter where you originally  put grub. 
> 
> Like the raid 0 , argument that you double your chance of data loss , I would say booting from anywhere but the MBR doubles your chance of losing 
> 
> your boot.  (I know thats what backups are for)

  Ignoring your first remark, think about it again please.  :Smile: 

 *Erlend wrote:*   

> Grub doesn't overwrite the MBR.  It just appends something to the end of it to redirect the booting to your /boot partition where grub is installed.

  "Redirecting" is perfectly implemented by the Microsoft MBR. It will load the active partition. Grub's first mini-stage in the MBR behaves differently, but I agree for many people this is the "easiest" way to make sure at least Grub works. Dualbooters will have different experiences in the end  :Smile: 

```
 /sbin/lilo -M /dev/mapper/disk 
```

 will install a MBR having the same behaviour as Microsoft MBR! Another way is MSDOS fdisk /mbr (will only work when 1 harddisk is attached) or reinstalling Windows.

You can make either partition 1-4 active with /sbin/fdisk on the Gen2dmraid cdrom. Make sure only one partition is active at a time.

----------

## irondog

Genkernel now supports dmraid

First traces of official support in Gentoo are there. Genkernel-3.1.0j includes dmraid. 

After placing the device-mapper and dmraid source tarballs into the right directory, you can use

```
genkernel --udev --gensplash --dmraid all

```

To create the kernel / initrd. 

Sata users should append this to modules_load:

```
MODULES_SATA="sata_promise sata_sil sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vitesse sata_ahci"
```

and specify dosata and udev on the kernel commandline.

Thanks to Rocket for the patch.

----------

## flipy

Irondog, can you specify if dmraid supports for 128 chunk size in RAID0?

And if so, does it support the VIA chipset?

Is there any chance to make it work with dmsetup? and about multipath-tools?

Thank you so so much!  :Very Happy: 

----------

## GibKingXXL

I have boot problem here...

```

...

>> Mounting filesystems...

>> Preparing environment for dmraid...

>> Creating /dev/mapper/control character device with major:10 minor:62...

>> Calling dmraid...

ERROR: dos: seeking device "/dev/mapper/isw_xxxx_RAID_Volume1" to 1253632200704

ERROR: adding  to RAID set

>> dmraid was run successfully

>> Determining root device...

>> Mounting root...

mount: Mounting /dev/mapper/isw_xxx_RAID_Volume12 on /newroot failed: Invalid argument

>> Could not mount specified ROOT, try again

>> The root block device is unspecified or not detected

>> Specify real_root=<root_blockdevice> on the kernel cmdline

Please specify a device to boot, or "shell" for a shell...

```

If i start a shell and do

```
ls /dev/mapper
```

it gives me

```

control

isw_xxx_RAID_Volume1

isw_xxx_RAID_Volume11

isw_xxx_RAID_Volume12

isw_xxx_RAID_Volume13

```

My grub.conf

```

timeout 10

default 0

title=Gentoo

root (hd0,0)

kernel /vmlinuz root=/dev/ram0 real_root=/dev/mapper/isw_xxx_RAID_Volume12 init=/linuxrc

initrd /initrd

```

I'd be thankful if anybody could tell me what I did wrong.

I think i followed this tutorial (built kernel with needed support, made initrd, used udev).

----------

## desertstalker

I have a strange problem.  I have 3 HDDs 2 SATA in RAID 0 on an intel ICH5R controller and another on the normal PATA controller.  When i installed windows it put its boot files (boot.ini ntldr etc) on the first partition of the PATA drive.

Can I use this howto? Will I need to reistall windows XP and can it be made to put all its files in the first partition of the RAID array?

Or, is there something I'm missing out on entirely?

Thanks.

PS: Would it hurt to have the linux partitions fisrt on the array (ie. 1-3) and then have the WinXP partitions in a logical drive on the rest of the array?

I'm not that new to linux, but have never needed to get this technical before.  Damn intel, why cant they make a decent RAID device.

----------

## Erlend

 *Quote:*   

> Can I use this howto?

 

Probably.  Linux will only see the SATA ports on your controller though.  And you may have to disable the PATA port in the BIOS.  http://www.linuxmafia.com/faq/Hardware/sata.html#intel-ich5

 *Quote:*   

> Will I need to reistall windows XP and can it be made to put all its files in the first partition of the RAID array? 

 

If you don't need your windows filesystem to be accessible from linux then you can leave it where it is (on the PATA drive).   If you do this (Linux on SATA, Windows on PATA) you shouldn't really use this howto (it will work) because you can then use md linux software raid.  Or do you mean you installed Windows on the SATA raid drives but its boot.ini ntldr files got put on the PATA drive?

You should read this, http://www.linuxmafia.com/faq/Hardware/sata.html#fakeraid.

Erlend

----------

## desertstalker

Never mind.  I managed to kill windows anyway.  So... now i have a nice clean setup with ALL the winXP files in the WinXP dir.

Now... to wait for irondog's site to come back on-line so i can get the initrd.  Can anyone host this for me?

Thanks, for one a windows stuffup was a good thing  :Laughing: 

----------

## irondog

News:

* For creating a initrd with dmraid, you can use genkernel now.

* Viaraid is supported with the newest dmraid

* Site is still down, if it's up again my newly creaded LiveCD can be downloaded. It includes grub (also at startup), genkernel, dmraid-1.0.0.rc6 and the newest baselayout, kernel 2.6.11-(mm1) and some minor configuration fixes.

----------

## desertstalker

I have a problem.  I cannot get grub to load.  I followed the instructions in this howto and all i get upon a reboot is

```
error loading operating system
```

I have tryed using both hd0 and hd1 for grub, that had no effect.

The system is on a P4P800 Deluxe and I am using the ICH5R controller (SATA).

Can anyone shed some light on this problem?

Thanks.

EDIT:  The windows loader is what is giving the error.  it seems it cannot load the grub image.  It is on the first partition (ext3) and has been, AFIK set up correctly. The partiton is active (set through fdisk).

Thanks

EDIT2: OK I got it to boot but there grub does not come up with any menu.  I have to guess the entry and press enter beforre the timer elapses without any menus.  Whats up with that?  Is it because grub cant find the boot partition?.

On second thoughts Id better check the config.

----------

## irondog

 *desertstalker wrote:*   

> 
> 
> EDIT2: OK I got it to boot but there grub does not come up with any menu.  I have to guess the entry and press enter beforre the timer elapses without any menus.  Whats up with that?  Is it because grub cant find the boot partition?.

 

No, grub seems to work but unable to find menu.lst (the configuration file). 

Menu.lst should contain enties that describe grub commands you can also type by hand (making grub a very advanced bootloader). You are now able to say something like this to load linux:

```
root (hd0,0)

kernel /vmlinz root=/dev/ram0

initrd /initrd

boot

```

For Windows you can use the rootnoverify and chainloader commands. Once booted Linux by hand you'll be able to place menu.lst in the right place.

----------

## kabage

 *Quote:*   

> A Microsoft MBR boots the partition that's active. That's its typical (any its only) behaviour. Make the Widows partition active => Windows will boot. Make /boot active and Lilo/Grub will boot. Re-install Linux => Windows will stay alive. Reinstall Windows => Linux will stay alive.
> 
> 

 

Your right I dont understand your version of the boot sequence.

If MS holds the MBR and only boots the the active partition -  How would grub every come up?

 *Quote:*   

> 
> 
>  When Lilo or grub loses (in any possible way) acces to the other stage images, your setup will be broken.

 

Maybe you havn't noticed that WinXp is a two stage loader also so how is this any more or less silly than using lilo or grub on the drives MBR as opposed to the partitions MBR.  From my understanding of the boot sequence no two stage loader will work if it cant find the second stage

 *Quote:*   

>  It's very well possible to have MS Windows installed on the partition 1-4 and having /boot on one of the other four partitions. Problem is, you don't understand you should not touch the MBR written by MS Windows Setup (lets call it a microsoft MBR). So I assume you don't understand the PC bootsequence.

 

 I never said it wasn't, I say its impossible to put a linux partition on partition 1, because XP, will put boot.ini and a couple other config files there by any normal install, unless you know a hack, or maybe I have one of the Chinese versions of XP.

 *Quote:*   

>  Make the Widows partition active => Windows will boot. Make /boot active and Lilo/Grub will boot. Re-install Linux => Windows will stay alive. Reinstall Windows => Linux will stay alive. 
> 
> 

 

You got me on this one? It sounds (ok reads) like your saying to dual boot properly we should go in to fdisk and make the proper partition active according to the system we want to boot.

(I know there is no fdisk on Xp what is it diskpart I believe)

 *Quote:*   

> while Microsoft MBR users just can activate an other partition to make Windows just bootable and happy again. 

 

I would totally disagree If msMBR users screw the partition with boot.ini on it, I dont see how just making say a ms second or third partition or whatever active will make it boot.

----------

## Erlend

 *Quote:*   

> If MS holds the MBR and only boots the the active partition - How would grub every come up? 

 

Because you set the active partition to be grub!  If grub then wants wants to boot windows it uses "makeactive" (to make the windows partition active), and then chainloads the windows bootloader.  Basically, you are inserting a bootloader before the windows one, which can either call the windows one, or just boot linux.  You don't really need to understand this to use it - it works.

Erlend

----------

## irondog

 *kabage wrote:*   

> Your right I dont understand your version of the boot sequence.
> 
> If MS holds the MBR and only boots the the active partition -  How would grub every come up?

  Grub is loaded because it is installed on the partition that's active. Like Erlend explains.

 *Quote:*   

> Maybe you havn't noticed that WinXp is a two stage loader also so how is this any more or less silly than using lilo or grub on the drives MBR as opposed to the partitions MBR.  From my understanding of the boot sequence no two stage loader will work if it cant find the second stage.

  Windows XP installs a Master bootrecord and a bootloader in the partition you are installing it at. It makes that patition active. Very good, clean and safe way to make sure it boots AND to make sure you don't break other OS-es. 

Much linux distributions install their 1stage bootloader direct into the MBR to make sure Linux boots. For dualbooting it's not a very kind thing to do.

 *Quote:*   

> I never said it wasn't, I say its impossible to put a linux partition on partition 1, because XP, will put boot.ini and a couple other config files there by any normal install, unless you know a hack, or maybe I have one of the Chinese versions of XP.

 Don't hack your windows version, try to uderstand it. Do partitioning once and formatting as often as you want: That's the most safe way not to break an OS while installing the other.

 *Quote:*   

> You got me on this one? It sounds (ok reads) like your saying to dual boot properly we should go in to fdisk and make the proper partition active according to the system we want to boot.
> 
> (I know there is no fdisk on Xp what is it diskpart I believe)

 YES Yes. With a Gentoo LiveCD you can fix any bootproblem. After re-installing Windows you can even re-activate grub without touching any LiveCD.

 *Quote:*   

> 
> 
> Because you set the active partition to be grub!  If grub then wants wants to boot windows it uses "makeactive" (to make the windows partition active), and then chainloads the windows bootloader. 

  makeactive is rarely needed. I think it's something to make MSDOS or win98 happy.

----------

## kabage

 *Quote:*   

> Prerequisites
> 
> * Partitioning is already done
> 
> * You have Windows installed on the second partition o/t raid 

 

 *Quote:*   

> You just have to make the first partition active and the Microsoft MBR will load GRUB. 

 

WinXp will always put the second stage (boot.ini) on the first partition, so to put the /boot partition on the first partition is impossible. Which was always really the point for me.

No one really addresses how this is possible, or why it so silly to use grub or lilo in the MBR as opposed to wins boot loader.  

I see no reason to bother learning the nuances of two boot loaders as opposed to one.

A corrupted MBR is not going to work no matter what boot loader is occupying that space.

Third that does explain how you could then boot win if the /boot first 512 get corrupted, but it seems backwards to think it would happen to lin first not win (its the unstable one, with all the attacks on it ) 

Why do a 3 stage process, slower and more chances for a problem going from wins loader, grub or lilo, then the (2nd or should this really be called the 3rd stage in this situation) of your o/s?

----------

## irondog

 *Quote:*   

> WinXp will always put the second stage (boot.ini) on the first partition, so to put the /boot partition on the first partition is impossible. Which was always really the point for me.

 

Bullshit! I'ld like to post my $(df -h) here. First I had windows, then I installed Gentoo, I reinstalled Windows, then I Installed Gentoo. I did this for friends who had problems with setting up their dualboot, fixed it in oneshot. Know Windows/NT for as long as it exists. No-nosense.

Besides you should stop talking about boot.ini as a bootloader. This thing is called "NTLDR" and should not be seen as a second stage loader, but just a very stupid, lame but also a small bootloader wich even can be used to load a unix bootloader.

 *Quote:*   

> No one really addresses how this is possible, or why it so silly to use grub or lilo in the MBR as opposed to wins boot loader.  

  Because the MBR is not the right place for a bootloader that uses STAGES! 

 *Quote:*   

> I see no reason to bother learning the nuances of two boot loaders as opposed to one.

  You shouldn't.

 *Quote:*   

> A corrupted MBR is not going to work no matter what boot loader is occupying that space.

  Duh. MBR's are much too small for advanced bootloaders so they need their space on something that's usually a filesystem.

When you want to reserve your first partition for /boot and after that want to install windows on the second, it can be very important that you mark the first partition as non-FAT/NTFS. Otherwise windows will place it's bootstap loader onto this partition. You format the first partition and windows will break.

----------

## Phk

Hi there guys..

I'm getting nuts trying to make this work....

the dmraidinitrd script fails.... the "genkernel --udev --dmraid" also fails....

dmraidinitrd script:

 *Quote:*   

> (everything normal above)
> 
> Making dmraid...
> 
> Creating initrd image...
> ...

 

Does anyone knows what's this error about? Thanks rightaway....

Phk

----------

## flipy

try and 

```
USE=static emerge busybox
```

----------

## Phk

 *flipy wrote:*   

> 
> 
> ```
> USE=static emerge busybox
> ```
> ...

 

Worked. That made the script work. ... ...

However, i followed the rest of the tutorial, completely, and now booting gives me:

 *Quote:*   

> "ram0" unknown or invalid block(0,0)

 

I even tried with "root=/dev/mapper/sil_cadafceafccb5" but same thing hapens (with "block(0,0)" too...)

Why is this happenning? I have followed everything correctly and no errors appeared!

Please help... I can't sleep anymore thinking about this.. i'm getting insane...  :Rolling Eyes: 

----------

## Erlend

Yeah, think I got that error at some stage too.  Check your initrd support in the kernel.

Erlend

----------

## Phk

 *GibKingXXL wrote:*   

> I have boot problem here...
> 
> ```
> 
> ...
> ...

 

How can i solve this?

by the way: my busybox command-line doesn't have dmsetup.... only dmraid... Which doesn't like "dmraid -ay" saying "no block devices..."

please help.. Thanks again  :Very Happy: 

___________

Erlend: Yes, somehow (my stupidity) the kernel i was using was not the one i configured..... It was a default one.... Using my kernel fixed the "/dev/ram0" problem.

----------

## Erlend

 *Quote:*   

> 

----------

## Phk

 *Erlend wrote:*   

> You should probably make sure the dmraid you are using is a new version (and that dmraid works for you, which it should if you got this far) and that there are no errors being printed (e.g. no linear target etc).

 

Speaking of that, how can i log my boot to a file? ... I don't even know if it is possible...

----------

## Erlend

It is possible to log it to a file (floppy disk usually - since you can't see your hard disk yet).  I've never done it, and I don't know how it is done, but when you get given a shell (after the boot fails) try:

```

mount -t vfat /dev/fd0 /mnt/floppy

dmesg > /mnt/floppy/dmesg-log

```

Which might work.

Erlend

----------

## irondog

Phk, I think you are using Devfs causing the problems with the /dev/mapper/control device. Why don't you use udev?

----------

## Phk

Well, i think i'm using udev!!

I'll show you what i've done:

https://forums.gentoo.org/viewtopic-p-2160792.html

Guess we'd better continue my issue there, to don't fill up this how-to.... 

Thanks.

----------

## Phk

(I've edited the post, and i've managed to copy my output errors to a floppy. I'll post my config files, and outputs, there.)

(And yes, there seems to be a problem with DEVFS and\or my SATA drivers...)

----------

## Adasss

In first post Irondog suggested this:

 *Quote:*   

> mkdir -p /etc/portage
> 
> echo 'app-shells/bash ~x86' >>/etc/portage/package.keywords
> 
> echo 'sys-apps/sysvinit ~x86'>>/etc/portage/package.keywords
> ...

 

I still use it with genkernel method and it works. I have even tried to revert back to normal (not ~x86) versions and it spoiled booting.

----------

## Phk

Nope, i've done it too! However, i've built the initrd with the script "dmraidinit" (in the gen2dmraid homepage)

But if you want, i can go and check those package's versions!!

Do you think i should?

----------

## Phk

My kernel settings were wrong... DevFS was checked, and I was blind....  :Embarassed: 

So know the system boots... for more 3 or 4 seconds until a file-system check error, and then only the maintainance console is available...

Well, i've changed the "/etc/init.d/checkfs" script, so that it wont break if a filesystem-check-error occurs...

I know this is a bad policy, but it's only temporary  :Smile:  I won't keep doing the installation until i've fixed this.

Now, all the above problem have disappeared, except for this one:

 *Quote:*   

>  *   Using /sbin/hotplug as hotplug agent ...
> 
>  * Mounting devpts at /dev/pts ...
> 
>  * Activating (possible) swap ...
> ...

 

And after this, the system boots normally...

I think this problem is in a boot-up script too, which tries to start the array again, without it beeing necessary.

Here's my "rc-update show":

 *Quote:*   

>                acpid |      default                  
> 
>             bootmisc | boot                          
> 
>              checkfs | boot                          
> ...

 

Please tell me if you know what's happenning! Thanks  :Wink: 

----------

## irondog

 *Phk wrote:*   

> My kernel settings were wrong... DevFS was checked, and I was blind....  

  That's what I assumed  :Wink: 

 *Quote:*   

> Please tell me if you know what's happenning! Thanks 

 

Reading /etc/init.d/checkfs:

```
if [[ -z ${CDBOOT} ]] && [[ -f /proc/mdstat ]] ; then
```

/proc/mdstat does not exist for me. So, for me it's the reason I haven't got the problem you are talking about! Maybe you should not link md stuff in your kernel.

----------

## Phk

Nope, the error was even more stupid than the DEVfs one.....

.....

```
# rm /etc/raidtab
```

 

FIXED IT!  :Shocked: 

I only found the reason, because......

/etc/init.d/checkfs has "this" code:

```
 if /etc/mdadm.conf if found, then 

         (blah blah blah)

 else if /etc/raidtab if found, then

         (blah blah blah)

 else

         Quit normally and give Phk a nice error-less booting. =)
```

So, if my INITRD linked my partitions in /dev/mapper, why would i want raidtab anyway?

checkfs tried to mount things and check them (yes..  he's a bit paranoid...), so when he couldn't,

the script required some "Admin maintenance", and a nice reboot after...

Thanks A LOT to Irondog, Erlend, Flipy and Adasss, each one of you fixed me a bug.  :Very Happy: 

Phk

----------

## kwiqsilver

I just followed this howto for installing on my sil1332 sata raid.

I was able to get through the install fine, but when I reboot, I get a grub prompt.

I booted with the CD again and reran all of the grub related parts, and I still get the same thing.

I know very little about grub. Is there a way to have it spit out information that might tell me why it isn't booting?

Thanks.

----------

## kabage

7 messages above.   Sounds like grub can not find grub.conf, but if you use a grub floppy to setup grub you will see the devices as grub truly sees them and can verify your 

root line in grub.conf

----------

## jcdekoning

I have followed the HOWTO but with booting i get some problems

```

Mounting filesystems...

Preparing environment for dmraid...

Creating /dev/mapper/control character device with major:10 minor:63...

Calling dmraid...

no block devices found

dmraid was run sucessfully

Determining root device...

The root block device is unspecified or not detected

Specify real_boot=<root_blockdevice> on the kernel cmdline

Please specify a device to boot, or "shell" for a shell

```

For booting i use a bootable disk with grub because i want to know for sure if this is working before installing grub on the MBR.

Within grub i do

```

root (hd0,2) #partition of the /boot

kernel /vmlinuz root=/dev/ram0 init=/linuxrc real_root=/dev/mapper/isw_deibjbiiec_RAID_Volume15

initrd /initrd

boot

```

Can somebody help me. I really want to install Gentoo on my Intel Software RAID

BTW /dev/mapper only contains control when i go to the shell.

----------

## kwiqsilver

I had an idea of why grub might not be finding my devices.

If I use udev instead of devfs, do I need to use different device names than /dev/mapper/sil_blahblah1 in grub and fstab?

Will booting with a grub floppy show me those new names?

----------

## kabage

Grub floppy will show devices as (hdX,X) no matter what kind of devices.   

But ntldr and grub may not look at them the same so, if you  boot ntldr at (hd0)  which then chains to grub at (hd0,x) [which ever boot partition you use] then grub may suddenly be seeing 

(hd1,x)  or course if your referring to the root device in grub.conf like so

 *Quote:*   

> root=/dev/mapper/raid-blah-device 

  this will not work 

should be something like so 

```
root=(hd0,7)
```

  ** this is my root line (boot partition)  which is really as you can guess is /dev/mapper/blahblah-8 

when you boot in to a grub floppy and type 

root=(hd *press tab here and it will show what devices it sees)   

then when you pick your device 

root=(hdX, *press tab again here and it will show what partitions it sees)   

** yes this should be your boot partition not the real root 

then just pick your boot partition.

Oh and if grub is mapping different then ntldr then one of these messages shows how to remap grub on the fly.

Edit**  In case your mixing root command and real_root

```
title=X-Dream Gentoo v4

root=(hd0,7)    ************** This is BOOT partition

kernel /xdream-v4 root=/dev/ram0 real_root=/dev/mapper/pdc_ciiaceccai7 init=/linuxrc  ****** real_root here refers to your ROOT partition 

initrd /initrd

```

and your setup line would probably be your ROOT partition in grub form for the example above it would be setup (hd0,6)  unless you put grub in the mbr.

----------

## kwiqsilver

I've got the following in grub.conf. 

```

timeout 30

default 0

title  Gentoo

root (hd0,0)

kernel /linux-2.6.11-dmraid root=/dev/ram0 real_root=/dev/mapper/sil_afadeaaieib

hb1 init=/linuxrc

initrd /initrd

title Windows

root (hd0,1)

rootnoverify

chainloader +1
```

/boot is on /dev/mapper/sil_*1, or in grub-speak (hd0,0).

That might be the issue: My real_root is set to the /boot partition. The / partition is sil_*4. I'll try changing real_root to sil_*4 when I get home.

Do I need a grub floppy if my machine "boots" to a grub prompt?

I'll try the root=(<tab> in there if the grub change above doesn't fix it.

As an aside: Why do the /dev/mapper partitions have these long seemingly meaningless device names?

----------

## kabage

For your boot , and I'm not sure why devmapper maps device partitions with such names.

----------

## kwiqsilver

I changed my grub to point real_root to sil*4.

I rebooted and grub complained that I had a bad partition table.

I booted with the CD again and did a grub setup (hd0) to install to the MBR.

Now when I boot, I get a grub error 18.

My partitions are:

sil*1  /boot      30MB

sil*2  winxp      110GB

sil*3  swap       2GB

sil*4   /            180GB

So I don't see why I'm getting the error 18.

----------

## flipy

is there any livecd for amd64 with dmraid? the official doesn't seem to work... while the x86 do work, and gen2dmraid also... so would it be a amd64 version of gen2dmraid?

----------

## kabage

Per gnu.org grub documentation--- (Thanks to gnu, fsf, Mr. Torvalds for everything)

```
18 : Selected cylinder exceeds maximum supported by BIOS

    This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general). 
```

This is why you need a grub floppy it can not map your hard drive by a setting up from the operating system, setting up grub from floppy should solve that error.

Just out of curiosity did winxp not complain about needing the first partition?  (I know 30 Mb is not enough for winxp) but mine insisted that I format that partition.  I am just trying to find out why some versions insist on the first and some do not?

Oh and the cool thing about the floppy , you can feed everything grub needs to it and if it doesnt like it , it brings the grub console back up so you can try again.   

There could be some issues if you let win partition initially and tried to change partitions from linux, this seems to be unacceptable to firm raid, if you changed your mind basically you have to go in to the sata bios and rebuild the raid the repartition from win and then live with it.  (At least on my Asus of course I can not confirm that for other boards)

Oh if you did let XP format your first partition look at and see if there is a file called boot.ini on that partition.

One more question is this a 64 bit system?

Ok one more thing from  *Quote:*   

> http://www.gnu.org/software/grub/manual/grub.html#Creating%20a%20GRUB%20boot%20floppy

 

```
Creating a GRUB boot floppy

To create a GRUB boot floppy, you need to take the files stage1 and stage2 from the image directory, and write them to the first and the second block of the floppy disk, respectively.

Caution: This procedure will destroy any data currently stored o

n the floppy.

On a UNIX-like operating system, that is done with the following commands:

     # cd /usr/share/grub/i386-pc      ****************** for you this is probably   cd /boot/grub   *******************

     # dd if=stage1 of=/dev/fd0 bs=512 count=1

     1+0 records in

     1+0 records out

     # dd if=stage2 of=/dev/fd0 bs=512 seek=1

     153+1 records in

     153+1 records out

     #

     

The device file name may be different. Consult the manual for your OS. 
```

Stage 1 and Stage 2 shoud be in /boot/grub

----------

## irondog

 Gen2dmraid has grub 0.96 as bootloader, no need to create floppies.

 *flipy wrote:*   

> is there any livecd for amd64 with dmraid? the official doesn't seem to work... while the x86 do work, and gen2dmraid also... so would it be a amd64 version of gen2dmraid?

 

Try the 2005.0 liveCD, it has genkernel 3.1.5 which includes dmraid.

After boot type:

```
 dmsetup mknodes
```

To activate dmraid created things. To use dmraid manually on the LiveCD, you need to extract it from the initrd image.

 *kwiqsilver wrote:*   

> 
> 
> Do I need a grub floppy if my machine "boots" to a grub prompt?

 

No, grub seems to work. 

People, please don't confuse Linux things, like device-mapper names and bootloaders.

To jcdekoning: Have you enabled the right modules in the kernel for your controller, what do you use (lsmod) when booting the LiveCD?

----------

## jcdekoning

Thanx irondog for your suggestion. I recompiled the kernel with some SATA modules included in it and now dmraid is working at startup...

except there is another problem coming

```
fsck.ext3: No such file or directory while trying to open /dev/mapper/isw_deibjbiiec_RAID_Volume15

/dev/mapper/isw_deibjbiiec_RAID_Volume15:

The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alterate superblock: 

e2fsck -b 8193 <device>

* Filesystem couldn't be fixed :( [!!]

Give root password for maintance

(or type Control-D for normal startup):

```

Has this something to do with the fact that the names are changed of the devices when booting my kernel? Hopefully someone can help me. /dev/mapper does only contains control.

----------

## jcdekoning

I fixed the problem by using the dmsetup mknodes in the checkroot file. Now the system is booting. Thanx

Anyone ones if this can also be reached with Fedora?

----------

## flipy

 *irondog wrote:*   

>  *flipy wrote:*   is there any livecd for amd64 with dmraid? the official doesn't seem to work... while the x86 do work, and gen2dmraid also... so would it be a amd64 version of gen2dmraid? 
> 
> Try the 2005.0 liveCD, it has genkernel 3.1.5 which includes dmraid.
> 
> After boot type:
> ...

 

well, AFAIK, at boot time, when dmraid loads it has to create some nodes, and after booting if i check /dev there isn't a mapper directory. so if i run dmsetup mknodes it just creates /mapper/control and nothing more. funny thing is that with gen2dmraid everything is mapped (i've a via raid, detected as via or pdc and mapped as pdc.

anyway, i don't know how to extract the initrd file :/ any hint? thanks!

 *jcdekoning wrote:*   

> I fixed the problem by using the dmsetup mknodes in the checkroot file. Now the system is booting. Thanx
> 
> Anyone ones if this can also be reached with Fedora?

 

well, since the creator of dmraid is a part of the fedora project (red hat), I think it has to be in the fedora's installer.

----------

## kwiqsilver

I restored the windows MBR, so grub now loads properly.

But at the grub prompt, I can load the kernel, but I can't set up the root= part properly. I try root=(hd0,3) and root=/dev/mapper/sil*4, but neither works. Both boot options (or no option) give me a kernel panic "Unable to mount root fs on unknown-block(254,4).

When I run geometry (hd0) under grub, I get a message on all but the first partition (/boot) saying  "Selected cylinder exceeds maximum supported by BIOS". Does this mean my / partition has to be at the front of the disk?

I have the following layout

```

hd0,0    /boot    30MB

hd0,1    winxp    110GB

hd0,2    swap     2048MB

hd0,3    /        180GB

```

My geometry is

```
drive 0x80: C/H/S = 2/255/63, The number of sectors = 32130, CHS.
```

----------

## irondog

Your bootloader is fine. You just don't use it correctly to launch the OS  :Smile: 

The root= parameter on the kernel requires a linux device name, so root=(hdx,y) is foolish. 

root=/dev/mapper/part is also impossible as things in /dev/mapper must be set-up in userspace EVERY time you boot.

So, root=/dev/ram0

----------

## kwiqsilver

I tried boot=/dev/ram0 and get the same kernel panic: "Unable to mount root fs on unknown-block(254,4)."

I rebooted with the CD and ran this in grub:

```
/sbin/grub --device-map=/dev/null

grub> device (hd0,0) /dev/mapper/sil_afadeaaieibhb1

grub> device (hd0) /dev/mapper/sil_afadeaaieibhb

grub> root (hd0,0)

grub> setup (hd0,0)
```

Then I checked my grub.conf:

```
timeout 30

default 0

title  Gentoo

root (hd0,0)

kernel /linux-2.6.11-dmraid root=/dev/ram0 real_root=/dev/mapper/sil_afadeaaieibhb4 init=/linuxrc

initrd /initrd

title Windows

root (hd0,1)

rootnoverify

chainloader +1

```

sil_afadeaaieibhb1 is my "/boot" partition.

sil_afadeaaieibhb2 is my winxp partition.

sil_afadeaaieibhb3 is my swap partition.

sil_afadeaaieibhb4 is my "/' partition.

In fdisk, I made sure sil_afadeaaieibhb1 was the only active partition.

Just now while looking through the linuxrc script, I noticed that just before my kernel panic, I see the linuxrc error message about not having a pid of 1.

Am I somehow not calling it correctly? I have linuxrc (and linuxrc-0.93) in my /boot directory with 755 permissions.

----------

## irondog

 *kwiqsilver wrote:*   

> I tried boot=/dev/ram0 and get the same kernel panic: "Unable to mount root fs on unknown-block(254,4)."

 So, bootloader has been installed cleanly.

 *Quote:*   

> checked my grub.conf:
> 
> ```
> timeout 30
> 
> ...

 

Looks fine.

 *Quote:*   

> 
> 
> Just now while looking through the linuxrc script, I noticed that just before my kernel panic, I see the linuxrc error message about not having a pid of 1.
> 
> Am I somehow not calling it correctly? I have linuxrc (and linuxrc-0.93) in my /boot directory with 755 permissions.

 

Linuxrc isn't loacated at /boot. You can find it in the initrd image.

Try passing init=/bin/sh on the kernel commandline.

Run /linuxrc manually by typing:

```
exec /linuxrc  # inherit the shell's PID

```

----------

## kwiqsilver

Okay. I got to the grub prompt and ran the kernel line (with /bin/sh), the initrd line, and boot, and it booted to a shell. I then execed /linuxrc and it worked!  :Very Happy: 

Now the question is, how do I get it to do all that on its own.

The fact that it did work makes me think the issue is the way I'm calling linuxrc, so I'll look into that.

----------

## AlphaHeX

have 2x 120 Seagate SATA harddrives set in bios to be a RAID0 (It's intel ICH5R). I'm booting from Gen2dmraid LiveCD and after 

```
dmraid -ay
```

command i have a block device is /dev/mapper/ called iswfsfsaf[HeX]. I know that raid was discovered by dmraid as [HeX] is a name of the raid which i've set up in the bios. Invoking Code: 

```
fdisk /dev/mapper/ called iswfsfsaf[HeX] 
```

is showing me the whole raid (concerning diskspace - it's 240GB). Do i have to do partitioning before setting up raid in Linux (In Windows) or can i just make partitions under Linux using fdisk? You all are talking here that i have to do partitioning in windows because setting up partitions in Linux will overwrite RAID0 information stored at the begining and at the end of each disk ?

----------

## kwiqsilver

I'm not sure what you *have* to do. But I did the following and it worked:

Gentoo:

Boot gen2dmraid and make your partitions. Mine were:

```
sil_*1 /boot     ext2

sil_*2 windows   ext2 (doesn't matter)

sil_*3 swap      swap

sil_*4 /         reiser3
```

Install gentoo.

One problem I discovered using reiser was the gen2dmraid CD only has support for creating a reiser4 partition, which requires patching the kernel and grub. So I made my sil_*3 partition ext2 and did the install onto it first, including the reiserfsprogs. Then I formatted my / partition as reiserfs and did a copy -a from sil_*3 to sil_*4.

Windows:

Boot your windows CD (remember that windows xp needs SATA drivers on a floppy  :Evil or Very Mad: ).

Under its disk partitioner, delete the windows partition and tell it to install in that free space.

----------

## irondog

 *kwiqsilver wrote:*   

> Okay. I got to the grub prompt and ran the kernel line (with /bin/sh), the initrd line, and boot, and it booted to a shell. I then execed /linuxrc and it worked! 
> 
> Now the question is, how do I get it to do all that on its own.
> 
> The fact that it did work makes me think the issue is the way I'm calling linuxrc, so I'll look into that.

 

If the exec trick works, you should automate it telling the kernel /linuxrc is the initial program. Verify you have init=/linuxrc as the last kernel commandline argument.

 *Quote:*   

> 
> 
> ```
> fdisk /dev/mapper/ called iswfsfsaf[HeX] 
> ```
> ...

 

You can use fdisk to setup the partitions, but it might be a good idea to do partitioning without Linux and dmraid. Doing all initial setup in Linux won't give you any feedback if things are going wrong or well. But normally it should be no problem.

----------

## kwiqsilver

 *irondog wrote:*   

> If the exec trick works, you should automate it telling the kernel /linuxrc is the initial program. Verify you have init=/linuxrc as the last kernel commandline argument.

 

I type in at the grub prompt, the same info from my grub.conf file, word for word:

```
kernel /linux-2.6.11-dmraid root=/dev/ram0 real_root=/dev/mapper/sil_afadeaaieibhb4 init=/linuxrc

initrd /initrd

boot 
```

My guess now is that somehow grub is not reading the grub.conf file when it boots. Or I didn't properly associate the grub.conf file with grub?

----------

## irondog

 *kwiqsilver wrote:*   

> 
> 
> My guess now is that somehow grub is not reading the grub.conf file when it boots. Or I didn't properly associate the grub.conf file with grub?

 If you get a menu, grub succeeded to locate a config file (normally).

 If grub boots with a shell (no menu), it wasn't able to find the config file.

If you are typing in grub, you are in fact overruling the config file.

Try playing with the order of the kernel commandline arguments. Or try to append a space to the last argument. I've been seeinging strange errors when using some linux bootloaders.

Remember you can type 'e' at the grub prompt to edit grub's boot commands (I.E. to edit the kernel commanline).

----------

## kwiqsilver

 *irondog wrote:*   

> If you get a menu, grub succeeded to locate a config file (normally).
> 
>  If grub boots with a shell (no menu), it wasn't able to find the config file.
> 
> If you are typing in grub, you are in fact overruling the config file.

 

That was my guess. Since I just get the grub>  shell prompt, I don't think it sees my config file. I've been searching the internet to try to figure out why.

----------

## irondog

Do you have a /boot/grub/menu.lst file? Never mind, it's not the reason your system ignores init=/linuxrc and stops booting after initializing the kernel. Really, try the space trick!

----------

## kwiqsilver

I assume the space trick is putting a space on the end of the kernel line in grub.conf.

When I get to the grub> prompt I type in the lines from my grub.conf exactly as listed in the conf file (and it boots fine), so would changing the order really do anything?

Does the fact that I reach a grub> prompt mean the kernel has loaded?

Out of curiosity, how is it that grub can see my /boot partition does it have devmapper capability?

----------

## Wicked Wesley

Hey there,

I have an MSI Neo2 motherboard, with an nvdia raid controller on it. I can mount the raid partition, and I installed grub on it, only, it doesn't want to boot, it give me a "Geom" error. I searched around the forums, I searched google, no answer anywhere  :Sad:  Can anyone help me? 

Thanks,

Wesley

----------

## kwiqsilver

 *Wicked Wesley wrote:*   

> it give me a "Geom" error.

 

What is the full text of the error message?

----------

## Wicked Wesley

 *kwiqsilver wrote:*   

>  *Wicked Wesley wrote:*   it give me a "Geom" error. 
> 
> What is the full text of the error message?

 

It just says "Geom" that's it.

But I researched some more, I found out that GRUB can't read off my RAID devices for some strange reason, I booted grub from a floppy, typed in kernel (hd1,0)/bzImage and it gives me some kind of error message about the kernel. I try to load the exact same kernel from another partition (Non-RAID) and it works fine. Same thing with the initrd file. Anyone got any idea why? I would love some help with this, I've been trying to get Linux working for more than a week now  :Sad: 

Weird thing too:

If I type "Geometry" GRUB returns the wrong C/H/S values. I try to change them, nothing happens.

Another odd thing:

I can't boot into GRUB from my RAID disk, It hangs at loading stage 2, I believe.

I think I'm gonna message some GRUb dev or something.

Thanks for your time,

Wesley

----------

## Ubnormal

At first, big thanks to irondog, this howto is VERY helpfull, after hours of reading this howto and many kernel compilations my Gentoo box is up and running with an Intel ICH6R fakeraid controller. All the problems i had are the problems of kernel setup. This things have worked for me:

1) Compile into kernel(NOT MODULE!!!) device-mapper(and all of it's feautures)

2) Compile into kernel(NOT MODULE!!!) Multiple device driver support

3) Compile into kernel(NOT MODULE!!!) ata_piix

4) Compile into kernel(NOT MODULE!!!) driver for your raid controller in a "SCSI low -level drivers"

5) DISABLE devfs support in the Filesystems->Pseudo Filesystems->devfs

Let's go back to the subject. Now i have a working RAID mirror and the big question is how to detect hardware failure of one of the disks in the mirror and how to make this array work after replacement of the dead disk.

----------

## jcdekoning

I don't know if this is the right place but i just want you to know that i have installed fedora with dmraid support.

To make installation possible i booted my pc with the gen2dmraid live cd. I mounted my hdd and my other cdrom drive which contains the fedora installation dvd.

Then i mounted the stage2 file from the fedora installation drive and copied it to the hdd. I create an extra rpm directory and copied all the rpm packages from the installation dvd to this directory. Next i used chroot on my hdd to get me logged in inside the stage2 enviroment.

I installed all the rpm packages which are normally installed for a minimum installation by using the fedora installer. I found this list inside the root directory of my laptop which has a minimum installation of fedora. The file is called install.log

The first time i used rpm i get some errors about missing a directory in var. I created this directory and started rpm --initdb. Then i installed all the rpm packages. You still will get some warnings but this is now problems. Use --nodeps when there are some dependicies issues. 

After installing of all the rpm i downloaded the kernel source and compiled device-mapper and some sata devices inside it. (just like gentoo). Next i used the dmraidinitrd script to create an initrd file. I get some error with compiling busybox so i downloaded a new one and changed the dmraidscript.

Next i installed grub just like you do with gentoo and rebooted my pc. I also had some problems with the dmsetup mknodes issue so i put this command inside some bootscript. Then i rebooted an fedora was there.

This story looks really easy but i get a lot of errors by the installation which i have not described here and are pc dependent. I just described the global installation. Maybe i will create a detailed description later. Good luck!

----------

## NoControl

Hi,

I have a problem trying to boot off of my device-mapped raid0 array.

The entire installation went basically fine. GRUB starts (I get the menu) and my kernel boots. But I suspect it never gets to executing linuxrc (not sure, unfortunately).

The last three messages my kernel says:

```
RAMDISK: Compressed image found at block 0

UDF-fs: No partition found (1)

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
```

I've read this entire topic (and another howto on this forum for with the partition-mapper script  :Smile: ) and I haven't read a solution yet. Is it normal that it's trying to mount unknown-block(1,0)?

Is my problem initrd/linuxrc related, or are those already run?

My partition setup (160gb total):

```
   32Mb   /boot (ext2)

 1024Mb   swap

10240Mb   / (reiser4)

10240Mb   /home (fat32)

10240Mb   (emtpy) (reserved for WinXP)

   rest   /mnt/junk (fat32)
```

Steps I took for setting up GRUB:

```
grub --device-map=/dev/null

device (hd0,0) /dev/mapper/isw_cacaigadei_twins1

device (hd0) /dev/mapper/isw_cacaigadei_twins

root (hd0,0)

setup (hd0,0)

quit
```

My grub.conf:

```
default 0

timeout 8

title Gentoo GNU/Linux 2.6.11-gentoo-r6

root (hd0,0)

kernel /2.6.11-gentoo-r6 root=/dev/ram0 real_root=/dev/mapper/isw_cacaigadei_twins3 init=/linuxrc

initrd /initrd
```

I've also tried the suggestion at the end of the howto (replacing hd0 with hd1 everywhere), but then GRUB complains before starting the kernel.

I've also tried replacing the setup (hd0,0) command with setup (hd0), but that had no noticable effect.

Since my kernel is booting, I assume the array can be read by GRUB, so I think the problem is either reiser4 (first time I'm using it) or the initrd (most likely).

Anyone any ideas?

Thanks in advance!

----------

## Erlend

 *Quote:*   

> But I suspect it never gets to executing linuxrc (not sure, unfortunately). 

 

Test it.  Edit your initrd...

1. mv initrd initrd.gz && gunzip initrd.gz

2. mount -o loop initrd /mnt

3. cd /mnt

4. nano -w linuxrc

5. Edit the file to contain echo "hi" at the top and save

6. cd /

7. umount /mnt

8. gzip initrd

9. mv initrd.gz initrd

 *Quote:*   

> RAMDISK: Compressed image found at block 0
> 
> UDF-fs: No partition found (1)
> 
> Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

 

I'm quite familiar with this kind of error message, but not referring to udf!  UDF is on of the cdrom filesystems.  Can't help you with this one, except to tell you to check that your initrd is in ext2 format.

Erlend

----------

## Erhnam

Maybe someone can provide us with a small howto on a clean installation? (with fdisk) A lot of people are trying to install this on clean boxes.

----------

## AlphaHeX

1. I'm assuming you have 2 SATA disks connected to the motherboard and SATA RAID ROM is enabled in the bios. Also Boot-in device in bios is set to RAID (it depends on Motherboard, i have Abit IC7).

2. Create RAID0 in BIOS, choose stripe size which would you like to have, you can also choose a RAID0 name.

3.Download the Gen2dmraid LiveCD and boot it

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-0.99.iso

4. Download also the following scripts:

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/dmraidinitrd

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc

4. Boot the CD with Dmraid option

5. after the system has been booted in the shell run the following

```
 dmraid -ay -f isw
```

6. it will create entries in 

```
/dev/mapper
```

7. In my case it was 

```
iswfsafsafsa[HeX]
```

isw is a short name of Intel Software Raid and [HeX] is a raid name which i've choosen in the bios during RAID0 creation.

8. As have garlicbread mentioned on the https://forums.gentoo.org/viewtopic-t-244941-highlight-.html topic i didn't use fdisk or cfdisk to create partitions because these programs are showing total available diskspace in the RAID not taking into consideration that additional space is required for raid metadata.

9. I've used Partition Magic 8.0 (2 floppy disks version) to create partitions within the earlier created RAID0. Available free diskspace reported by Partition Magic was different than that reported by fdisk or cfdisk - PM reported less available free space which is correct as some of the diskspace was user by raid metadata

10a. What is concering partinions scheme I have a nice one  :Smile: 

```

/dev/mapper/iswfsafsafsa[HeX]1  primary partiton                   /boot

/dev/mapper/iswfsafsafsa[HeX]2  primary partiton                   swap

/dev/mapper/iswfsafsafsa[HeX]3  primary partiton                   NTFS

/dev/mapper/iswfsafsafsa[HeX]5  1st partition in extended partiton NTFS

/dev/mapper/iswfsafsafsa[HeX]6  2st partition in extended partiton /root

/dev/mapper/iswfsafsafsa[HeX]7  3nd partition in extended partiton /home

/dev/mapper/iswfsafsafsa[HeX]8  4rd partition in extended partiton /opt

/dev/mapper/iswfsafsafsa[HeX]9  5th partition in extended partiton /usr

/dev/mapper/iswfsafsafsa[HeX]10 6th partition in extended partiton /usr/local

/dev/mapper/iswfsafsafsa[HeX]11 7th partition in extended partiton /usr/portage

/dev/mapper/iswfsafsafsa[HeX]12 8th partition in extended partiton /var

/dev/mapper/iswfsafsafsa[HeX]13 9th partition in extended partiton /tmp

/dev/mapper/iswfsafsafsa[HeX]14 10th partition in extended partiton FAT32
```

10b. To be able to see block devices in /dev/mapper/ you have to run the following command:

```
mkdir /mnt/gentoo/dev/mapper 

mount -o bind /dev/mapper /mnt/gentoo/dev/mapper
```

11. I've done chroot and install Gentoo a normal way (chroot was working fine i'm not on 64 bit system)

12. In the mean time i've also installed Windows XP Professional sp2

13. What i have found to be important is grub configuration and initrd creation.

```
Grub should not detect bios device names itself! Do this or be a fool!:

/sbin/grub --device-map=/dev/null

# (hd0,0) is the first partition on the first disk (from bios point of view!!)

grub> device (hd0,0) /dev/mapper/iswfsafsafsa[HeX]1

# (hd0) is the first disk (and thus containing (hd0,0) )

grub> device (hd0) /dev/mapper/iswfsafsafsa[HeX]

# That's it, the rest should be easy:

grub> root (hd0,0)

 Filesystem type is ext2, partition type 0x82

grub> setup (hd0,0)

 Checking if "/boot/grub/stage1" exists... yes

 Checking if "/boot/grub/stage2" exists... yes

 Checking if "/boot/grub/fat_stage1_5" exists... yes

 Running "embed /boot/grub/fat_stage1_5 (hd0,0)"... failed (this is not fatal)

 Running "embed /boot/grub/fat_stage1_5 (hd0,0)"... failed (this is not fatal)

 Running "install /boot/grub/stage1 (hd0,0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded

Done.
```

I've done it in the way presented above (it's from gen2raid homepage) but it didn't work for me  :Sad: 

 *Quote:*   

> I had to run setup (hd0) - "installation into MBR"

 

after that i had grub menu on my screen after reboot.

14. Having dmraidinitrd file download do a chmod +r dmraidinitrd to have it executable.

15. You have to ammend the dmraidinitrd itself, below is a code what is inside it:

```

changing this values might involve editing make_busybox()

BUSYBOX_URI_PREFIX="http://gentoo.osuosl.org/distfiles/"

BUSYBOX_TARBALL="busybox-0.60.3.tar.gz"

BUSYBOX_DIR="busybox-0.60.3"

#changing this values might involve editing make_devicemapper()

DEVICEMAPPER_URI_PREFIX="ftp://sources.redhat.com/pub/dm/"

DEVICEMAPPER_TARBALL="device-mapper.1.01.00.tgz"

DEVICEMAPPER_DIR="device-mapper.1.01.00"

#changing this values might involve editing make_dmraid()

#please, don't use older versions of dmraid with this version of dmraidinitrd

DMRAID_URI_PREFIX="http://people.redhat.com/~heinzm/sw/dmraid/src/"

DMRAID_TARBALL="dmraid-1.0.0.rc6.tar.bz2"

DMRAID_DIR="dmraid/1.0.0.rc6"

#Download directory (an existing one is allowed)

DISTFILES_DIR="/tmp/download"

#Temporary directory (must not already exist)

TMPDIR="/tmp/initrd"

#Tweak this one when having "no space left on device" errors

BLOCKS="2048"

#Dmraid depends on the device-mapper userspace library

#Leave this setting to "0" if you want this script to compile it.

DEVICEMAPPER_INSTALLED="0"

```

I've change programs to be in their newest versions (except busybox)

 *Quote:*   

> dmraid - 1.0.0.rc7
> 
> device-mapper - 1.01.01

 

I didn't change also  *Quote:*   

> DEVICEMAPPER_INSTALLED="0 to 1

 

You can try with this if you want  :Smile: 

16. I've also had modified linuxrc file. I've removed these lines:

```

#workaround: dmraid should not probe cdroms, but it does.

   #we'll remove al cdrom device nodes till dmraid does this check by itselve

   for y in hda hdb hdc hdd hde hdf hdg hdh sr0 sr1 sr2 sr3;

   do 

      if (grep -q "$y" /proc/sys/dev/cdrom/info)

      then

         rm -f /dev/"$y"

      fi

   done

```

These lines were causing 12 message saying that can't find /proc/sys/dev/cdrom/info. Maybe if you have compiled into kernel IDE or SCSI cdrom support it will work for you.

16. Now run 

```
./dmraidinitrd linuxrc initrd
```

17. You have to compile into kernel SATA, SATA ICH5 support, support for initial RAM disk, boot partition file system support (depending of what file system it is you have to have ext2 or ext3 or reiserfs compiled into kernel), from RAID and LVM option in kernel:

```
# 

# Multi-device support (RAID and LVM) 

# 

CONFIG_MD=y 

CONFIG_BLK_DEV_MD=y 

CONFIG_MD_LINEAR=y 

CONFIG_MD_RAID0=y 

CONFIG_MD_RAID1=y 

CONFIG_MD_RAID10=m 

CONFIG_MD_RAID5=y 

# CONFIG_MD_RAID6 is not set 

CONFIG_MD_MULTIPATH=y 

CONFIG_MD_FAULTY=m 

CONFIG_BLK_DEV_DM=y 

CONFIG_DM_CRYPT=y 

CONFIG_DM_SNAPSHOT=y 

CONFIG_DM_MIRROR=y 

CONFIG_DM_ZERO=y 

# CONFIG_DM_MULTIPATH is not set 

CONFIG_BLK_DEV_DM_BBR=m 

# CONFIG_DM_FLAKEY is not set

```

18. In GRUB menu.lst I have

```

title GNU/Linux 

root (hd0,0) 

kernel /kernel-2.6.11-gentoo-r4 root=/dev/ram0 real_root=/dev/mapper/iswfsafsafsa[HeX]6 init=/linuxrc 

initrd /initrd
```

19. I think that's all what is concerning dmraid setup. As I have understood from many posts on gentoo forums you can use dmraid and my howto if your software raid controller is supported by dmraid, if it is not that you can use dmsetup and howto located here:

https://forums.gentoo.org/viewtopic-t-244941-highlight-.html

20. I've tried to use 

```
genkernel --udev --dmraid all
```

but it didn't work for me  :Sad:  Maybe i've done sth wrong  :Smile: 

21. As i've mentioned earlier fdisk and cfdisk were reporting wrong free disk space (without taking into consideration space used by raid metadata) thus i didn't give them a try and used Partition Magic. If you are brave you can try it for yourself  :Smile: Last edited by AlphaHeX on Fri May 20, 2005 10:58 am; edited 2 times in total

----------

## NoControl

 *Erlend wrote:*   

>  *Quote:*   But I suspect it never gets to executing linuxrc (not sure, unfortunately).  
> 
> Test it.  Edit your initrd...
> 
> 1. mv initrd initrd.gz && gunzip initrd.gz
> ...

 

That was the problem! I usually compile ext2fs as a module, because I only use it for /boot, and it's GRUB who's reading /boot, so the kernel doesn't need it compiled in. But now it did, for the initial RAM disk, only, I didn't know  :Smile: 

(Solved this myself a week ago, but forgot to post it here  :Sad:  thanks  :Very Happy: )

This is perhaps a valuable addition to the HOWTO (ext2 required for the initrd)?

----------

## AlphaHeX

 *NoControl wrote:*   

>  *Erlend wrote:*    *Quote:*   But I suspect it never gets to executing linuxrc (not sure, unfortunately).  
> 
> Test it.  Edit your initrd...
> 
> 1. mv initrd initrd.gz && gunzip initrd.gz
> ...

 

AlphaHeX  *Quote:*   

>  It was mentioned in point 17  but i've modified Howto adding information about Initial RAM disk 

 

----------

## Shamus397

I just thought I'd mention that version 1.0.0.rc7 of dmraid is out and it now properly detects Promise 20378 RAID 1 (mirror) setups and reports the correct size of the mirror (previous versions used to report it as being 1/2 of its true size and wouldn't detect installed partitions at all). I don't know if this fixes other vendor's RAID 1 setups, but it might be worth a try if it didn't work for you at all before (and if it doesn't, you should definitely send the maintainer a bug report!). Now if only he would put in an option to let you give the partitions sane names (instead of pdc_arghblahyuk01 and the like)!  :Twisted Evil: 

----------

## Erlend

For those using raid 0 arrays, is there really any benefit to using dmraid instead of dmsetup?

Thanks,

Erlend

----------

## irondog

No, of course not. Dmraid creates mapping you cound create by hand with dmsetup  :Smile: 

----------

## Erlend

Has anybody tried hdparm with device mapper?  I've always been curious about this tool, and I've read various howtos but I always run into problems.  If someone could explain the workings of this tool with sata raid that would be great.

Firstly, if I do hdparm -tT /dev/sda dev/sdb /dev/mapper/ataraid

I get the same results for all drives.  You would expect the first two to be the same speed (they are the same drive), but the ataraid device is a raid-0 map of the other two - so shouldn't it have ~1.7 x each individual drive speed?  For comparison, I get approximately:

```
/dev/sda:

 Timing cached reads: 3192 MB in 2.00 seconds = 1593.85 MB/sec

 HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered diskreads: 166 MB in 3.01 seconds = 55.18 MB/sec

 HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

/dev/mapper/ataraid:

 Timing cached reads: 3172 MB in 2.00 seconds = 1585.45 MB/sec

 HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered diskreads: 166 MB in 3.01 seconds = 55.10 MB/sec

 HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

```

Which seems quite respectable, but why am I getting the "Inappropriate ioctl for device" error?

Thanks,

Erlend

----------

## kwiqsilver

I get the same error message, but my drive outputs go from just under 60MB/s for the "scsi" devices to about 80MB/s for the mapper device. I did a long series, then averaged them and it came out to a 40% improvement.

```
[root@iceman]#S hdparm -t /dev/mapper/sil_afadeaaieibhb; hdparm -t /dev/sda; hdparm -t /dev/sdb

/dev/mapper/sil_afadeaaieibhb:

 Timing buffered disk reads:  240 MB in  3.03 seconds =  79.22 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

/dev/sda:

 Timing buffered disk reads:  178 MB in  3.03 seconds =  58.68 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

/dev/sdb:

 Timing buffered disk reads:  178 MB in  3.03 seconds =  58.75 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

```

If the numbers aren't higher for your mapper device, it doesn't sound like you have a working RAID-0. Are you running it as a RAID-1?

----------

## Erlend

Definitely a RAID-0 striped array... I'm using dmsetup without dmraid, here is the line I'm passing in my linuxrc:

```
echo "0 468712440 striped 2 128 /dev/sda 0 /dev/sdb 0" | /sbin/dmsetup create ataraid
```

I don't even have the mirror target compiled in my kernel!

This might be related to (U)DMA I suppose, not sure how to check that though?

Thanks,

Erlend

----------

## gecko1969

rather new to the whole gentoo thing so forgive please if I am missing something "basic".

When I follow the gentoo handbook and chroot, envupdate and so on the listings for the mapped devices is gone.

So no entry in /dev/mapper infact no mapper at all...

Thanks for any help through this.

Curits

----------

## Erlend

That's quite normal.  There are two solutions:

1. Don't worry about it (only if during install, you don't always explicitly need the device nodes while installing gentoo)

2. Better solution, just before chrooting... run:

```
mkdir /mnt/gentoo/dev/mapper

mount -o bind /dev/mapper /mnt/gentoo/dev/mapper
```

replacing /mnt/gentoo with wherever your new installed gentoo lies.  This just mirrors a part of your filesystem somewhere else on the filesystem, i.e. making /dev/mapper accessible to your chrooted env.

Erlend

----------

## Wicked Wesley

Has anyone got Hybrid (BIOS) Raid working with an AMD64?!

----------

## flipy

 *Wicked Wesley wrote:*   

> Has anyone got Hybrid (BIOS) Raid working with an AMD64?!

 

yes... in fact, you can use dmraid to manage it for you... or dmsetup... try to read a little bit (hint: go back some pages on this post...)

----------

## Wicked Wesley

 *flipy wrote:*   

>  *Wicked Wesley wrote:*   Has anyone got Hybrid (BIOS) Raid working with an AMD64?! 
> 
> yes... in fact, you can use dmraid to manage it for you... or dmsetup... try to read a little bit (hint: go back some pages on this post...)

 

Yeah, I know what to do, but grub doesn't wanna work along  :Sad: 

----------

## gecko1969

 *Erlend wrote:*   

> That's quite normal.  There are two solutions:
> 
> 1. Don't worry about it (only if during install, you don't always explicitly need the device nodes while installing gentoo)
> 
> Erlend

 

But it makes installing grub a twist. Using a floppy is fine but having not to use the floppy is even better.

Thanks for the answer though. I am just about ready to boot my new system (with fingers crossed for luck)

Curtis

----------

## gecko1969

So I am now stuck at a similar problem that ohers had.

preparing enviroment for dmraid

calling dmraid

no block devices found 

I am using udev not devfs.

When I drop to shell I only have in /dev/mapper

the control file.

My /dev/sd* exsits.

Any clues how to fix?

Other info:

partitions

1. NTFS             100GB   (WinXP)

2. Linux                 50MB (boot)

3. Swap                   4GB

4. Linux                300GB (root)

grub.conf

root (hd0,1)

kernel /kernel-2.6.11-gentoo-r6 init=/linuxrc root=/dev/ram0 real_root=/dev/mapper/pdc_deiaajaa4

initrd /initrd

----------

## gecko1969

Well Genkernel seems to have saved the day... Guess I was missing something in my make of the kernel. Off to get the rest of the system up and running.

Great thread BTW. Be nice to clean it up and get the facts all out and organized.

Curtis

----------

## bendis

Hi,

I have an Adaptec Serial ATA RAID 1210SA controller card and I try to set up a RAID1 array (mirror) using two 80GB Seagate harddisks. This controller has a Sillicon Image chipset (sata_sil).

1. I have create the array in the Adaptec BIOS utility (Ctrl-A when booting).

2. I have booted using the bootcd found at http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/.

3. dmraid -ay creates no mappings, dmraid -r shows no software raids  :Sad: 

```
livecd ~ # dmraid -rvv

NOTICE: skipping removable device /dev/hdc

NOTICE: /dev/sda: hpt37x discovering

NOTICE: /dev/sda: hpt45x discovering

NOTICE: /dev/sda: isw    discovering

NOTICE: /dev/sda: lsi    discovering

NOTICE: /dev/sda: nvidia discovering

NOTICE: /dev/sda: pdc    discovering

NOTICE: /dev/sda: sil    discovering

NOTICE: /dev/sda: via    discovering

NOTICE: /dev/sdb: hpt37x discovering

NOTICE: /dev/sdb: hpt45x discovering

NOTICE: /dev/sdb: isw    discovering

NOTICE: /dev/sdb: lsi    discovering

NOTICE: /dev/sdb: nvidia discovering

NOTICE: /dev/sdb: pdc    discovering

NOTICE: /dev/sdb: sil    discovering

NOTICE: /dev/sdb: via    discovering

No Software RAID disks

```

What am I doing wrong? Please help...

Bendis

----------

## AlphaHeX

bendis probably nothing wrong  :Smile:  I'm not sure if you Raid controller is supported by Gen2Raid CD. Please send me an output from dmesg.

----------

## Erlend

Has anybody had any luck with swsusp2 and dmsetup created devices?

I've just tried and I keep getting:

```

Software Suspend Core.

Software Suspend text mode support loading.

Software Suspend userspace UI support loading.

Software Suspend LZF Compression Driver loading.

Software Suspend Swap Writer loading.

md: Autodetecting RAID arrays.

md: autorun ...

md: ... autorun DONE.

RAMDISK: ext2 filesystem found at block 0

RAMDISK: Loading 2048KiB [1 disk] into ram disk... done.

=== Software Suspend ===

BIG FAT WARNING!! Failed to translate "/dev/mapper/ataraid5" into a device id.

If you want to use the current suspend image, reboot and try

again with the same kernel that you suspended from. If you want

to forget that image, continue and the image will be erased.

Press SPACE to reboot or C to continue booting with this kernel

Default action if you don't select one in 30 seconds is: continue booting.

```

which is annoying, because the initrd hasn't even been mounted yet - so obviously the /dev/mapper/ataraid5 device won't exist.

My command line is:

```

Kernel command line: root=/dev/ram0 real_root=/dev/mapper/ataraid4 init=/linuxrc

 real_init=3 real_init_script=/sbin/init resume2=/dev/mapper/ataraid5 noresume2

```

Anybody had any better experiences?

Thanks,

Erlend

----------

## gecko1969

Seems that once I boot into Windows GRUB won't come back up unless I boot with a Live CD and use fdisk to set the windows partition to non-active.

How can I configure GRUB so that this won't happen. WinXP is on the first partition with /boot on the 2nd partition. If I have to swap the partitions around to get it to work what is the best way/tool to do this? I would rather not have to reinstall XP.

Thanks for help,

Curtis

----------

## Erlend

Okay, so your grub.conf probably contains something like:

```

title=Windows XP

rootnoverify (hd0,2)

chainloader +1

makeactive

```

?

So every time you boot windows, it's parition is (permanently) made the active partition... so next time you boot the MBR points your computer towards the bootloader on (hd0,2) - i.e. the windows partition - bypassing grub.

The fix?  Remove "makeactive", so it should just read (for example):

```
# First Entry...

title=Windows XP

rootnoverify (hd0,2)

chainloader +1
```

Erlend

----------

## gecko1969

OK! I will give this a try. Thanks.

FWIW:

I think I am going to throw in the towel with this project as I am not comfortable with the "bleeding edge" aspect of this workaround. Maybe if the code had more people working on it (although I must give credit to the creator for all the effort) and maybe if the chip makers were more supportive in helping the linux community. If this was just my play machine I'd have no problem keeping it as is but it's my day to day machine. I learned a ton for the effort though and don't regret the time spent (too much), but I am not seeing any performance increase with hdparm.

Best of luck to the rest of your efforts and I will be lurking here to help when I can and keep tabs on any progress.

Curtis

----------

## Erlend

I wouldn't say there is anything particularly "cutting-edge" about it.  It works, although you are correct about hdparm - it isn't meant for sata drives.  I use dmsetup with a promise tx2plus card and have no problems (apart from hdparm).  It is quite usable once set up correctly.

Erlend

----------

## SkidSoft

Man,

I've tried alot of things and I cannot get it working for me. I have an A7N8X-E Deluxe and keep getting the 18 error from grub like others have gotten. I already had linux setup on my IDE connections but now both of the kernels for that have crapped out on boot and even the 2005.0 live CD cannot see the partitions I used to use on the IDE in an extended partition. Anyhow...

I can still use my grub that I used before and it sees my raid array as hd2, so this would be much like the booting of the floppy disk. Only problem is that it won't recognize the device command. SO, I reboot back into the array with the dmraid live cd and it just keeps giving me the 18 error no matter how I record the devices, including the NTFS partition. 

My Partitions are as follows on the Raid 1:

1. NTFS - Windows XP - ~ 160 GB

2. /boot - ext2 ~32 MB

3. /Swap ~ 2 GB

4. /  - ext3 ~ 150 GB

My three linux partitions' space has been sitting Unused for well over a year. I'd REALLY like to get it working so I can get my MythTV back up and running, etc. 

Any more thoughts on why I might get this 18 error? Thanks!

----------

## irondog

Error code 18 from the grub manual:

 *Quote:*   

>  Selected cylinder exceeds maximum supported by BIOS.
> 
> This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).

 

Why don't you place /boot BEFORE the windows partition (160GB!!!)??

You would want to have /boot small and in a place the BIOS can reach.

You might want to use a partition resize tool to fix it before trying to install grub again.

----------

## Erlend

Is the "error 18" occurring when you try and install grub?  If so, I had the same error.  The fix is to change how you install grub...

The gentoo documentation lists using grub-install as the default method, which is fine for most users.  Somehow it doesn't seem to work on dmsetup drives.  Instead you should create a "grub bootdisk", instructions here: http://www.gnu.org/software/grub/manual/grub.html#Creating%20a%20GRUB%20boot%20floppy

then you should continue with "Installing grub natively":

http://www.gnu.org/software/grub/manual/grub.html#Creating%20a%20GRUB%20boot%20floppy

You'll notice using this method that you only have one apparent hard disk - that's good - the raid bios is mapping them together temporarily (this is so that e.g. windows can see it's initial startup files).

Erlend

----------

## irondog

Or use the 0.99a version of the LiveCD which also has Grub.

----------

## Tyler_Durden

After switching from P4-System (i875, ICHR5-SATA-Raid) to my new AMD-System (sig below) i had problems booting with lilo.

I had to setup my RAID in the BIOS again, installed the system as usual + lilo 22.7.

It crashed with several errors (worked fine with the Intel system) like:

1.) "keytable read/checksum error" (no boot menu)

2.) "Decompressing gentoo........invalid compressed format (err=1)" (after select gentoo inside the menu)

3.) "EBDA big..."

So i tried grub, but had no luck also...

After reading the changelog for rc8-release of dmraid, i attempted my luck again with lilo and it worked now!

These are my details:

fdisk output:

```

HAL9000 ~ # fdisk -l /dev/mapper/nvidia_aidcffca

Disk /dev/mapper/nvidia_aidcffca: 320.0 GB, 320083769344 bytes

255 heads, 63 sectors/track, 38914 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

                      Device Boot      Start         End      Blocks   Id  System

/dev/mapper/nvidia_aidcffca1   *           1       37607   302078196    7  HPFS/NTFS

/dev/mapper/nvidia_aidcffca2           37608       38823     9767520   83  Linux XFS

/dev/mapper/nvidia_aidcffca3           38824       38914      730957+  82  Linux swap / Solaris

```

lilo.conf

```

HAL9000 ~ # cat /etc/lilo.conf

# $Header: /home/cvsroot/gentoo-x86/sys-boot/lilo/files/lilo.conf,v 1.1 2003/12/09 08:12:34 seemant Exp $

# Author: Ultanium

#

# Start LILO global section

#

# Faster, but won't work on all systems:

#compact

# Should work for most systems, and do not have the sector limit:

lba32

# If lba32 do not work, use linear:

#linear

# MBR to install LILO to:

boot = /dev/mapper/nvidia_aidcffca

map = /boot/.map

# If you are having problems booting from a hardware raid-array

# or have a unusual setup, try this:

disk=/dev/sda inaccessible    # see this as the first BIOS disk

disk=/dev/sdb inaccessible    # see this as the first BIOS disk

#disk=/dev/sda bios=0x81                 # see this as the second BIOS disk

#disk=/dev/hda bios=0x82                 # see this as the third BIOS disk

menu-scheme=Wb

prompt

# If you always want to see the prompt with a 15 second timeout:

timeout=50

delay = 10

#default = Gentoo

default = Windows-XP

# Normal VGA console

vga = normal

# VESA console with size 1024x768x16:

#vga = 791

#

# End LILO global section

#

#

# Linux bootable partition config begins

#

image = /boot/vmlinuz

        initrd = /boot/initrd-2.6

        #vga=0x317

        root = /dev/ram0

        label = Gentoo

        read-only # read-only for checking

        append = "init=/linuxrc real_root=/dev/mapper/nvidia_aidcffca2 video=vesafb:1280x1024-32@60,mtrr, \

        ywrap splash=verbose,theme:livecd-2005.0 elevator=deadline"

# Linux bootable partition config ends

# DOS bootable partition config begins

other = /dev/mapper/nvidia_aidcffca1

        label = Windows-XP

# DOS bootable partition config ends

```

After emerging world, now I'm getting stuck with the ghostscript-compile crash/kernel oops on AMD64, but thats another story...  :Confused: 

----------

## gecko1969

You might not consider it "bleeding edge" but it's mostly not supported and is VERY likely to get stepped on by some emerge. My lack of understanding is my biggest fear. While I might not understand a more "vanilla" install I know that it has been tested.

I get nervous when I browse config files for genkernel, udev, rc, and others that just seem waiting to break dmraid. I'd like to re-build my kernel to add somethings but looking at genkernel.conf I see it points to old versions of baselayout, device-mapper, udev, and so on... I was not able to get Gentoo to boot when I built the kernel by hand but genkernel was able to make a bootable kernel (although much much larger than the hand built one) so I must have missed something.

So I am going to fence sit for a bit more. Sooner than later I NEED to get my Treo to sync with Evolution and I seem to not have the visor mod made (although I don't see anything mentioned in the kernel config file for visor, palm or pda, either on or off....).

Regards,

Curtis

----------

## irondog

 *Tyler_Durden wrote:*   

> After reading the changelog for rc8-release of dmraid, i attempted my luck again with lilo and it worked now!
> 
> 

 

Wow. A lilo user. Used my dmraid patch?

 *gecko1969 wrote:*   

> You might not consider it "bleeding edge" but it's mostly not supported and is VERY likely to get stepped on by some emerge. My lack of understanding is my biggest fear. While I might not understand a more "vanilla" install I know that it has been tested.

 

Nope, I see it differntly. We are the pioneers with dmraid to get it tested and get it officially supported later. If things very close related to dmraid break, I'm really sure it will be reported on this forum the same day. 

 *Quote:*   

> I get nervous when I browse config files for genkernel, udev, rc, and others that just seem waiting to break dmraid.

  I agree, things can break, but if you understand how Gentoo works the cause to a problem can be found. If you don't, there wil be dozens of other people with the same problem who do understand what has caused the problem and can fix it or share their solution. This thread for example, is very important and usefull, I think.

 *Quote:*   

>  I'd like to re-build my kernel to add somethings but looking at genkernel.conf I see it points to old versions of baselayout, device-mapper, udev, and so on... I was not able to get Gentoo to boot when I built the kernel by hand but genkernel was able to make a bootable kernel (although much much larger than the hand built one) so I must have missed something.

  If you want to use a custom kernel config, you can use /etc/kernels to use your own.

My personal problem is that working ebuilds existing for dmraid are still not accepted into portage. It's not that I need those ebuilds, but it's very important for gentoo to have them. No ebuilds -> No LiveCD dmraid support.

For example: I worked to solve a bug in Genkernel to have dmraid running on LiveCD's. This has been accepted into Genkernel and in the newest official Gentoo LiveCD. The 2005.0 liveCD now has broken dmraid support because it misses /usr/sbin/dmraid. This can make users confused getting the message "Activating device mapper raid(s)" but once fully booted there is no dmraid tool available. I regret dmraid support in the official LiveCD is 'broken', but please have it fully supported in the next release!

----------

## Tyler_Durden

 *Quote:*   

> 
> 
>  *Quote:*   
> 
> Tyler_Durden hat folgendes geschrieben::
> ...

 

Yes, of course i did!  :Very Happy: 

----------

## kwiqsilver

 *SkidSoft wrote:*   

> Man,
> 
> I've tried alot of things and I cannot get it working for me. I have an A7N8X-E Deluxe and keep getting the 18 error from grub like others have gotten.

 

I have the same board and spent a long time working on this.

Even when I had a 32MB boot as /dev/mapper/sil_*1, I still got the 18 error when I tried to read the /boot/grub/menu.lst from within grub. Grub thought /boot/grub/ was a file, not a directory. When I copied menu.lst into /boot, I could run "configfile(?) menu.lst" from within grub to get a menu.

My eventual solution was to put /boot on /dev/hda (I also created a 2GB boot partition for windows, because it can't install entirely on the second disk).

I wanted the extra IDE drive anyway (I use it for my nightly backups), so it's not a bad solution for me.

----------

## SkidSoft

 *kwiqsilver wrote:*   

>  *SkidSoft wrote:*   Man,
> 
> I've tried alot of things and I cannot get it working for me. I have an A7N8X-E Deluxe and keep getting the 18 error from grub like others have gotten. 
> 
> I have the same board and spent a long time working on this.
> ...

 

Funny, I actually have my boot partition on my /dev/hda also but it's started recognizing it as an EZDrive and not recognizing it in an extended partition, like it used to work. No idea why that changed. Anyhow, I have no problem getting grub to boot, and the boot floppy didn't help at all as it didn't work, but grub won't see the SATA drives or something... And even if it does, it gives the 18 error. Man, this sucks, but I have to make this works as it will mess up all my windows stuff if I jumble around my drives, etc like I wish I could.

----------

## AlphaHeX

kwiqsilver and SkidSoft if you could describe in details what you have done (from the beginning) what method (dmraid live CD, 2005.0 LiveCD or another way) did you use, what is your configuration (RAID controler, mobo, etc) and what is the layout of the partitions you would like to have.

----------

## Skreems

 *gecko1969 wrote:*   

> preparing enviroment for dmraid
> 
> calling dmraid
> 
> no block devices found 
> ...

 

I know you posted that genkernel "magically" fixed this. I had a similar problem and didn't want to run genkernel because it currently can't make an initrd with a working dmraid setup on my system. I THINK the problem on your system (it was on mine with the same symptoms) was not including the right SATA drivers, under Device Drivers -> SCSI -> Low-Level -> SATA NV (in my case) in the kernel config. Just for the record.

----------

## hoopek

Hello!

I'm newbie to linux, but used gentoo on my old barracuda IV. Now i have 2 Samsungs SATAII NCQ and LanParty NFII Ultra B (Silicon 3114). I installed Windows and try to install Gen2. But while trying dmraid -ay i recive error msq:

```
ERROR: sil: invalid metadata checksum on /dev/sda

ERROR: sil: invalid metadata checksum on /dev/sda

ERROR: sil: invalid metadata checksum on /dev/sda

ERROR: sil: invalid metadata checksum on /dev/sda

ERROR: sil: invalid metadata checksum on /dev/sdb

ERROR: sil: invalid metadata checksum on /dev/sdb

ERROR: sil: invalid metadata checksum on /dev/sdb

ERROR: sil: invalid metadata checksum on /dev/sdb

No software RAID detecyed.
```

My /dev/mapper contains only control file. I have 5 partitions:

1. 20GB FAT32

5. 20GB none, want ext3

6. 2GB FAT16

7. 2GB none, want swap

8. 255GB NTFS

Plz help.

----------

## Skreems

Off the top of my head, I'd guess that you haven't created the raid partition with the bios utility yet. When using softraid, you need to use the bios utility to set up what drives are part of what raid arrays before trying to use them with any type of OS.

----------

## hoopek

I created it pressing F4 on startup, then installed windows XP and created partitions with instalator. Now I want make ma hda5 ext3 and install there Gen2.

----------

## irondog

Try the newer iso. The problem might be that you are using a too old version of dmraid.

This iso is up-to-date:

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-i686gcc4-1.0.iso

----------

## hoopek

Seams to work... just created filesystems!

Big THX!!!  :Very Happy: 

----------

## aidanjt

This is my 1 lone serious gripe about dmraid...

Why on gods earth did the author decide to write it all in userspace?

Surely the more sensible thing to do is to write a simple initiation/control interface patch for the kernel tree under device-mapper to allow the kernel to mount partitions.  And any other code could be diverted to userspace.  There are a lot of people who detest initrd because it feels like a nasty hack.. which it practically is.

I think it was good that someone started on bios raid workarounds for linux 2.6 (since ataraid was wasn't ported over for some reason i cannot seem to unmask).  But it hasn't been implimented as well as it could have.  If I wanted to use an initrd driver i would have simpily used my manufactors "open source" (heh) drivers.

I honestly can't see any disadvantage of having this in kernel space,  and I can see plenty with the oposite.

----------

## irondog

 *AidanJT wrote:*   

> This is my 1 lone serious gripe about dmraid...
> 
> Why on gods earth did the author decide to write it all in userspace?

  Because this is the trend in Linux kernel development. Why has devfs been vanished out? Why is genspash using userspace helpers? Next to come is the whole partitioning thing I bet! Dmraid is just a very early bird.

 *Quote:*   

> Surely the more sensible thing to do is to write a simple initiation/control interface patch for the kernel tree under device-mapper to allow the kernel to mount partitions.

  Sounds not too bad. Just write it!

 *Quote:*   

>   And any other code could be diverted to userspace.  There are a lot of people who detest initrd because it feels like a nasty hack.. which it practically is.

  Monolithic kernels just need things like an initrd. Sometimes it feels like a hack, but it's the only way to make a monolithic kernel more modular.

 *Quote:*   

> I think it was good that someone started on bios raid workarounds for linux 2.6 (since ataraid was wasn't ported over for some reason i cannot seem to unmask).  

  Ataraid was dropped because Linus only wants to support good code.

 *Quote:*   

> But it hasn't been implimented as well as it could have.  If I wanted to use an initrd driver i would have simpily used my manufactors "open source" (heh) drivers.

  I vote for a kernel patch that allows to move partitioning back to the kernel. I would also like some ioctl's to be available for lilo compatibility.

 *Quote:*   

> I honestly can't see any disadvantage of having this in kernel space,  and I can see plenty with the oposite.

  You can't just do everything inside the kernel. It already is a big monster and things that can be done outside, should be.

----------

## aidanjt

 *irondog wrote:*   

> Because this is the trend in Linux kernel development. Why has devfs been vanished out? Why is genspash using userspace helpers? Next to come is the whole partitioning thing I bet! Dmraid is just a very early bird.

 

I agree with this trend in moving as much unnessecery stuff out of kernel space for stability, and maintainablity purposes, udev is a perfect example of doing it right since the kernel doesn't depend on userspace tools to mount root.

 *irondog wrote:*   

> Sounds not too bad. Just write it!

 

Looks like I'll have to look into it, I havn't done kernel coding before, so I'll probibly have a steep learning curve heh.  I have a book somewhere on 'Linux Programming' which has a section on the kernel, looks like I'll need to dust off the tombs.

 *irondog wrote:*   

> Monolithic kernels just need things like an initrd. Sometimes it feels like a hack, but it's the only way to make a monolithic kernel more modular.

 

Yes, an unfortunate by-product of binary only distros.

 *irondog wrote:*   

> Ataraid was dropped because Linus only wants to support good code.

 

Hmm, unfortunatly on the other side of that coin it made BIOS RAID+Dual-booting a nightmare (and practically impossible before dmraid besides mostly broken partial sources from the device manufactor).. Hopefully It will motivate people in our situation enough to do something about it.  BIOS RAID chips are being used pretty commonly, its cheap and nasty, but performes admirably in RAID0/Desktop situations.  3ware is overkill for that kind of application with little performance gain.

 *irondog wrote:*   

> I vote for a kernel patch that allows to move partitioning back to the kernel. I would also like some ioctl's to be available for lilo compatibility.

 

ioctl's would be nice, it would help if we had experienced kernel coders who know about I/O stuff.. I don't mind giving it a try and likely trash my partitions, since all my work is offloaded on a fileserver.  What we would need the patch to do is i) initalise the array ii) add a device node, and nodes for any partitions iii) have some control mechanisms for userspace tools. (am i missing anything?)

 *irondog wrote:*   

> You can't just do everything inside the kernel. It already is a big monster and things that can be done outside, should be.

 

Indeed, I agree fully.

Does anyone else think this is a good idea and worth investing time in?

P.S.  My thanks to the origional poster of this HOWTO, its really helpful and gave good advice based on the tools available.

----------

## irondog

 *AidanJT wrote:*   

> Yes, an unfortunate by-product of binary only distros.

  Wrong. There is nothing unfortunate on that.

I mean 'Monolithic' as the opposite of 'Microkernels', not as the opposite of a linux kernel split into loadable modules. Whatever you do to the Linux kernel: it will stay a monolithic kernel. 

Besides that it would be a real nightmare if all distributions try to compile a kernel during installation optimised for the system. (Which i think is what you were thinking of, blaming source only distro's).

 *irondog wrote:*   

>  What we would need the patch to do is i) initalise the array ii) add a device node, and nodes for any partitions iii) have some control mechanisms for userspace tools. (am i missing anything?)

  No, I really don't agree. Early userspace will become VERY popular in the future and dmraid's functionality must not be backported to the kernel again.

Keep it the way it is, but change the behaviour a little bit:

i) dmraid tels device-mapper kernel runspace to setup a RAID (striped or mirrored)

ii) dmraid tells the device-mapper that the newly created device is somthing that contains a partition table

iii) kernel reads partition table and creates linearly mapped devices on top of the stripe/mirrored device

iv) Kernel provides ioctls for: a) re-reading the partition table b) getting info about cylinders / heads / and sectors

Results:

* Better consistency, which helps partitioning programs and installing bootloaders 

* all distro's can support dmraid much easier as it will look like something like a scsi disk instead of something really uncommon.

In other words:

* There is nothing wrong with raid setup in userspace and very modular kernels using initrd's (this can be scripted).

* Device-mapper stuff differs too much from normal block devices (scripting this is seems too hard for most distro's developpers).

 *Quote:*   

> P.S.  My thanks to the origional poster of this HOWTO, its really helpful and gave good advice based on the tools available.

 

NP

----------

## aidanjt

 *aidanjt wrote:*   

> Yes, an unfortunate by-product of binary only distros.

 

This comment was regarding the nessecity of initrd to power a modular kernel on binary only distros.

I personally don't like initrd because you need to add unnessecery code to the kernel simpily to get the thing to mount root, you shouldn't need to do this.. kernel modules are fine if you only use certain things from time to time, I2C, ALSA/sound card drivers etc.. for things that you run constantly the additional overhead doesn't make any sense.  I'm not saying every distro should compile during installation, its up to the user to determine if binary only makes sense to them (or don't understand the point of source installation).

Offloading code to userspace is a good idea, things like tux and administerive code in kernel space bloats the kernel and things can be done more effectively  in userspace.  Just so long as you don't require mounting half a complete system in an initrd just to mount root.  In this case dmraid can't tell device-mapper anything unless its bundled in initrd which shouldn't be a forced nessecity.  Not everyone wants their kernel sprawling with modules, i.e. genkernel is fine for newbies but counter productive for people who know what a kernel is and how to compile one that works with their hardware.  my rule of thumb for compiling-in support for something is if i use it 90% (or more) of the time, that goes under the likes of Disk controllers, networking etc.., and the 10% I don't use all the time I would compile as modules, these would fall under the catagory of I2C, ALSA, etc.. initrd is used 0.009% of a machines uptime which adds unnessery size to the kernel.

Having dmraids primary initalisation functionality in kernel space wont stop distros from being able to modulate it and toss it in initrd, it just means there is a choice for people who do compile their own kernels.  If anything it will cut down on initrd size because you don't need all the dmraid program in initrd to mount the root fs and thus reducing unnessery overhead to booting all round.

Technically you can do anything at all in userspace with the kernel doing practically nothing, however it isn't optimal for performance considerations, and makes booting more tedious and (user) error prone.

----------

## denis.r

 *irondog wrote:*   

> Try the newer iso. The problem might be that you are using a too old version of dmraid.
> 
> This iso is up-to-date:
> 
> http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-i686gcc4-1.0.iso

 

I have been following this thread for quite some time and had successfully installed my system with the 0.99 version of the ISO. Recently I had to reinstall my boot loader and tried this ISO. It did not work for me. I had to go back to the 0.99 ISO.

When I use the 0.99 ISO and execute:

```
dmraid -ay
```

The device files are all correctly created in 

```
/dev/mapper
```

. When I use the 1.0 version of the ISO above I only get:

```
/dev/mapper/isw_bidjfdiibg_RAID_Volume1
```

None of the device files are created for the partitions. I also tried:

```
dmraid -ay -f isw
```

but this did not help. I have 11 partitions and they show up just fine with the 0.99 version of the ISO, but only the volume shows up with the 1.0 version of the ISO.

Is there anything else I can do to collect more information on why this is happeneing  :Question: 

And who should I send it to  :Question: 

I am using:

```

localhost ~ # /sbin/dmraid --version

dmraid version:         1.0.0.rc7 (2005.04.07)

dmraid library version: 1.0.0.rc7 (2005.04.07)

device-mapper version:  4.4.0

```

This also makes me a bit reluctant to upgrade my system to dmraid 1.0.0.rc8. It might not boot again  :Sad: 

Denis (This is my first post here)

----------

## denis.r

This is an update on my last post.

I did a bit more troubleshooting and found that dmraid version 1.0.0.rc8 is not a problem.

I installed dmraid 1.0.0.rc8 and it works fine with my gentoo 2.6.11-r9, but if I use gentoo 2.6.12-r9 it fails just like with the gen2dmraid-i686gcc4-1.0.iso. So it seems to be related to some change in 2.6.12. That is what the 1.0 ISO is using.

NOTE: Both gentoo releases show the same device-mapper version 4.4.0.

I have not had a whole lot of time to work on this, but I'll see if I can now gather some more information. I would like to try to initialize the raid without using dmraid, but I'll have to first search for those instructions. I've seen them before, but cannot remember the tool/steps I need to do to do this. Maybe then I'll get a better error message about why dmraid does not create the device files for release 2.6.12.

My RAID is Intel ICH5R. Is anyone else having problems with 2.6.12?

Any other tips/hints would be appreciated.

Denis

----------

## irondog

I would really appreciate if you could test some things with a vanilla kernel. So 2.6.11, 2.6.12 and 2.6.13 without any patchsets.

----------

## denis.r

 *irondog wrote:*   

> I would really appreciate if you could test some things with a vanilla kernel. So 2.6.11, 2.6.12 and 2.6.13 without any patchsets.

 

Sure, I'm open to that. What exactly would you like me to test, and how would I build this "vanilla" kernel?

So far I have had no problems at all with 2.6.11; just with 2.6.12, and the 1.0 ISO did not work. I assume the 1.0 ISO is pretty vanilla, or not?

Do you mean vanilla as in directly from http://www.kernel.org/ ? Or do you mean vanilla as in only the minimum kernel config? (or both)

BTW, I used genkernel to generate my kernel. I don't know what was used to build the kernel in the 1.0 ISO.

Denis

----------

## irondog

 *denis.r wrote:*   

> My RAID is Intel ICH5R. Is anyone else having problems with 2.6.12?

 

No. Not with 2.6.11, 2.6.12, 2.6.13 neither with gentoo patchset nor with vanilla.

 *denis.r wrote:*   

> 
> 
> Sure, I'm open to that. What exactly would you like me to test, and how would I build this "vanilla" kernel?
> 
> So far I have had no problems at all with 2.6.11; just with 2.6.12, and the 1.0 ISO did not work. I assume the 1.0 ISO is pretty vanilla, or not?
> ...

  Vanilla means from www.kernel.org without modifications. My experience with patchset kernels like gentoo sources (which I used for the latest livecd for example) is, that they have bugs oftenly (admitting they have very nice features).

Dennis. Before testing the different kernels, can you post the output of these command after booting the livecd's you've burned? 

```

uname -r

dmesg

lsmod

dmsetup --version

dmsetup table

```

So, I mean, boot all livecd's you have ever downloaded from my site and repeat these steps and post the results.

Later I will see if I can provide a livecd with a different kernel/patchset/configuration.

----------

## denis.r

OK. I have collected logs from both the live CDs I have. They are a bit long, so I posted them at the following URLs:

http://www.rachal.de/bugs/collect.0.99a.log

http://www.rachal.de/bugs/collect.1.0.log

I also mailed them to you.

Thanks!

Denis

----------

## irondog

Problem in 1.0 version was dm-mirror isn't loaded at early boot. This is fixed in genkernel cvs and in the new version of gen2dmraid:

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-i686gcc4-1.1.iso

Thnx for reporting.

----------

## rishi

Hi There,

Great thread, very helpful!

I'm trying to setup gentoo on my Alienware Area-51m 7700 laptop, which uses the Promise SATA378 TX2+ controller. I have two drives on the controller set in RAID 0. I've done some extensive searchin on the net over this and have read this thread through and through, but still hitting a wall...

OK, I have successfully got through the howto just fine (no problems!? everything went through just like in the howto), right through to:  *Quote:*   

> After this you must edit /etc/fstab, leave the chroot, unmount the partitions, reboot and cross your fingers that it works.

 

I reboot the machine and gub comes up nicely. However, when I choose an option to boot (either gentoo or win) I get:

```
Error 21: Selected disk does not exist
```

Interestingly, I can setup grub on either of (hd2) or (hd3) without error... (I can even do "find /boot/gub/stage1" and it comes back saying (hd2,0) or (hd3,0) respectively, suggesting to me that it has worked). 

Any ideas / help please? Really frustrating, I feel like I'm nearly there!!!

Some info:

```
livecd ~ # ls -la /dev/mapper/

total 0

drwxr-xr-x   2 root root     180 Sep 11 16:26 .

drwxr-xr-x  15 root root   13600 Sep 11 16:27 ..

crw-rw----   1 root root  10, 61 Sep 11 16:26 control

brw-------   1 root root 252,  0 Sep 11 16:26 pdc_ggagcdif

brw-------   1 root root 252,  1 Sep 11 16:26 pdc_ggagcdif1

brw-------   1 root root 252,  2 Sep 11 16:26 pdc_ggagcdif2

brw-------   1 root root 252,  3 Sep 11 16:26 pdc_ggagcdif3

brw-------   1 root root 252,  4 Sep 11 16:26 pdc_ggagcdif5

brw-------   1 root root 252,  5 Sep 11 16:26 pdc_ggagcdif6
```

and

```
livecd ~ # fdisk -l /dev/mapper/pdc_ggagcdif

Disk /dev/mapper/pdc_ggagcdif: 120.0 GB, 120023154688 bytes

255 heads, 63 sectors/track, 14591 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

                   Device Boot      Start         End      Blocks   Id  System

/dev/mapper/pdc_ggagcdif1   *           1          12       96358+  83  Linux

/dev/mapper/pdc_ggagcdif2              13        2574    20579265    7  HPFS/NTFS

/dev/mapper/pdc_ggagcdif3            2575       13933    91241167+  83  Linux

/dev/mapper/pdc_ggagcdif4           13934       14591     5285385    f  W95 Ext'd (LBA)

/dev/mapper/pdc_ggagcdif5           13934       14189     2056288+  82  Linux swap / Solaris

/dev/mapper/pdc_ggagcdif6           14190       14591     3229033+   b  W95 FAT32

livecd ~ #   
```

and just in case it is useful:

```
livecd ~ # uname -r

2.6.13-gentoo

livecd ~ # dmsetup --version

Library version:   1.01.03 (2005-06-13)

Driver version:    4.4.0

livecd ~ # dmsetup table

pdc_ggagcdif: 0 234420224 striped 2 256 8:0 0 8:16 0

pdc_ggagcdif6: 0 6458067 linear 252:0 227946348

pdc_ggagcdif5: 0 4112577 linear 252:0 223833708

pdc_ggagcdif3: 0 182482335 linear 252:0 41351310

pdc_ggagcdif2: 0 41158530 linear 252:0 192780

pdc_ggagcdif1: 0 192717 linear 252:0 63

livecd ~ #     
```

and finally, the 'presumably' interesting part of dmesg:

```
libata version 1.12 loaded.

sata_promise version 1.02

acpi_bus-0212 [06] acpi_bus_set_power    : Device is not power manageable

ACPI: PCI Interrupt 0000:0a:02.0[A] -> GSI 19 (level, low) -> IRQ 19

sata_promise PATA port found

ata1: SATA max UDMA/133 cmd 0xF8D46200 ctl 0xF8D46238 bmdma 0x0 irq 19

ata2: SATA max UDMA/133 cmd 0xF8D46280 ctl 0xF8D462B8 bmdma 0x0 irq 19

ata3: PATA max UDMA/133 cmd 0xF8D46300 ctl 0xF8D46338 bmdma 0x0 irq 19

ata1: no device found (phy stat 00000000)

scsi2 : sata_promise

ata2: no device found (phy stat 00000000)

scsi3 : sata_promise

ata3: dev 0 cfg 49:0f00 82:746b 83:7fe8 84:4023 85:f469 86:3c48 87:4023 88:203f

ata3: dev 0 ATA, max UDMA/100, 117210240 sectors: lba48

ata3: dev 1 cfg 49:0f00 82:746b 83:7fe8 84:4023 85:f469 86:3c48 87:4023 88:203f

ata3: dev 1 ATA, max UDMA/100, 117210240 sectors: lba48

ata3: dev 0 configured for UDMA/100

ata3: dev 1 configured for UDMA/100

scsi4 : sata_promise

  Vendor: ATA       Model: HTS726060M9AT00   Rev: MH4O

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 117210240 512-byte hdwr sectors (60012 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 117210240 512-byte hdwr sectors (60012 MB)

SCSI device sda: drive cache: write back

 sda: sda1 sda2 sda3 sda4 < >

Attached scsi disk sda at scsi4, channel 0, id 0, lun 0

  Vendor: ATA       Model: HTS726060M9AT00   Rev: MH4O

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sdb: 117210240 512-byte hdwr sectors (60012 MB)

SCSI device sdb: drive cache: write back

SCSI device sdb: 117210240 512-byte hdwr sectors (60012 MB)

SCSI device sdb: drive cache: write back

 sdb:<7>ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0090f50000402464]

 unknown partition table

Attached scsi disk sdb at scsi4, channel 0, id 1, lun 0

device-mapper: 4.4.0-ioctl (2005-01-12) initialised: dm-devel@redhat.com
```

----------

## rishi

P.S. - Might want to update this into the HOWTO, step 1:

 *Quote:*   

> Problem in 1.0 version was dm-mirror isn't loaded at early boot. This is fixed in genkernel cvs and in the new version of gen2dmraid:
> 
> http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-i686gcc4-1.1.iso 

 

I dutifully downloaded 0.99, found out that didn't work and then found out about 1.1 !

Thanks for a great HOWTO!

----------

## rishi

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 :Confused: 

Cancel that post!

I have got grub working OK now on (hd0)...

which definately wasn't working when I tried it many times originally. 

I used the command prompt option when grub failed to boot and used the command completion option (tab) to find that hd0 was the only device it could find... Reconfigured everthing from that and now I'm up and running. 

Thanks SO much for this HOWTO!   :Smile: 

Cheers,

----------

## godish

I am having a very frustrating time geting grub/lilo to work properly! I have via raid controller,but i cannot get anything (Lilo or grub) to boot properly! Grub will either just reboot, or lockup and Lilo loads L then a ton of 9's onthe screen! Please take a look at my post in another forum  :Smile:  https://forums.gentoo.org/viewtopic-p-2725711.html#2725711 Ive tried all the sugestions, and it just doesnt seem to work right on via raid... Has anyone gotten it to work on it?

----------

## irondog

Plz post the output of 

```
# dmsetup table
```

----------

## godish

dmsetup returns this...

```
via_bhfgiiaeh4: 0 104422500 linear 254:0 40178565

via_bhfgiiaeh3: 0 39086145 linear 254:0 1092420

via_bhfgiiaeh2: 0 1012095 linear 254:0 80325

via_bhfgiiaeh1: 0 80262 linear 254:0 63

via_bhfgiiaeh: 0 144607678 striped 2 32 8:0 0 8:16 0
```

----------

## matze81

hey guys,

i've got a little problem dual booting my windows system.

i use an intel ICH5R controller with RAID0.

I followed this Howto and all works fine instead of

booting win behind 8GB.

My hdd looks like this

```

/dev/mapper/isw_bicegifhbf_RAID_Volume1p1               1        1094     8787523+  17  Hidden HPFS/NTFS

/dev/mapper/isw_bicegifhbf_RAID_Volume1p2   *        1095        2188     8787555    7  HPFS/NTFS

/dev/mapper/isw_bicegifhbf_RAID_Volume1p3            2189        3282     8787555   17  HPFS/NTFS

/dev/mapper/isw_bicegifhbf_RAID_Volume1p4            3283       19089   126969727+   5  Erweiterte

/dev/mapper/isw_bicegifhbf_RAID_Volume1p5            3283        6686    27342598+  17  HPFS/NTFS

/dev/mapper/isw_bicegifhbf_RAID_Volume1p6            6687       11671    40041981   83  Linux

/dev/mapper/isw_bicegifhbf_RAID_Volume1p7           11672       11795      995998+  82  Linux swap / Solaris

/dev/mapper/isw_bicegifhbf_RAID_Volume1p8           11796       15442    29294496    7  HPFS/NTFS

/dev/mapper/isw_bicegifhbf_RAID_Volume1p9           15443       19089    29294496    7  HPFS/NTFS

```

hd(0,0) and hd(0,1) contain a windows installation.

I can boot the first system without any problems, the second just did nothing.

Grub says the following

```

grub> device (hd0) /dev/mapper/isw_bicegifhbf_RAID_Volume1

grub> geometry (hd0)

drive 0x80: C/H/S = 620/128/63, The number of sectors = 4999680, /dev/mapper/isw_bicegifhbf_RAID_Volume1

   Partition num: 0,  Filesystem type unknown, partition type 0x17

   Partition num: 1,

Error 18: Selected cylinder exceeds maximum supported by BIOS

   Partition num: 2,

Error 18: Selected cylinder exceeds maximum supported by BIOS

grub> 

```

i fixed this with passing the CHS numbers to grub.

Because of this problem i think the controller isn't able to run in LBA mode.

But one thing confuses me, booting /dev/mapper/isw_bicegifhbf_RAID_Volume1p6 is no

problem. How does this fit together with the problem of the second windows partition?

Has anybody an idea how to solve the problem?

greetings

matze

edit:

i found some mistakes in the partition table, after correcting this it works, great.     :Very Happy: Last edited by matze81 on Sat Sep 17, 2005 8:55 am; edited 1 time in total

----------

## irondog

There is nothing strange in the output, hnm. What's your partition layout (fdisk -l)?

Try this old version of the livecd. It contains grub at boottime:

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-0.99a.iso

When grub appears, type 'c' to spawn the grub shell. After that try commands like root(hd0,0). Now you can play around with grub from the livecd and try to get a view of your filesystems from real-mode. These have to match with the mappings dmraid creates.

You can install grub from the livecd (not even booting it).

----------

## godish

Ok, i manged to get grub install, and gentoo to boot, but it is far from orthdox...  :Smile: 

I ended up using the windows grub installer http://www.geocities.com/lode_leroy/grubinstall/

Created C:\boot copied menu.1st (aka grub.conf) stage1 and stage2 into that directory.

Then ran Grubinstall.exe -D to install grub. Then added C:\boot\stage1="GRUB" into C:\boot.ini

I then tried the following menu.1st config

BTW  Here is my partition layout...

[boot (EXT2)] [SWAP] [root (Reiserfs)] [Windows XP]

```
# Gentoo :-D

default 0

timeout 10

title=Gentoo Linux

root (hd0,2)

kernel /kernel-gentoo /root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/mapper/via_bhfgiiaeh3 udev dodmraid

initrd /initramfs
```

But, it gave a error #2, cannot read the file. So... I decided to put the kernel and ramdisk into the windows C:\boot directory.

modified menu.1st too

```
# Gentoo :-D

default 0

timeout 10

title=Gentoo Linux

root (hd0,3)

kernel /boot/kernel-gentoo /root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/mapper/via_bhfgiiaeh3 udev dodmraid

initrd /boot/initramfs
```

Which works! The thing that perplexes me, is that it can read the kernel, and ramdisk off the ntfs partition, but not the ext2 partition!

I also tried reading it off my root partition (reiserfs), and that also gave an error (had a copy of the kernel there too just in case). I would have to believe that the dmraid has a problem with writing to the disk so that the onboard controller (VIA) can read it nativly for booting. Because, it can read the NTFS partition perfectly... 

One thing I might try is changing my boot partition to a dos (fat32) partition so I can read and write to that partition in linux and load grub onto that partition along with the kernel. Please reply with any comments/suggestions  :Smile: 

*EDIT I converted the /boot partion to a fat32 partition from ext2, and it booted fine. When i mounted it in linux, wrote to it (new kernel), it thrashed all the files! It was still readable in linux, but grub wouldnt read any files off of it, same with windows. I know that linux can write sucessfully to a fat32 partition because i have been using my usb flash drive to transfer files between windows and linux which uses /dev/sdd, not the dmraid driver!

----------

## irondog

Yeah, Seems that dmraid doesn't map it the way the BIOS (and windows) look at it. This must be a dmraid bug. Plz contact the creator of dmraid.

----------

## rizen83

Going to attempt to install Gentoo on my new raid setup on an Asus A7N8X-E, is the guide on the first post upto date? Sorry a bit tierd and heading to bed after I make this post.

----------

## TUX4O

Hi, gentoo-fans! 

I have sucessfully installed RAID1 with dmraid on computer which I'm using like web server. This computer have integrated on motherboard raid controller (fake-raid) Promice FastTrack S150 TX4 and 2 x 180GB SATA. 

And partitions are: 

```

Disk /dev/mapper/pdc_cdehedided: 163.0 GB, 163000000000 bytes

255 heads, 63 sectors/track, 19816 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

                     Device Boot      Start         End      Blocks   Id  System

/dev/mapper/pdc_cdehedided1   *           1         609     4891761   83  Linux

/dev/mapper/pdc_cdehedided2             610         853     1959930   82  Linux swap / Solaris

/dev/mapper/pdc_cdehedided3             854       19816   152320297+  83  Linux
```

I'm trying to install Gentoo on other computer (it will be file server) with RAID 0+1 (with the same controller Promice FastTrack S150 TX4) and 4 250GB SATA HDD. 

The Raid bios setting program allows me to set up only STRIPE 4 x 250G = 1T  (RAID0)

or   

RAID 0 + 1  (not 1+0) stripe of 2 mirrors = 500GB

And now the problem  :Sad: 

I'm booting Gen2dmraid cd (with option dodmraid). 

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/

After booting from Gen2live cd I'm BIG surprized when I get message: 

ERROR: dos: reading /dev/mapper/pdc_jhbjechd[No such file or directory]

I check /dev/mapper :

```
livecd root # ls /dev/mapper/

control  pdc_jhbjechd 
```

yes , there is pdc_...... (but why pdc_ + 8 characters ? on other PC there is pdc_ + 10 characters !)

```

livecd root # fdisk /dev/mapper/pdc_jhbjechd

Unable to read /dev/mapper/pdc_jhbjechd

```

 I'm startup again dmraid :

```

livecd root # dmraid -ay

pdc_jhbjechd already active

ERROR: dos: reading /dev/mapper/pdc_jhbjechd[No such file or directory]

```

Please somebody help!

If it's impossible to setup RAID 0+1 with dmraid, PLEASE tell me how to setup software RAID 0+1 or RAID 1+0 (4 SATA drives!!!)

10X in advance  & excuse me for terrible english   :Wink: 

----------

## irondog

New LiveCD version:

http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-2.0.iso

 *TUX4O wrote:*   

> If it's impossible to setup RAID 0+1 with dmraid, PLEASE tell me how to setup software RAID 0+1 or RAID 1+0 (4 SATA drives!!!)
> 
> 10X in advance  & excuse me for terrible english  

 

That should be possible with dmraid-1.0.0-rc9.

----------

## cagezero

hi.

i am currently installing on a board with two bios raid controllers.

my partitioning is as follows:

```
/dev/mapper/sil_xxx1              /

/dev/mapper/isw_xxx1            /boot   

/dev/mapper/isw_xxx2            /swap

/dev/mapper/isw_xxx3            /xp
```

the 'isw_xxx' array is (hd0) in grub.

my error:

>> determining root device...

>> block device /dev/mapper/sil_xxx1 is not a valid root device..

i continue with the shell command and an ls of /dev/mapper shows all 'isw_xxx' partitions 

but does not show the 'sil_xxx1' partition.  only 'sil_xxx' is listed.

i used these instructions as well as http://gentoo-wiki.com/HOWTO_Install_Gentoo_with_NVRAID_using_dmraid.

i have used dmraid before with no problems but never with two arrays.

i am currently researching the matter further but if anyone has any advice i would be grateful.

----------

## liebremx

First kudos to irondog for the HOWTO   :Mr. Green: 

 Relevant information:

 - Two Maxtor Diamond Max Plus 9 160GB SATA connected to the first two ports of the ICH7R. No other hard drives installed.

 - IDE DVD-ROM (hda)

 - Created two volumes (Volume0 and Volume1) through the ICH7R option ROM, each with half the size of the array and set them for RAID0 and 128KB strip size.

 - Installed Win2k first on Volume1 in the first primary partition (30GB).

 - Installed Gentoo using the latest gen2dmraid-2.0 and used Gentoo 2006.0 stage3 tarball.

 - Used 

```
genkernel --dmraid all
```

 to generate my kernel.

 Now, after successfully installing Win2k and before installing Gentoo I had no idea that ICH7R and SIL 3132 RAID controllers were fakeraid (Having drivers for Win2k didn't ring a bell at all) so I was kind of disapointed before the installation. Anyway, the performance difference is quite noticeable compared to my previous HD configuration, and with a Pentium-D 920 @ 3.72Ghz I'm pretty happy with the performance of the system  :Wink: 

 Here are my two cents

 - You can create the partitions directly from the gen2dmraid CD using fdisk but you will have to restart the installation in order for the changes to take effect.

 - I had to add the dodmraid option to the kernel entry in my grub.conf file in order to have all the devices listed under /dev/mapper. Otherwise the devices wouldn't be listed under /dev/mapper.

```
title Linux

root (hd0,1) # Volume1 is seen as hd0

# Volume11 is Win2k's boot partition

kernel /vmlinuz dodmraid root=/dev/ram0

         real_root=/dev/mapper/isw_ccecagdajc_Volume12  init=/linuxrc 

initrd /initrd
```

Also if you use genkernel don't forget to copy the linuxrc file to /boot.

 - If you want you can install the boot partition way past the BIOS limits using the GRUB native installation http://www.gnu.org/software/grub/manual/grub.html#Installing-GRUB-nativelyprocedure mentioned already in this thread. I had to use this approach because I didn't want to reinstall Win2k again or find out if it was possible to move the Win2k partition.

First I created /boot/grub/grub.conf with the right contents

What I did after booting with a GRUB floppy was

```
grub> root (hd0,1) # Volume1 is seen as hd0

grub> setup (hd0)
```

That was it.

 Cheers

----------

## TheDot

First, THANKS!! to irondog for a great HOWTO!!  :Very Happy: 

However, I'm running into one "slight" problem...

When I get to the part of using and running the dmraidinitrd script, I've had to do some hacking to it just to find out why it's failing...  It turns out that the latest version of BusyBox doesn't have a ready made Configure.h or .configure file.

I manually untarred the source file, and after peeking at the INSTALL file, I found that in order to install BusyBox, you have to run "make menuconfig" much in the same way you do to compile a kernel.  Upon further reading of that same file, you can alternately run "make allyesconfig", resulting in everything being compiled into busybox with all additional options turned on.  However, (taken directly from the INSTALL file: ) "Busybox is optimized for size, but enabling the full set of functionality still results in a fairly large excecutable (more than 1 megabyte when statically linked)."

Now I'm willing to give that a shot and hack that into the script to try it out and get my system up finally (it's been almost 3 days working on {and off} this setup), but maybe someone who's more familiar with busybox can slim it down some...

Everything else has been going pretty smoothly up to that point since I'm following not only this HOWTO, but also the gentoo install instructions.

Any advice and/or critique on this is much appreciated.  :Smile: 

Thanks again!!

Edited to add a much easier fix...

I have found that if you do as above, when device mapper goes to compile, it runs out of space on the temporary device, so what I did instead was changed the URL for busybox to just add on /legacy/ to the end before the last quote.

I also updated the version numbers on dmraid and device-mapper in the script, and all went well as far as the script goes...  :Smile: 

Now to finish up...   :Rolling Eyes: 

Edited to ask for help again...

Alright, after using that script, I moved the initrd to /boot, and even moved the linuxrc to /boot as well just as cautionary measure.  Making sure I had my kernel in there as well, I proceeded to wrap things up, and found that upon reboot, grub DID NOT install even thought it claimed it did - I mean maybe it's my lack of experience with raid and grub, but when something that you're trying to install says "suceeded.", it usually has.  If I reboot after going through the entire install with this howto, I get my normal bios messages, including the raid bios messages, and then nothing.... not even a "Loading Grub stage [N]..." - as if saying grub never installed at all when I saw that it had.

Now I've read somewhere about making the partition types "fd" - fd = Linux raid auto detect - if I'm remembering the information correctly...  Would that have anything to do with installing on onboard hardware(fake) raid?  Or is that only for software raid?  Furthermore, would that have anything to do with my problem?  I've reread the HOWTO a dozen times or more, but don't see anywhere that I went wrong in following it.

Any help is GREATLY appreciated!!  :Smile: 

----------

## TheDot

Hello?  Anyone?

----------

## cagezero

the partition type fd is only for native linux raid.

so thats not your prob.

let me review your post and ill get back to ya!

|----- edit ----|

ok.

i had that same dmraidinitrd prob you did. 

i also eneded up just using stuff from the legacy area.

1) what kind of hd are you using?

2) do you have ->device drivers->block devices->ram disk support->initial ram disk (initrd) 

    compiled into your kernel?

2) could you post your fstab and grub.conf?

----------

## nadir-san

I have a MSI K8NGM2-IL(AMD64 DC) with dual raptors.

Now i didn't really follow the guide, because I dont have a web connection yet or an operating system with a working burner, so I had to use my pendrive and chroot into it mounting devices and proc along the way, so it was as if I had a virtual live cd with dmraid.

Anyway, I got all my raid stuff setup, installed grub like you said etc, nice HOWTO btw, thanks

Before I go any further I should say I didnt have the files 

```

dmraidinitrd-0.93

linuxrc-0.93 

```

Now I know this should mean I cant boot linux, but should I not get a grub screen at least? Cause I dont I have the same problem as TheDot above I think !

Cause I don't get anything, I'm at work now, so I've burnt off the iso, ill give it another shot when I go home.

Thanks. XD

----------

## TheDot

 *cagezero wrote:*   

> the partition type fd is only for native linux raid.
> 
> so thats not your prob.
> 
> let me review your post and ill get back to ya!
> ...

 

Keep in mind, I'm still pretty new to Gentoo, but by far not new to linux (been using it for nearly a decade now), so it's very rare that I ever ask for help unless it's something that's wronged completely off the wall and I have no clue on it, such as above.

Actually, I think I may have a faulty onboard controller... one clue was that it wasn't enabling DMA for the drives, and on the regular IDE controllers DMA was being enabled just fine, and so when I used the onboard raid controller I would have to use the kernel option 'ide=nodma' just to get the dmraid livecd to boot all the way.  Without that, it would hang at the udev part.  I even tried switching cables, which I read somewhere can cause the no DMA, and that didn't help.  I just installed a PCI Silicon Image controller, threw the drives on that, and the dmraid livecd booted just fine without any extra options.  I have even ran 'hdparm /dev/hde [and f]' to check if DMA was enabled and it was, so I think my problem was a faulty onboard controller.  Gonna give this HOWTO another shot with the new controller, and see what happens.  I'll report back when all is said and done.  :Smile:   To answer your questions tho, 1) 2 matched Seagate Barracudas - 60Gig each 2) booted the dmraid livecd, so im sure it already includes those and 3) double-checked the fstab and grub.conf to make sure they were set up right on the old controller and they were - so yeah, overall I think just a faulty controller was to blame...  Here goes nothing!  Wish me luck!  :Smile: 

----------

## TheDot

Ok, I gave it another shot... while the new controller cleared up the problems with DMA, I'm still unable to boot...

Absolutely nothing coming up...  And I used genkernel to do all the kernel compiling with via "genkernel --dmraid all".

Any help would be great!!  :Smile: 

----------

## irondog

 *nadir-san wrote:*   

> ..Cause I dont I have the same problem as TheDot above I think !
> 
> Cause I don't get anything, I'm at work now, so I've burnt off the iso, ill give it another shot when I go home.
> 
> Thanks. XD

 

 *TheDot wrote:*   

> Any help would be great!! 

 

Nadir-san, TheDot: Please note the prerequisites. If you don't have an MBR that's booting the active partition things will fail. As a work-around you can install grub directly into the MBR (which I don't recommend when dualbooting).

```

setup (hd0) instead of setup (hd0,0)

```

 *liebremx wrote:*   

> First kudos to irondog for the HOWTO  
> 
>  - You can create the partitions directly from the gen2dmraid CD using fdisk but you will have to restart the installation in order for the changes to take effect.
> 
> 

  Yes and re-running dmraid ( dmraid -an && dmraid -ay) will suffice. Note that those prerequisites are there to make it work for sure. There are a dozen ways to do it differently, but the scope of the topic is making dualbooting work without headaches and not just a method to install Linux.

----------

## TheDot

Reason for deleting the other posts:

Finally realized the true meaning behind the prerequisites of this HOWTO...

How I discovered this:

1) I partitioned via the gen2dmraid livecd, then rebooted, and installed windoze where I wanted it, installed some drivers for my equipment and a few programs, and adjusted my settings how I wanted.

2) I deleted the array and recreated the array (thinking I was going to have to reinstall windoze because of this and I'd run into the same catch 22...), which gave me none of the errors I was experiencing before when booting with that same CD, which when that DID happen, I was still using the previous array.

3) I then installed Linux how I wanted it, with repartitioning and all through Linux.  I installed grub to both the MBR ("setup (hd0)") and the boot partition ("setup (hd0,0)") so that I had all my grounds covered (this may have been a little much, but I wanted to be sure that at least grub would load), and proceeded with the rest of the installation.

4) I then tested (without reinstalling windoze, mind you), and believe it or not, my installation of windoze where I had installed that stuff and adjusted my settings, booted from the grub menu (which obviously loaded)!!  Needless to say I sat in total disbelief with my jaw dropped...

5) However, when I tried to boot Linux, I got a "Error 15: File not found." meaning somewhere in (mostly likely) my grub.conf file, I screwed up.  What's worse is I didn't write down the cryptic part of the names of the partitions, so I have to start over with the linux installation instead of just manually editing the grub menu at prompt time, because I think that's where I messed up.

Now, I sat back and thought about this, and realized, my installation of windoze stayed there because I made the partitions the same size every time, whether or not I recreated the array or not, and I also did not format that paticular partition with either OS.  I also remembered that windoze doesn't care whether or not the mbr is dos or unix based, as long as it has something to "prime the boot" sort of speak - I had forgotten this because I havent reinstalled on my own system in a VERY long time - we're talking at least 6 months...   :Wink:   BTW, you can use the windoze install CD to recreate the mbr  :Wink: , so installing grub to it doesn't really matter for if you ever decide to get rid of linux ( :Shocked: )  (<-- yes, that's me in shock about the thought of ever getting rid of linux completely out of my life, hehe  :Mr. Green:  )

Later,

TheDot

----------

## blunck2

Hi all,

Like you all, I worked through Gerte's great gen2dmraid bootstrapper and managed to get Gentoo installed on my NVidia RAID.  I'm using RAID1 because I care more about stability than I do about performance.

I was disappointed when I saw that disconnecting a drive while the OS is running resulted in a hung OS.  But, I took the NVidia RAID for what I paid for it (next to nothing cause it's integrated) and decided to try to rebuild the array using a "clean" disk.

I used the "rebuild" function in BIOS, and that appears to only copy the configuration from the good disk to the "clean" disk.  I'm struggling to find out how to actually re-mirror the contents of the good disk to the "clean disk".  I don't have Windows installed, and I don't want to have to install Windows just to do re-mirroring.

I tried booting the gen2dmraid CD and "dd if=/dev/sda of=/dev/sdb", crossing my fingers and hoping for the best.  After about 2 hours (160GB disks) I found out that the partition table existed, but when I rebooted the RAID BIOS reported "error" and wouldn't even allow me to rebuild!

Has anyone successfully re-mirrored the RAID content from a "good" disk to a new "clean" disk?  If so, did you have to use the Windows Nvidia RAID utility?  Or is there another way that I'm missing.

Thanks in advance for replying!!

-Chris

-c

----------

## Phk

Hi there guys!

I've read this thread, and i cant find any info for my problem..

My DMraid segfaults at reboot!

Please check it HERE, and try to help me =)

thanks rightaway!

----------

## dhi

Hi there,

my Problem is getting gentoo to correctly detect my Nvidia Raidset.

What i have done so far:

I read all the Howtos about Installing NVRAID on gentoo etc and this Thread... Some solutions here and there have brought me further but now im at a point i found no solution so far  :Sad: 

The Problem:

I booted with the gentoo 2006.0 Minimal Live CD with the option "dodmraid" all worked fine, i partitoned my disk installed a stage3-environment and get grub to work correctly. I compiled my kernel with "genkernel --dmraid --menuconfig all" (and compiled the sata drivers in it, not as modules) as it is the easiest way for now   :Razz:  after i got this to work i'll optimise my kernel-config...

Ok after the compilation has finished i start up my PC with this Kernel - then it hangs at this point:

```

>> Activating udev

>>Activating Device-Mapper RAID(s)

ERROR: dos: reading /dev/mapper/nvidia_fcjgifec[No such file or directory]

>> Determininng root device ...

!! Block device /dev/mapper/nvidia_fcjgifec4 is not a valid root device...

...

boot() ::

```

ok the /dev/mapper/nvidia_fcjgifec[b]4[/] is the right partition for root but dmraid doesn't seems to find it

When i go into the shell and point to /dev/mapper it shows

```

control

and

nvidia_fcjgifec

```

so that's the weird thing - it seems to detect the whole right raidset but not the partitions on it   :Shocked: 

Hmm ok that's my problem - i hope somebody can help me   :Embarassed: 

thx

Daniel

----------

## Tyler_Durden

 *dhi wrote:*   

> 
> 
> ```
> 
> >> Activating udev
> ...

 

I guess that you are using the portage version or the latest release of dmraid. Please try the test version from here

http://people.redhat.com/~heinzm/sw/dmraid/tst/ Some changes in kernel 2.6.16 were responsible for these problems.

The test version is working flawless here, i hope there will be a new release soon.

----------

## dhi

That did the trick, very big thx   :Very Happy: 

----------

## Enverex

The version in portage doesn't work with the 2.6.16 kernel, but does it work with the 2.6.17 kernel?

----------

## devsk

so, the problem was with kernel and not dmraid package?

----------

