255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00033bcd
Device Boot Start End Blocks Id System
/dev/sda1 1 144 1156648+ 82 Linux swap / Solaris
/dev/sda2 * 145 797 5245222+ 83 Linux
/dev/sda3 798 1044 1984027+ 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
/dev/sda2 5.0G 1.1G 3.7G 23% /
udev 377M 168K 377M 1% /dev
/dev/sda3 1.9G 35M 1.8G 2% /home
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00033bcd
Device Boot Start End Blocks Id System
/dev/sda1 1 144 1156648+ 82 Linux swap / Solaris
/dev/sda2 * 145 797 5245222+ 83 Linux
/dev/sda3 798 1044 1984027+ 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 144 1156648+ 82 Linux swap / Solaris
/dev/sdb2 * 145 797 5245222+ 83 Linux
/dev/sdb3 798 1044 1984027+ 83 Linux.
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00033bcd
Device Boot Start End Blocks Id System
/dev/sda1 1 144 1156648+ 82 Linux swap / Solaris
/dev/sda2 * 145 797 5245222+ 83 Linux
/dev/sda3 798 1044 1984027+ 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 144 1156648+ fd Linux raid autodetect
/dev/sdb2 * 145 797 5245222+ fd Linux raid autodetect
/dev/sdb3 798 1044 1984027+ fd Linux raid autodetect
md3 : active raid1 sdb3[1]
1983936 blocks [2/1] [_U]
md2 : active raid1 sdb2[1]
5245120 blocks [2/1] [_U]
md1 : active raid1 sdb1[1]
1156544 blocks [2/1] [_U]
unused devices: <none>
Nun müssen die RAIDPartitionen für das RAID konfiguriert werden.
Kontrolle:cat /etc/mdadm.conf
DEVICE /dev/sd*
ARRAY /dev/md1 metadata=0.90 UUID=f0045bf9:ddcdb29b:a24daeb9:4e1c5a02
ARRAY /dev/md2 metadata=0.90 UUID=0611c9b8:1aa41ea9:a24daeb9:4e1c5a02
ARRAY /dev/md3 metadata=0.90 UUID=97fcbd65:935c835b:a24daeb9:4e1c5a02
Nun müssen die neuen RAIDPartitionen formatiert werden:
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
328000 inodes, 1311280 blocks
65564 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1346371584
41 block groups
32768 blocks per group, 32768 fragments per group
8000 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: 0/41
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
124160 inodes, 495984 blocks
24799 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=511705088
16 block groups
32768 blocks per group, 32768 fragments per group
7760 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: 0/16
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Nun müssen alle Daten von den OriginalPartitionen auf die RaidPartitionen kopiert werden. Das dauert ein wenig.
Achtung! Die / am Ende sind wichtig!
Jetzt kann getestet werden, ob das System auch vom RAID bootet. Dazu muss aber nochdie neue /etc/fstab so geändert werden, dass dort die RAIDPartitionen benutzt werden.Dazu muss die neue RAIDRootPartition (im Beispiel /dev/md2) noch einmal als /mnt gemountet werden und dann dort in der /etc/fstab /dev/sda1 in /dev/md1 geändert werden. Dasselbe natürlich auch für /dev/sda2 und /dev/sda3. Ausserdem muss die initrd noch Informationen erhalten, so dass ein Booten die RAIDs konfiguriert werden.
/dev/md1 swap swap defaults 0 0
#/dev/sda2 / ext4 acl,user_xattr 1 1
/dev/md2 / ext4 acl,user_xattr 1 1
#/dev/sda3 /home ext4 acl,user_xattr 1 2
/dev/md3 /home ext4 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2 - 2.6.31.5-0.1
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/sda2 resume=/dev/sda1 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2 - 2.6.31.5-0.1
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/sda2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (fd0)
chainloader +1
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2 - 2.6.31.5-0.1 - RAID
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md2 resume=/dev/md1 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
/dev/md1 partition 1156536 0 -1
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/md3 on /home type ext4 (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
md3 : active raid1 sda3[2] sdb3[1]
1983936 blocks [2/1] [_U]
resync=DELAYED
md2 : active raid1 sda2[2] sdb2[1]
5245120 blocks [2/1] [_U]
[=>...................] recovery = 9.6% (504768/5245120) finish=2.8min speed=28042K/sec
md1 : active raid1 sda1[0] sdb1[1]
1156544 blocks [2/2] [UU]
unused devices: <none>
md3 : active raid1 sda3[0] sdb3[1]
1983936 blocks [2/2] [UU]
md2 : active raid1 sda2[0] sdb2[1]
5245120 blocks [2/2] [UU]
md1 : active raid1 sda1[0] sdb1[1]
1156544 blocks [2/2] [UU]
unused devices: <none>
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader
default 0
# added for RAID
fallback 1
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2 - 2.6.31.5-0.1 - RAID1 Disk 1
root (hd0,1)
# kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/sda2 resume=/dev/sda1 splash=silent quiet showopts vga=0x314
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md2 resume=/dev/md1 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
# added for RAID
title openSUSE 11.2 - 2.6.31.5-0.1 - RAID1 Disk 2
root (hd1,1)
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md2 resume=/dev/md1 splash=silent quiet showopts vga=0x314
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2 - 2.6.31.5-0.1
root (hd0,1)
# kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/sda2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (fd0)
chainloader +1
(hd0) /dev/sda
(hd1) /dev/sdb
Auf beiden Platten muss der grub Bootloader installiert werden.
grub
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 20 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+20 p (hd0,1)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
grub
grub> root (hd1,1)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 20 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd1)1+20 p (hd1,1)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
Der letzte Schritt besteht darin, noch einmal die initrd neu zu bauen
mkinitrd -f md
Damit ist das System von einem nicht RAID System zu einem RAID1 System ungewandelt worden.
