Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
My Way: Partionierung bei Installieren von Gentoo
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation
View previous topic :: View next topic  

War das nützlich?
Jupp, das hat mein Leben verändert!
44%
 44%  [ 4 ]
Nein, du bist verückt!
55%
 55%  [ 5 ]
Total Votes : 9

Author Message
nic0000
l33t
l33t


Joined: 25 Sep 2005
Posts: 658

PostPosted: Thu Jul 06, 2006 12:24 pm    Post subject: My Way: Partionierung bei Installieren von Gentoo Reply with quote

WARNUNG! Das ist nichts für Anfänger. Es wird keine Anpassung an spezielle Anforderungen vorgenommen, das solltest du selbst können.
Hallo ihr lieben, hier eine copy&paste Anleitung um sein System auf einem RAID1 mit LVM2 und FS Lables auf nur einer Festplatte aufzusetzen.
Häää?
Werden jetzt bestimmt einige von euch laut aufstoßen, wo ist da der Sinn drinn?

Wir legen aber schon mal los:
Was brauchen wir?
Die Platte: ist leer und da ist nichts drauf.
Ein System wo Gentoo drauf soll.
Ein Live System mit eingebauter RAID + LVM Unterstützung. Ich empfehle Kanotix => http://www.kanotix.org/

1)
Kanotix am besten in die Konsole booten.

2)
Partitionieren die Festplatte:
meine Vorgaben sehen so aus:
#=========== Partitionierung der Festplatte:
# Es sollen nach Möglichkeit eine Partition für Backup/Crypt-Admin/Crypt-Home/Windows reservert werden.

# ACHTUNG!! Aus Rücksicht auf Windows sollte es die erste primäre Partition sein.

# Reihenfolge ist bei Linux egal, es gibt aber ein paar Performance Überlegungen:
# Swap = soll möglichst vorne sein, da aber swap nicht eigesetzt werden sollte, kann dies auch vernachlessigt werden.

# ACHTUNG!! hoppix.org setzt LVM2 auf Soft-RAID1 ein.
# Vorteil von RAID1 ist die Einfache sicherung auch auf andere Medien (USB,NFS)

# Vorteile von LVM2 sind die möglichkeit die Partitionierung auch nachträglich zu ändern ohne komplizierten Eingriffen in den MBR der Festplatte sowie die Möglichkeit zu verschlüsseln, einfach zu sichern oder schnappschüsse der Datenträger anzufertigen.

4 Primäre Partitionen
Quote:
1=eine Partition für Backup/Crypt-Admin/Crypt-Home/Windows reservert ~ 5-10 GB
2=/boot + rettungsystem ~ 512mb
3=/(rootdir) ~ 1024mb
4=der ganze Rest
# Vorteile von 4 Primäre Partitionen ist die schnelle möglichkeit den MBR zu Backupen bzw. im Falle eines echten RAID Aufbaues zu kopieren (Ist kein Königsweg, ich weiß ;-))
Code:
dd if=/dev/$DRIVE of=$HOSTNAME.mbr count=1 bs=512


#=========== Einrichten RAID
#nicht immer benötigt
Code:
modprobe raid1
cat /proc/mdstat
ls -la /dev/md*

mknod /dev/md2 b 9 2
mknod /dev/md3 b 9 3
mknod /dev/md4 b 9 4


# Das eigentliche anlegen
Code:
mdadm --create --force /dev/md2 --level=1 --raid-devices=2 /dev/hda2 missing
mdadm --create --force /dev/md3 --level=1 --raid-devices=2 /dev/hda3 missing
mdadm --create --force /dev/md4 --level=1 --raid-devices=2 /dev/hda4 missing
Das "missing" sorgt dafür das keine Datenträger vermisst werden.

# Überprüfen schnell
Code:
cat /proc/mdstat


#=========== Einrichten LVM2
Wir sind Faul und definieren uns hier eine Variable mit unserem VG Namen. Da der Name später unter /dev als Ordner auftaucht, sollte nicht genommen werden was dort schon existiert bzw. in der Zukunft existieren könnte.
VG="vgmaster"

