Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] HPT, Promise, Medley, Intel, Nvidia RAID Dualboot
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Sun Nov 28, 2004 1:05 am    Post subject: [HOWTO] HPT, Promise, Medley, Intel, Nvidia RAID Dualboot Reply with quote

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 :) )

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 ;) ) 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.
Code:
modprobe sata_sil
#OR
modprobe sata_promise
#OR
modprobe sata_nv

[step 3]Run dmraid and watch the results
Code:
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)
Code:
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
Code:
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
Code:
emerge --sync
emerge grub -pv
emerge grub


[step 7] Installing and building a kernel (sata users: dont' forget to compile-in the sata modules)
Code:
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/
Code:
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/
Code:
# 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
Code:
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)

Code:
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:
Code:
emerge device-mapper -pv
emerge device-mapper


Don't use a device tarball! Your dmraid created devices will disappear and bootup will fail!
Code:
#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.
_________________
Alle dingen moeten onzin zijn.


Last edited by irondog on Thu Dec 16, 2004 4:22 pm; edited 7 times in total
Back to top
View user's profile Send private message
Polo78
n00b
n00b


Joined: 24 Nov 2004
Posts: 16

PostPosted: Sun Nov 28, 2004 11:14 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Sun Nov 28, 2004 7:20 pm    Post subject: Reply with quote

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?
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Sun Nov 28, 2004 10:05 pm    Post subject: Reply with quote

Will LVM2 work over dmraid?

How about a bootstrapped pure nptl system?

I want my computer to spit fire from the exhaust fans :twisted:
Back to top
View user's profile Send private message
Polo78
n00b
n00b


Joined: 24 Nov 2004
Posts: 16

PostPosted: Mon Nov 29, 2004 11:01 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Mon Nov 29, 2004 3:34 pm    Post subject: Reply with quote

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 :twisted:
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.
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
Polo78
n00b
n00b


Joined: 24 Nov 2004
Posts: 16

PostPosted: Tue Nov 30, 2004 10:33 am    Post subject: Reply with quote

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... :D

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.
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Wed Dec 01, 2004 2:38 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
rainyrhythm
n00b
n00b


Joined: 08 Nov 2004
Posts: 12

PostPosted: Fri Dec 03, 2004 3:39 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Sat Dec 04, 2004 8:31 pm    Post subject: Reply with quote

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:
Code:
#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.
i'm using my motherboard's pdc raid0.

Are you sure your disks (underlying to the RAID) are detected? I never tested gen2dmraid on Promise ide, but it should work.
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
pnp
n00b
n00b


Joined: 09 Nov 2004
Posts: 7
Location: Portugal

PostPosted: Sun Dec 05, 2004 5:28 am    Post subject: Reply with quote

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

Code:
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
Code:
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
Code:
/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?
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Sun Dec 05, 2004 2:52 pm    Post subject: Reply with quote

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
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.

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?
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Sun Dec 05, 2004 4:53 pm    Post subject: Reply with quote

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.
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Mon Dec 06, 2004 11:59 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
flipy
Apprentice
Apprentice


Joined: 15 Jul 2004
Posts: 232

PostPosted: Tue Dec 07, 2004 3:55 am    Post subject: Reply with quote

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
Code:
error: the selected cylinder exceeds bios maximum
(or something like that :P)
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!
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Tue Dec 07, 2004 4:35 am    Post subject: Reply with quote

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 --
Back to top
View user's profile Send private message
flipy
Apprentice
Apprentice


Joined: 15 Jul 2004
Posts: 232

PostPosted: Tue Dec 07, 2004 10:06 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Tue Dec 07, 2004 2:57 pm    Post subject: Reply with quote

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
Code:
error: the selected cylinder exceeds bios maximum
(or something like that :P)
i've 2 sata drives into a raid-0, with the following partitions (all logicals)

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:
Code:

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:
Code:

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
part4 - reiser4

grub --device-map=/dev/null #never forget this!!!
device (hd0,2) /dev/mapper/blablabla3 #note the partition numbering of grub is `linux -1`
#device (hd0,1) /dev/mapper/blablabla2 #you won't need this line
#device (hd0,0) /dev/mapper/blablabla1 #you won't need this line
device (hd0) /dev/mapper/blablabla
root (hd0,2)
setup (hd0,2)

Now make partition 3 (ext2) active and grub will appear.



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.
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
flipy
Apprentice
Apprentice


Joined: 15 Jul 2004
Posts: 232

PostPosted: Tue Dec 07, 2004 4:34 pm    Post subject: Reply with quote

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
Code:

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?
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Tue Dec 07, 2004 5:35 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Tue Dec 07, 2004 8:06 pm    Post subject: Reply with quote

flipy wrote:

Code:

making /dev/mapper/control with char major 63 minor 10
preparing enviroment for dmraid
calling dmraid
no block devices found

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:
Code:
/dev/scsi/host0/bus0/target0/lun0/disc

something like this for ide:
Code:
/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. :(
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....
Code:
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.
_________________
Alle dingen moeten onzin zijn.
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Tue Dec 07, 2004 8:57 pm    Post subject: Reply with quote

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....
Code:
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.


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

What about (dmsetup) and (libdevmapper)
Back to top
View user's profile Send private message
flipy
Apprentice
Apprentice


Joined: 15 Jul 2004
Posts: 232

PostPosted: Tue Dec 07, 2004 10:38 pm    Post subject: Reply with quote

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
Code:
dmsetup mknodes
and then exit, the system boots ok and everything it's fine.
so, why does not do that at boot up?
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Wed Dec 08, 2004 5:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
flipy
Apprentice
Apprentice


Joined: 15 Jul 2004
Posts: 232

PostPosted: Wed Dec 08, 2004 9:47 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 1 of 9

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum