howto import existing linux soft array volume group
Solution 1
Maybe you can try to follow the recipe for moving volumes in the LVM Howto? Of course you'll skip a few steps there.
Solution 2
What distribution is this?
You will need to enable lvm and dm at boot - as said, lots of dists will do this automatically, but Opensuse does not for example. How you ensure these are enabled at boot are distro dependent.
You say that the raid1 is fine, so you'll need to assemble it:
mdadm --assemble --scan --auto=yes /dev/md0
Once you have the array up and running, recreate your mdadm.conf:
/sbin/mdadm --examine --scan >> /etc/mdadm/mdadm.conf
Then restart lvm - this is a bit distro dependent too - but
/etc/init.d/lvm2 restart
is the debian way
This should scan your volume groups and find the logical volumes.
Note that vgscan
should be enough to find them and find the lvs, and then
lvdisplay -C
Gives you a compact list of volumes.
Related videos on Youtube
John P
Updated on September 18, 2022Comments
-
John P over 1 year
I have a server that consists of a boot drive, then two data drives combined to a RAID1 linux array. My boot drive recently became corrupted and I need to re-install the operating system. The RAID1 data array is fine, and I would like to just import it once the operating system is installed. (The data array is just a big LVM setup in a volume group)
What steps should I go through to import the volume group, and LVM within the array? Google has been surprisingly unhelpful for this.
Thanks in advance
-
John P over 12 yearsIt is not a mountable partition - it is a LVM which I have in a volume group. I don't think that can be addressed in the loader
-
Paweł Brodacki over 12 yearsIf by loader you mean bootloader, it needs access only to your /boot partition. Root file system on LVM is supported for a long time. If by loader you mean installer, then yes, all modern installers will work just fine. And LVM volume is just another block device. If it contains a file system it can be mounted. /dev/sda1 or /dev/vgname/lvname, what's the difference? :)
-
John P over 12 yearsI'm accepting this answer. I removed the RAIDed disks during install just to make sure they were not messed with, then put them back in after the OS install was finished, and the the RAID array was automatically visible. The volume export/import was a critical step in the progress that I would have missed, but it worked perfectly