Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
admin_grundlagen:software_raid [2013/07/05 16:56] ingo_wichmann |
admin_grundlagen:software_raid [2018/08/29 15:24] ingo_wichmann gelöscht |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Bestehendes System auf Sofrware RAID 1 migrieren ====== | + | ====== Bestehendes System auf Software RAID 1 migrieren ====== |
===== Vorraussetzung ===== | ===== Vorraussetzung ===== | ||
Laufendes Linuxsystem auf einer Festplatte, zusätzliche mindestens gleich große zweite neue Festplatte. | Laufendes Linuxsystem auf einer Festplatte, zusätzliche mindestens gleich große zweite neue Festplatte. | ||
- | Zum Testen können die Partitionen auch auf der selben Festplatte liegen. | + | Zum Testen können auch zwei Partitionen auf der selben Festplatte genutzt werden. |
===== Partitionierung ===== | ===== Partitionierung ===== | ||
Zeile 9: | Zeile 9: | ||
==== RAID Partition taggen ==== | ==== RAID Partition taggen ==== | ||
- | parted /dev/sda4 set raid on | + | parted /dev/sda set 4 raid on |
- | fdisk -l | grep 'Linux raid autodetect' | + | fdisk -l | grep raid |
<file> | <file> | ||
/dev/sda4 63500288 126414847 31457280 fd Linux raid autodetect | /dev/sda4 63500288 126414847 31457280 fd Linux raid autodetect | ||
Zeile 24: | Zeile 24: | ||
===== RAID 1 anlegen ===== | ===== RAID 1 anlegen ===== | ||
mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sda4 | mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sda4 | ||
- | |||
- | ===== Dateien übertragen ====== | ||
mkfs.ext4 /dev/md0 | mkfs.ext4 /dev/md0 | ||
mkdir /mnt/md0 | mkdir /mnt/md0 | ||
mount /dev/md0 /mnt/md0 | mount /dev/md0 /mnt/md0 | ||
- | mkdir /mnt/system | + | mkdir /tmp/system |
- | mount --bind / /mnt/system | + | mount --bind / /tmp/system |
- | mount --bind /boot /mnt/system/boot/ | + | mount --bind /boot /tmp/system/boot/ |
- | cp -a /mnt/system/. /mnt/md0 | + | cp -a /tmp/system/. /mnt/md0 |
- | (( oder alternativ: | + | (( alternativ: |
- | rsync -a --del /mnt/system/ /mnt/md0 | + | rsync -a --del /tmp/system/ /mnt/md0 |
)) | )) | ||
- | umount /mnt/system/boot | + | |
- | umount /mnt/system | + | umount /tmp/system |
- | rmdir /mnt/system | + | cd /mnt/md0 |
- | + | ||
- | cd /tmp/md0 | + | |
mount --rbind /dev dev | mount --rbind /dev dev | ||
mount --bind /proc proc | mount --bind /proc proc | ||
mount --bind /sys sys | mount --bind /sys sys | ||
+ | |||
chroot . | chroot . | ||
- | | + | |
- | ''/etc/fstab'' anpassen: | + | mdadm --incremental --rebuild-map |
- | <file> | + | grub-mkdevicemap -n |
- | /dev/md0 / ext3 defaults,errors=remount-ro 0 1 | + | update-grub |
- | </file> | + | update-initramfs -u |
+ | |||
+ | logout | ||
+ | reboot | ||
+ | |||
+ | mdadm --manage --add /dev/md/0 /dev/sda2 | ||
watch cat /proc/mdstat | watch cat /proc/mdstat | ||