Code:
vgscan
# it doesn't find anything...thats ok
pvcreate /dev/md4
pvdisplay
vgcreate $VG /dev/md4
vgdisplay $VG



# Wir fangen mit angemessenen Minimalwerten an, später kann unproblematisch (Je nach eingesetzten FS) vergrössert werden. In meinen Fall geht es so los:
Code:
lvcreate -L5G    -nusr            $VG
lvcreate -L5G    -nhome           $VG
lvcreate -L1,5G  -nopt            $VG
lvcreate -L3G    -nvar            $VG
lvcreate -L1G    -ntmp            $VG
lvcreate -L1G    -nroot           $VG
lvcreate -L1G    -nswap             $VG

lvscan


#=========== Filesysteme HDD

# ext2 für /boot
# ext3 universal

Code:
mke2fs -L BOOT /dev/md2
mke2fs -j -L ROOTDIR /dev/md3

mke2fs -j -L USR /dev/mapper/$VG-usr
mke2fs -j -L VAR /dev/mapper/$VG-var
mke2fs -j -L TMP /dev/mapper/$VG-tmp
mke2fs -j -L OPT /dev/mapper/$VG-opt
mke2fs -j -L HOME /dev/mapper/$VG-home
mke2fs -j -L ROOT /dev/mapper/$VG-root

mkswap -L SWAP /dev/mapper/$VG-swap


#=========== Das System zusammenfügen
Code:
mkdir -p /mnt/gentoo/
mount -L ROOTDIR /mnt/gentoo/
mkdir -p /mnt/gentoo/{boot,usr,var,home,tmp,opt}
mount -L BOOT /mnt/gentoo/boot/

mount -L USR /mnt/gentoo/usr
mount -L VAR /mnt/gentoo/var
mount -L TMP /mnt/gentoo/tmp
mount -L OPT /mnt/gentoo/opt
mount -L HOME /mnt/gentoo/home
mount -L ROOT /mnt/gentoo/root


Hiernach geht es wie im Handbuch beschrieben => http://www.gentoo.org/doc/de/handbook/handbook-x86.xml?part=1&chap=5 (Danke Rene-dev)

#=========== GRUB
Bei Grub Installation sollte darauf geachtet werden in der /boot/grub/grub.conf anstatt:
Quote:
kernel /vmlinuz root=/dev/hda3 panic=10

lieber via RAID daruf zugreifen
Quote:
kernel /vmlinuz root=/dev/md2 panic=10

#=========== Kernel
Der Kernel braucht eingebaute RAID1 Unterstützung sowie eingebaut oder Modulare LVM Unterstützung:
Quote:

[*] Multiple devices driver support (RAID and LVM)
[*] RAID support
[*] RAID-1 (mirroring) mode
[M] Device mapper support
[M] Crypt target support ]

#=========== Benötigte Software
Es wird noch mdadm und lvm2 benötigt:
Da wir keine LVM1 haben teilen wir das unserem System einfach charmant mit:
Code:
echo "sys-fs/lvm2 nolvm1" >> /etc/portage/package.use
emerge lvm2 mdadm -av

#=========== /etc/mdadm.conf
Dieser Vorgang ist nur nötig wenn wirklich mehrere Festplatten dauerhaft eingesetzt werden.
Hiermit wird auf /dev/hd* gesucht:
Code:
echo 'DEVICE /dev/hd*' >> /etc/mdadm.conf

Da kommt das rein was mdadm gefunden hat ;-)
Code:
mdadm --detail --scan >> /etc/mdadm.conf

Zum schluß noch die Email welche mdadm seine Berichte schicken soll (Mailsystem sollte konfiguriert sein)
Code:
echo 'MAILADDR        root@localhost' >> /etc/mdadm.conf

mdadm beim booten starten und dann überwacht es das Array
Code:
rc-update -a mdadm default

