Adjust some README files..

This commit is contained in:
Christoph 2024-07-01 11:11:05 +02:00
parent 3c7531d016
commit 9113d8167c
4 changed files with 85 additions and 25 deletions

View File

@ -26,7 +26,7 @@ mdadm --manage /dev/md0 --run
# - Completely removing a mdadm raid array
# ---
## - # cat /proc/mdstat
## - # cat /proc/mdstat
## - Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10]
## - md1 : active raid1 sda3[0] sdb3[1]
## - 80533504 blocks super 1.2 [2/2] [UU]
@ -98,16 +98,16 @@ update-initramfs -u -k all
## - !! IMPORTANT !!
## - make sure do format the md device NOT the devices included
## - in the array
## -
## -
## - Notice - Lazy Initialization:
## -
## - For creation of an ext4-filesystem, cleaning up (initializing) inode tables
## - For creation of an ext4-filesystem, cleaning up (initializing) inode tables
## - and also initializing journal file are needed. Eanabling lazy
## - initialization speeds up the creation, and do that after mounting first
## - time. This is enabled by default.
## -
## - to disable lazy initialation use:
## -
## -
## - mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/md0
## -
## - Die "-m" Option reserviert soviel Prozent (hier: 0 Prozent) des Speichers
@ -148,7 +148,7 @@ mdadm -r <md-device> <partition-device>
mdadm -a <md-device> <partition-device>
## - Raid Array ist im auto-read-only status
## -
## -
## - Ändern durch:
## -
mdadm --readwrite /dev/md<n>
@ -166,14 +166,74 @@ mdadm --monitor --test -1 </dev/md?>
mdadm -D </dev/md?>
# ---
# =====
# - MBR-Partitionstabelle sichern und wiederherstellen
# ---
# =====
## - Save partitiontable
## -
sfdisk -d /dev/sdb > partitions.sdb.txt
## - Rrestore partitiontable
## - Restore partitiontable
## -
cat partitions.sdb.txt | sfdisk /dev/sdb
## - oder
## -
sfdisk /dev/sdb < partitions.sdb.txt
# =====
# - Restore (replicate) partition table on /dev/sdb (defet device) from /dev/sda (undemaged device)
# =====
## - Replicate GPT partition scheme from /dev/sda to /dev/sdd (useful for RAID array rebuild)
## -
## - !! Faulty device: /dev/sdb !!
## -
sfdisk -d /dev/sda | sfdisk /dev/sdb
## - oder (force)
## -
sfdisk -d /dev/sda | sfdisk -f /dev/sdb
^^^^^^^^
faulty device
# =====
# - GPT Partitionstabelle sichern und wiederherstellen
# =====
## - Save partitiontable
## -
## - sgdisk --backup={/path/to/file} {/dev/device/here}
## -
sgdisk --backup=/root/partitions.sdg.txt /dev/sdg
## - Restore partitiontable
## -
## - sgdisk --load-backup={/path/to/file} {/dev/device/here}
## -
sgdisk --load-backup=/root/partitions.sdg.txt /dev/sdg
# =====
# - Restore (replicate) partition table on /dev/sdg (defet device) from /dev/sdd (undemaged device)
# =====
## - Replicate GPT partition scheme from /dev/sda to /dev/sdd (useful for RAID array rebuild)
## -
## - !! Faulty device: /dev/sdg !!
## -
sgdisk -R /dev/sdg /dev/sdd
^^
faulty device
## - Anschließend neue zufällig GUID vergeben
## -
sgdisk -G /dev/sdd

View File

@ -8,7 +8,7 @@ The steps are mainly:
1.) Install Debian without setting up the RAID for the ESP partition.
During the partitioning, I've already created two identical partitions
During the partitioning, I've already created two identical partitions
marked as ESP partitions. They were on /dev/sda1 and /dev/sdb1
@ -27,8 +27,8 @@ The steps are mainly:
NOTE:
use metadata version 1.0
Version 1.0 still has the requirement (for this usecase) of placing the
superblock at the end of the device, but also includes "the modern features of mdadm",
Version 1.0 still has the requirement (for this usecase) of placing the
superblock at the end of the device, but also includes "the modern features of mdadm",
by using common layout format as 1.1 & 1.2.
# mdadm --create --verbose /dev/md3 --level=1 --raid-devices=2 --metadata=1.0 /dev/sda1 /dev/sdb1
@ -48,11 +48,11 @@ The steps are mainly:
7.) Changed the /boot/efi entry in /etc/fstab with the new UUID
for example:
UUID=C354-2922 /boot/efi vfat umask=0077 0 1
8.) Reload systemd
8.) Reload systemd
# systemctl daemon-reload

View File

@ -2,12 +2,19 @@
# - Rename /dev/md126 to /devmd2
# ---
# Check which devices are involved in the /dev/md5 array
#
cat /proc/mdstat
unount /dev/md126
mdadm --stop /dev/md126
mdadm --assemble --update=name --name=<HOSTNAME>:2 /dev/md2 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
# - Take care /etc/mdadm/mdadm.conf is up-to-date
# -
mdadm --examine --scan --config=mdadm.conf
# - Adjust /etc/mdadm/mdadm.conf if needed
# -
mdadm --examine --scan
# - Make the changes known to initramfs
# -

View File

@ -2,7 +2,7 @@
# - Festplattenaustausch im Software-RAID
# ---
1.) alle an raid-arrays beteiligten partitionen der defekten platte aus
1.) alle an raid-arrays beteiligten partitionen der defekten platte aus
den entsprechenden arrays entfernen
## - falls nicht schon vom system suspendiert und als fehlerhaft
@ -15,7 +15,7 @@
mdadm -r <md-device> <partition-device>
2.) Platte tauschen
## - festplatttenmodell und seriennummer auslesen
##
hdparm -I /dev/sdb | grep Number
@ -24,7 +24,7 @@
## - Beide Festplatten im Array müssen die exakt gleiche Partitionierung
## - haben. Die Partitionstabelle einer Festplatte lässt sich mittels dd
## - einfach auf eine andere kopieren.
## - einfach auf eine andere kopieren.
## -
## - Hierbei wird auch gleich der Bootloader mitkopiert.
## -
@ -34,19 +34,12 @@
## - !! Defekte Platte: /dev/sdb !!
## -
dd if=/dev/sda of=/dev/sdb count=1 bs=512 # falls die Platte /dev/sdb
^^ # ausgetauscht wurde
defekte Platte
## - oder alternativ
## -
sfdisk -d /dev/sda | sfdisk /dev/sdb
^^
defekte Platte
## - Partitionstabelle vom Kernel neu eingelesen
## - Partitionstabelle vom Kernel neu eingelesen
## -
sfdisk -R /dev/sdb