I usually install Debian machines with software RAID and LVM, until today I have not needed to recover one disk from outside the the system. It is a little bit trick, I decide to make this post for my own interest and help others.
Basically there are two step, to mount the RAID and to mount the LVM.
First at all you can do a cfdisk to see the partitions:
sdg5 LΓ³gica Linux raid autodetect 3997,46 *
sdg2 Primaria Linux raid autodetect 1003,49
sdg3 Primaria Linux raid autodetect 395101,33
sdg4 Primaria NTFS [] 100002,96
Ok, The partition I am interested in is, /dev/sdg3.
The I exec:
# mdadm --examine --scan /dev/sdg3
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=10e9ab2b:97f55678:84e7df75:fb5ca897
I edit the file /etc/mdadm/mdadm.conf and add this line to the ARRAY list.
/etc/init.d/mdadm-raid stop
/etc/init.d/mdadm-raid start
Assembling MD array md2...done (degraded [1/2]).
Generating udev events for MD arrays...done.
Thats it !!I have the RAID subsystem mounted.
# cat /proc/mdstat
Personalities : [raid1]
md2 : active (auto-read-only) raid1 sdg3[0]
385841024 blocks [2/1] [U_]
Now let’s go to the LVM part.
# pvscan
...
PV /dev/md2 VG rootmd lvm2 [367,96 GB / 188,00 MB free]
...
# lvscan
....
inactive '/dev/rootmd/rootvg' [18,00 GB] inherit
inactive '/dev/rootmd/homevg' [349,78 GB] inherit
...
To activate, use:
#lvchange -ay rootmd/homevg
#lvchange -ay rootmd/rootvg
#lvscan
ACTIVE '/dev/rootmd/rootvg' [18,00 GB] inherit
ACTIVE '/dev/rootmd/homevg' [349,78 GB] inherit
Ok, now we have All the volumes available:
# mount /dev/rootmd/homevg /mnt1