meine Platten habe ich gestern eingebaut und ins Sytem integriert, die Aktion war halb so wild und hatte es mir komplizierter vorgestellt. Ich habe mich an folgenden Threat gehalten:
http://www.linux-club.de/viewtopic.php?f=4&t=89636
Mein System bestand aus 2 IDE Platten (hdb/hdc) beide 120 GB, Raid 1, reiser_fs, nachher sollten 2x500 gb IDE Platten laufen.
mdadm mit den beiden alten Platten:
Code:
snoopy:~ # mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 116334592 (110.95 GiB 119.13 GB)
Device Size : 116334592 (110.95 GiB 119.13 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 16:08:14 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14317178
Number Major Minor RaidDevice State
0 3 66 0 active sync /dev/hdb2
1 22 2 1 active sync /dev/hdc2
fdisk -l (ebenfalls mit den beiden 120 gb Platten):
Code:
snoopy:/boot/grub # fdisk -l
Platte /dev/hdb: 120.0 GByte, 120060444672 Byte
255 Köpfe, 63 Sektoren/Spuren, 14596 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdb1 1 113 907641 82 Linux Swap / Solaris
/dev/hdb2 * 114 14596 116334697+ fd Linux raid autodetect
Platte /dev/hdc: 120.0 GByte, 120060444672 Byte
255 Köpfe, 63 Sektoren/Spuren, 14596 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdc1 1 113 907641 82 Linux Swap / Solaris
/dev/hdc2 * 114 14596 116334697+ fd Linux raid autodetect
Platte /dev/md0: 119.1 GByte, 119126622208 Byte
2 Köpfe, 4 Sektoren/Spuren, 29083648 Zylinder
Einheiten = Zylinder von 8 × 512 = 4096 Bytes
Gerät boot. Anfang Ende Blöcke Id System
1. Im Raid 1 die Platte hdc2 auf failed gesetzt, dazu
Code:
mdadm /dev/md0 -f /dev/hdc2
2. anschließend die Platte hdc2 aus dem Raid entfernt
Code:
mdadm /dev/md0 -r /dev/hdc2
3. den Rechner heruntergefahren und die Platte 2 (hdc) gegen die neue 500 gb getauscht, anschließend neu gestartet und von Platte hdb gestartet (da mein grub-Startbildschirm auf (hd1,1) liegt [gfxmenu (hd1,1)/boot/message] bekomme ich einen Fehler beim grub, den man aber Überspringen kann (grub Textmodus)]
4. die neue 500 gb Platte hdc mit
Code:
fdisk /dev/hdc
Optionen: n,t,a,w
neu partitioniert und dabei den Swap Bereich den "alten" Platten angepasst.
zeigt mir dann
Code:
Platte /dev/hdb: 120.0 GByte, 120060444672 Byte
255 Köpfe, 63 Sektoren/Spuren, 14596 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdb1 1 113 907641 82 Linux Swap / Solaris
/dev/hdb2 * 114 14596 116334697+ fd Linux raid autodetect
Platte /dev/hdc: 500.1 GByte, 500107862016 Byte
255 Köpfe, 63 Sektoren/Spuren, 60801 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdc1 1 113 907641 82 Linux Swap / Solaris
/dev/hdc2 * 114 60801 487476360 fd Linux raid autodetect
Platte /dev/md0: 119.1 GByte, 119126622208 Byte
2 Köpfe, 4 Sektoren/Spuren, 29083648 Zylinder
Einheiten = Zylinder von 8 × 512 = 4096 Bytes
Gerät boot. Anfang Ende Blöcke Id System
5. die neue 500 GB hdc2 ins Raid 1 einfügen
Code:
mdadm /dev/md0 -a /dev/hdc2
mdadm zeigt nun das die hdc2 wieder vorhanden ist:
Code:
mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 116334592 (110.95 GiB 119.13 GB)
Device Size : 116334592 (110.95 GiB 119.13 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 16:08:14 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14317178
Number Major Minor RaidDevice State
0 3 66 0 active sync /dev/hdb2
1 22 2 1 active sync /dev/hdc2
6. um jetzt die Platte hdb zu ersetzen, müssen wir nach einem Neustart von der neu eingebauten Platte hdc booten, die aber bislang noch keinen Bootloader hat > Bootloader in hdc neu schreiben, dazu
Code:
cd boot/grub
>grub
grub> root (hd1,1)
Filesystem type is reiserfs, partition type 0xfd
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd1)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+18 p (hd1,1)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
7. Rechner herunterfahren, Platte hdb tauschen, Rechner neu starten und von Platte hdc booten (alternativ kann man sicher auch zuerst die hdb2 aus dem Raid rausnehmen > failed setzen, entfernen [siehe Punkte 1&2])
Interessanterweise meckert grub wieder über den fehlenden grub-Startbildschirm (hdc wird wohl in diesem Fall zu hd(0,1), denn das Startbild liegt immer noch auf hd(1,1). Der Rechner läßt sich wieder über den grub Textmodus booten.
8. mdadm meldet nun die fehlende hdb2, die wurde ja eben durch die neue 500 gb Platte ersetzt:
Code:
mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 116334592 (110.95 GiB 119.13 GB)
Device Size : 116334592 (110.95 GiB 119.13 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 16:28:00 2008
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14317970
Number Major Minor RaidDevice State
0 0 0 - removed
1 22 2 1 active sync /dev/hdc2
jetzt wird hdb wie unter Punkt 4 neu partitioniert:
zeigt uns nun unser beiden identischen Platten
Code:
Platte /dev/hdb: 500.1 GByte, 500107862016 Byte
255 Köpfe, 63 Sektoren/Spuren, 60801 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdb1 1 113 907641 82 Linux Swap / Solaris
/dev/hdb2 * 114 60801 487476360 fd Linux raid autodetect
Platte /dev/hdc: 500.1 GByte, 500107862016 Byte
255 Köpfe, 63 Sektoren/Spuren, 60801 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Gerät boot. Anfang Ende Blöcke Id System
/dev/hdc1 1 113 907641 82 Linux Swap / Solaris
/dev/hdc2 * 114 60801 487476360 fd Linux raid autodetect
Platte /dev/md0: 119.1 GByte, 119126622208 Byte
2 Köpfe, 4 Sektoren/Spuren, 29083648 Zylinder
Einheiten = Zylinder von 8 × 512 = 4096 Bytes
Gerät boot. Anfang Ende Blöcke Id System
und ins Raid 1 neu dazugefügt:
Code:
mdadm /dev/md0 -a /dev/hdb2
mdadm zeigt nun das die hdb2 wieder vorhanden ist:
Code:
mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 116334592 (110.95 GiB 119.13 GB)
Device Size : 116334592 (110.95 GiB 119.13 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 16:08:14 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14317178
Number Major Minor RaidDevice State
0 3 66 0 active sync /dev/hdb2
1 22 2 1 active sync /dev/hdc2
9. auch die hdb braucht ein Bootloaderupdate (zur Sicherheit nochmal den Bootloader in beide Platten geschrieben), vorgehendsweise wie unter Punkt 6:
Code:
cd boot/grub
>grub
grub> root (hd0,1)
Filesystem type is reiserfs, partition type 0xfd
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub> root (hd1,1)
Filesystem type is reiserfs, partition type 0xfd
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd1)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+18 p (hd1,1)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
10. nachdem nun beide Platten getauscht wurden, kann das Raid vergrößert werden:
Code:
mdadm -G /dev/md0 -z max
# mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 487476288 (464.89 GiB 499.18 GB)
Device Size : 487476288 (464.89 GiB 499.18 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 18:25:22 2008
State : active, resyncing
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Rebuild Status : 23% complete
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14321422
Number Major Minor RaidDevice State
0 3 66 0 active sync /dev/hdb2
1 22 2 1 active sync /dev/hdc2
das Raid wird nun automatisch vergrößert, was in meinem Fall ca 3 h gedauert hat.
am Ende schauts dann folgendermaßen aus:
Code:
mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.02
Creation Time : Sun Oct 23 19:25:36 2005
Raid Level : raid1
Array Size : 487476288 (464.89 GiB 499.18 GB)
Device Size : 487476288 (464.89 GiB 499.18 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Dec 15 23:17:18 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 2ef91f93:774e7737:150f657e:7469ca8b
Events : 0.14321440
Number Major Minor RaidDevice State
0 3 66 0 active sync /dev/hdb2
1 22 2 1 active sync /dev/hdc2
11. jetzt kann das Filesystem angepaßt werden:
Code:
resize_reiserfs /dev/md0
resize_reiserfs 3.6.18 (2003 www.namesys.com)
resize_reiserfs: On-line resizing finished successfully.
12. das Raid ist nun vergrößert und der Bootloader liegt auf beiden Platten, fehlt nur noch uner swap, was zwar partitioniert wurde, aber noch nicht formatiert ist.
Code:
# mkswap /dev/hdb1
Swapbereich Version 1 wird angelegt, Größe 929419 KBytes
# mkswap /dev/hdb1
Swapbereich Version 1 wird angelegt, Größe 929419 KBytes
13. Swap muß nun noch aktiviert werden:
ob das swap funzt läßt sich wiefolgt überprüfen:
Code:
# swapon -s
Filename Type Size Used Priority
/dev/hdc1 partition 907632 0 -1
/dev/hdb1 partition 907632 0 -2
geschafft, das System läuft nun mit 2x 500 gb Platten
