Also, das Problem ist gelöst und ich schreibe jetzt mal wie ich das gemacht habe, vielleicht kanns ja jemand mal brauchen!
Problem: Gentoo (oder auch ein anderes Linux) auf einem Rechner mit einer Raid/SCSI karte für welche man den treiber selbst Kompillieren muss.
Lösung :
anmerkung : Ich habe das Gentoo zuerst auf eine IDE platte gemacht, da ich recht lange gebraucht habe bis es gelaufen ist und das währe von der LiveCD aus sehr unangenehm geworden, jedoch glaube ich das es mit dieser anleitung durchaus möglich sein sollte dies von liveCD aus zu schaffen!
Als erste muss man die LiveCD Booten und den treiber für die Raidkarte kompillieren und per modprobe / insmod laden.
Code:
insmod /root/hpt374/hpt374.ko
Meine Raid arrey ist nun unter /dev/sda zu erreichen.
Nun habe ich wie in der anleitung beschrieben diese partitionen nach /mnt/gentoo /mnt/gentoo/boot usw. gemountet, darauf Gentoo installiert und per
Code:
chroot /mnt/gentoo /bin/bash
auf diese gewechselt und Gentoo fertig installiert.
Nun muss man den treiber erneut für diesen kern kompillieren.
Als nächstes muss die initramfs erstellt werden (early-userspace)
Code:
dd if=/dev/zero of=/boot/initramfs.img count=5120 bs=1024
Die Ramdisk wird nun 5 Mb groß, das müsste reichen.
Diese muss jetzt noch formatiert werden
Code:
mke2fs -i 1024 -b 1024 -m 5 -F -v /boot/initramfs.img
Dieses Image lässt sich jetzt als loop device mounten und beschreiben
Code:
mkdir /initramfs.d
mount /boot/initramfs.img /initramfs.d -t ext2 -o loop
cd /initramfs.d
nun müssen noch diese Dateien und Verzeichnisse in die RamDisk
total 23
drwxr-xr-x 2 root root 1024 Aug 6 03:42 bin
drwxr-xr-x 2 root root 1024 Jul 28 16:09 dev
drwxr-xr-x 2 root root 1024 Aug 6 02:58 etc
drwxr-xr-x 2 root root 1024 Aug 6 16:04 lib
-rwxrwxrwx 1 root root 947 Aug 6 16:03 linuxrc
drwxr-xr-x 2 root root 1024 Aug 6 14:31 mnt
drwxr-xr-x 2 root root 1024 Jul 29 16:39 old-root
drwxr-xr-x 2 root root 1024 Jul 27 16:46 proc
./bin:
total 678
-rwxr-xr-x 1 root root 539332 Jul 27 16:46 bash
-rwxr-xr-x 1 root root 15152 Aug 6 03:42 cat
-rwxr-xr-x 1 root root 12364 Jul 28 17:21 chroot
-rwxr-xr-x 1 root root 6776 Jul 28 15:14 insmod
-rwxr-xr-x 1 root root 9624 Jul 27 16:46 losetup
-rwx--x--x 1 root root 53700 Jul 27 16:46 mount
-rwxr-xr-x 1 root root 3460 Jul 29 16:03 pivot_root
lrwxrwxrwx 1 root root 6 Jul 27 16:46 sh -> ./bash
-rwxr-xr-x 1 root root 13692 Aug 6 03:27 sleep
-rwx--x--x 1 root root 26316 Jul 28 16:43 umount
./dev:
total 0
crw-r--r-- 1 root root 5, 1 Jul 28 16:09 console
brw-rw-rw- 1 root root 3, 0 Jul 28 15:38 hda
brw-rw-rw- 1 root root 3, 1 Jul 28 15:38 hda1
brw-rw-rw- 1 root root 3, 2 Jul 28 15:39 hda2
brw-rw-rw- 1 root root 3, 3 Jul 28 15:39 hda3
brw-rw-rw- 1 root root 3, 4 Jul 28 15:39 hda4
brw-rw-rw- 1 root root 3, 5 Jul 28 15:39 hda5
brw-rw-rw- 1 root root 3, 6 Jul 28 15:39 hda6
brw-rw-rw- 1 root root 3, 7 Jul 28 15:39 hda7
brw-rw-rw- 1 root root 3, 8 Jul 28 15:39 hda8
brw-r----- 1 root root 7, 0 Jul 28 15:45 loop0
brw-r----- 1 root root 7, 1 Jul 28 15:45 loop1
crw-rw-rw- 1 root root 1, 3 Jul 28 15:36 null
brw-rw-rw- 1 root root 8, 0 Jul 28 15:39 sda
brw-rw-rw- 1 root root 8, 1 Jul 28 15:39 sda1
brw-rw-rw- 1 root root 8, 2 Jul 28 15:39 sda2
brw-rw-rw- 1 root root 8, 3 Jul 28 15:39 sda3
brw-rw-rw- 1 root root 8, 4 Jul 28 15:39 sda4
brw-rw-rw- 1 root root 8, 5 Jul 28 15:40 sda5
brw-rw-rw- 1 root root 8, 6 Jul 28 15:40 sda6
brw-rw-rw- 1 root root 8, 7 Jul 28 15:40 sda7
brw-rw-rw- 1 root root 8, 8 Jul 28 15:40 sda8
crw-rw---- 1 root root 5, 0 Jul 28 15:35 tty
crw------- 1 root root 4, 1 Jul 28 15:42 tty1
crw-r--r-- 1 root root 1, 5 Jul 28 15:36 zero
./etc:
total 12
-rw-r--r-- 1 root root 1245 Aug 6 02:58 fstab
-rw-r--r-- 1 root root 8436 Jul 27 16:46 ld.so.cache
-rw-r--r-- 1 root root 115 Jul 28 17:50 mtab
./lib:
total 1836
-rw-r--r-- 1 root root 117411 Jul 28 15:09 hpt374.ko
-rwxr-xr-x 1 root root 99488 Jul 27 16:46 ld-2.3.4.so
lrwxrwxrwx 1 root root 11 Jul 27 16:46 ld-linux.so.2 -> ld-2.3.4.so
lrwxrwxrwx 1 root root 15 Jul 28 16:36 libblkid.so.1 -> libblkid.so.1.0
-rwxr-xr-x 1 root root 21340 Jul 28 16:36 libblkid.so.1.0
-rwxr-xr-x 1 root root 1204672 Jul 27 16:48 libc-2.3.4.so
lrwxrwxrwx 1 root root 13 Jul 27 16:49 libc.so.6 -> libc-2.3.4.so
-rwxr-xr-x 1 root root 10624 Jul 28 16:17 libdl-2.3.4.so
lrwxrwxrwx 1 root root 14 Jul 28 16:25 libdl.so.2 -> libdl-2.3.4.so
-rwxr-xr-x 1 root root 155992 Aug 6 03:34 libm-2.3.4.so
lrwxrwxrwx 1 root root 13 Aug 6 03:35 libm.so.6 -> libm-2.3.4.so
-rwxr-xr-x 1 root root 147960 Aug 6 15:11 libpthread-0.10.so
lrwxrwxrwx 1 root root 18 Aug 6 15:12 libpthread.so.0 -> libpthread-0.10.so
-rwxr-xr-x 1 root root 37636 Aug 6 14:38 librt-2.3.4.so
lrwxrwxrwx 1 root root 14 Aug 6 14:39 librt.so.1 -> librt-2.3.4.so
lrwxrwxrwx 1 root root 14 Jul 28 16:50 libuuid.so.1 -> libuuid.so.1.2
-rwxr-xr-x 1 root root 8852 Jul 28 16:50 libuuid.so.1.2
lrwxrwxrwx 1 root root 13 Jul 28 16:35 libz.so.1 -> libz.so.1.2.2
-rwxr-xr-x 1 root root 58204 Jul 28 16:34 libz.so.1.2.2
./mnt:
total 0
./old-root:
total 0
./proc:
total 0
Die Beötigten Programme und libs findet man in der auf der Festplatte unter /bin /sbin und /lib (nicht vergessen die liebs zu verlinken!). Die Datei hpt374.ko muss durch euren treiber ersetzt werden und das verzeichniss old-root muss auch auf der Festplatte vorhanden sein.
Auch die 3 dateien aus /etc werden aus dem gleichnamigen verzeichniss auf der Festplatte kopiert.
Ledeglich die devices in /dev sind etwas schwieriger, diese müssen mit mknod erstellt werden
Code:
cd /initramfs.d/dev
mknod console c 5 1
mknod hda b 3 0
mknod hda1 b 3 1
mknod hda2 b 3 2
mknod hda3 b 3 3
... usw.
mknod loop0 b 7 0
mknod loop1 b 7 1
mknod null c 1 3
mknod sda b 8 0
mknod sda1 b 8 1
mknod sda2 b 8 2
... usw.
mknod tty c 4 0
mknod tty1 c 4 1
mknod zero c 1 5
Wenn das geschafft ist, wird noch die datei /initramfs.d/linuxrc angelegt. Dies muss auch dem Bootloader mitgeteilt werden, aber dazu später.
Der inhalt der linuxrc sieht bei mir so aus
Code:
#!/bin/bash
insmod /lib/hpt374.ko
mount -t reiserfs /dev/sda3 /mnt
pivot_root /mnt /mnt/old-root
mount -n -t proc proc /proc
echo "0x0100" > /proc/sys/kernel/real-root-dev
umount /proc
Soweit so gut, die RamDisk ist fertig! jetzt muss man sie noch umounten
Code:
umount /initramfs.d
Jetzt muss nurnoch der bootloader configuriert werden, in meinem fall ist das grub, die menu.lst müsste dann in etwa so aussehen
Code:
default 0
timeout 5
title=Gentoo Linux on Raid
root (hd0,0)
kernel (hd0,0)/kernel-2.6.9 root=/dev/sda3 init=linuxrc usw.
initrd (hd0,0)/initramfs.img
Ich hoffe das diese anleitung andere davor bewahrt sich 2 wochenlang mit diesem Thema rumzuschlagen !
MfG Mazze
Lesezeichen