Damia Blog

Damia English Blog

Archives

Blogroll

  • Damia Spanish blog
  • Edith Apple Blog

Recipe: how to mount external RAID-LVM disk

August 18, 2010 by damia

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

Facebooktwitterredditpinterestlinkedinmail

Filed Under: howto

Archives

  • November 2016
  • December 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • May 2014
  • July 2012
  • September 2010
  • August 2010
  • April 2010
  • March 2010