#=========== /etc/fstab
Code:
cat >> /etc/fstab <EOF
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>          <mountpoint>    <type>          <opts>                                        <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
LABEL=BOOT          /boot        ext2    noauto,noatime                                        1 2
LABEL=ROOTDIR       /            ext3    noatime,usrquota,grpquota                             0 1
LABEL=USR           /usr         ext3    noatime,usrquota,grpquota                             0 0
LABEL=VAR           /var         ext3    suid,dev,noatime,exec,usrquota,grpquota               0 0
LABEL=HOME          /home        ext3    suid,dev,noatime,exec,usrquota,grpquota               0 0
LABEL=OPT           /opt         ext3    noatime,grpquota,grpid,nosuid,usrquota,exec,nodev     0 0
LABEL=TMP           /tmp         ext3    suid,dev,notail,noatime,exec,usrquota,grpquota        0 0
LABEL=ROOT     /root        ext3    noatime                                               0 0
LABEL=SWAP           swap        swap    sw                                                    0 0

#/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,ro       0 0
#/dev/fd0               /mnt/floppy     auto            noauto          0 0

# NOTE: The next line is critical for boot!
proc                    /proc           proc            defaults        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

EOF


So das sollte alles sein, ich hoffe ich habe nichts vergessen ;-)

EDIT:
Link angefügt
EDIT2:
Reihenfolge logischer geändert
EDIT3: 10.07.2006
Bisschen erweitert /etc/mdadm.conf
_________________
grüße
nico


Last edited by nic0000 on Mon Jul 10, 2006 5:21 am; edited 3 times in total
Back to top
View user's profile Send private message
Rene-dev
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 163
Location: Münster, Germany

PostPosted: Thu Jul 06, 2006 5:09 pm    Post subject: Reply with quote

Quote:
Hiernach geht es wie im Handbuch beschrieben => (finde ich gerade nicht)

http://www.gentoo.org/doc/de/handbook/handbook-x86.xml?part=1&chap=5

Ich installierte gerade als ich den post las... :D

rene
Back to top
View user's profile Send private message
nic0000
l33t
l33t


Joined: 25 Sep 2005
Posts: 658

PostPosted: Thu Jul 06, 2006 6:40 pm    Post subject: Reply with quote

Rene-dev wrote:
Ich installierte gerade als ich den post las... :D
Danke, ich korrigiere es gleich :D
_________________
grüße
nico
Back to top
View user's profile Send private message
Rene-dev
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 163
Location: Münster, Germany

PostPosted: Fri Jul 07, 2006 11:45 am    Post subject: Reply with quote

Quote:
kernel /vmlinuz root=/dev/md2 panic=10


muss dass nicht
Code:
kernel (hd0,0)/vmlinuz root=/dev/md2 panic=10

hei[s,ss,ß]en?
und was bringt das panic=10?

rene
Back to top
View user's profile Send private message
nic0000
l33t
l33t


Joined: 25 Sep 2005
Posts: 658

PostPosted: Fri Jul 07, 2006 2:05 pm    Post subject: Reply with quote

Rene-dev wrote:
muss dass nicht
Code:
kernel (hd0,0)/vmlinuz root=/dev/md2 panic=10

hei[s,ss,ß]en?

Nein, denn dass wird eh schon mit der
Quote:
root (hd0,0)
Anweisung erledigt. Danach beziehen sich absolute Pfadangaben auf den "root". Ich habe auch dieses lange nicht gewusst und öfters deshalb Fehler provoziert.

Rene-dev wrote:
und was bringt das panic=10?
Einen Reboot nach 10 Sekunden wenn der Kernel "panic" bekommt.

Die Gesamte Anweisung:
Quote:
# For booting GNU/Linux
title Gentoo GNU/Linux hdc
root (hd0,0)
kernel /vmlinuz root=/dev/md2 panic=10
#initrd /initrd.img

_________________
grüße
nico
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation All times are GMT
Page 1 of 1

 
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