diff options
Diffstat (limited to 'content/posts/recover-softraidlvm.rst')
-rw-r--r-- | content/posts/recover-softraidlvm.rst | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/content/posts/recover-softraidlvm.rst b/content/posts/recover-softraidlvm.rst new file mode 100644 index 0000000..efc070d --- /dev/null +++ b/content/posts/recover-softraidlvm.rst @@ -0,0 +1,62 @@ +Recover Softraid/LVM +#################### +Date: 2012-02-06 10:24 +:tags: mdadm, softraid, lvm + +MD Array fails to assemble +========================== + +Find the Problem +---------------- + +.. code-block:: bash + + #?/bin/sh + cat /proc/mdstat + mdadm -D --scan + mdadm -E --scan + mdadm -E /dev/sd[abcdef]1 + +Trying to assemble manually +--------------------------- + +.. code-block:: bash + + #?/bin/sh + mdadm --stop /dev/md{0,127} + mdadm --assemble /dev/md0 /dev/sd{a,b,c,d,e,f}1 --force + + + +recover a failed device in the array +------------------------------------ + +.. code-block:: bash + + #?/bin/sh + mdadm /dev/md0 --re-add /dev/sdx1 # will likely fail + mdadm --zero-superblock /dev/sdx1 # reap the device + echo 200000 > /proc/sys/dev/raid/speed_limit_min # speed up recovery + mdadm /dev/md0 --add /dev/sde1 + sleep 56000 && echo "FINISHED!" + + + + +Recover LVM after doing something stupid +======================================== + +Restore VolGroup Partitioning +----------------------------- + +.. code-block:: bash + + #?/bin/sh + # imagine you did something like 'vgremove vg' + vgdisplay -v # > logical volume: empty :( + # lvm stores backup of partitioning, yay + vgcfgrestore -f /etc/lvm/archive/vg_00018-2146062166.vg -v vg + vgchange -ay + vgdisplay -v # > logical volume: files1 + e2fsck /dev/vg/files1 + mount /dev/vg/files1 |