From 695a3ef68726e29f7820c716bdbd6fd9b500fb5b Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Sat, 10 May 2025 01:07:17 +0200 Subject: [PATCH] Update RAID recovery instructions --- _posts/sysadm/2023-09-15-lvm-cheat-sheet.tl | 24 +++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/_posts/sysadm/2023-09-15-lvm-cheat-sheet.tl b/_posts/sysadm/2023-09-15-lvm-cheat-sheet.tl index 40903ac..a5f4f88 100644 --- a/_posts/sysadm/2023-09-15-lvm-cheat-sheet.tl +++ b/_posts/sysadm/2023-09-15-lvm-cheat-sheet.tl @@ -34,7 +34,7 @@ If problems are found, this is denoted by @m@ on 9th bit of attributes displayed by @lvs@: {% highlight bash %} -$ cat /tmp/lvs +# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert backup vgdev rwi-aor-m- 4.00g 100.00 {% endhighlight %} @@ -58,7 +58,8 @@ bq. Integrity limitations pvmove, snapshots, splitmirror, raid syncaction commands, raid rebuild. That means commands like @lvchange --syncaction repair@ or @lvchange --rebuild@ -won't work as expected. +*should not be run* on RAID with integrity. They can give misleading results, +e.g. signal mismatch when there is none. If RAID1 with integrity LV requires refresh (partial synchronization) due to e.g. device write errors, but both PVs are otherwise available, take the @@ -82,7 +83,8 @@ so the process must be performed manually: {% endhighlight %} * check integrity of both RAID1 parts: -** whether they differ at all: +** whether they differ at all (this may be time consuming and it may be more +appropriate to proceed directly to file content comparison instead): {% highlight bash %} # sha512sum /dev/vgdev/backup /dev/vgdev/backup_split {% endhighlight %} @@ -92,11 +94,19 @@ so the process must be performed manually: # fsck.ext4 -n -f /dev/vgdev/backup_split {% endhighlight %} ** once filesystems are fixed and can be mounted, compare file content to -determine which mirror is valid: +determine which mirror is valid (no output from @rsync@ means no differences): {% highlight bash %} # mount /dev/vgdev/backup /mnt/mirror1 -# mount /dev/vgdev/backup_split /mnt/mirror1 -# rsync -d /mnt/mirror1 /mnt/mirror2 +# mount /dev/vgdev/backup_split /mnt/mirror2 +# rsync -n -c -a --delete --progress /mnt/mirror1 /mnt/mirror2 {% endhighlight %} -* finally remove invalid mirror, recreate RAID1 and re-add integrity layer +* finally remove invalid mirror, recreate RAID1, re-add integrity layer and +discard unused space if necessary + + +h2. SSD related maintenance + +h3. Discard unused space + +* OWC does not support TRIM