LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   moving LVM without access to original server (https://www.linuxquestions.org/questions/linux-server-73/moving-lvm-without-access-to-original-server-4175512072/)

Jimz0r 07-23-2014 05:56 PM

moving LVM without access to original server
 
I have a server here at home that uses CentOS 6. It has 1x500gb HD and 3x2tb hdd's. I have what im pretty sure is a linear LVM spanning across the 3 2tb. Now the server that it is currently in will no longer read the drives (pretty sure it is the mobo coz the drives are still confirmed working.) So I don't have access to the Linux os to safely shutdown and export the LVM. If I chucked all these drives in another server that doesn't have an OS on it already and boot from the 500 which has my centos install on it. Will it successfully rebuild/workout that there is an LVM there or is my data gone?

rknichols 07-23-2014 06:15 PM

As long as the hardware is similar enough that the OS will boot, the OS should find and access the LVM drives just fine. Since the original server apparently crashed hard, you will likely have some filesystems that need fsck, but that should be all.

Jimz0r 07-23-2014 06:28 PM

Hmm you make a good point. The server it was in is an AMD athlon x2 so pretty old. Can you tell me what hardware is going to play a part in whether I can boot in or not?

Once I get my hands on a new server for it the hardware is going to be pretty new school.

syg00 07-23-2014 07:15 PM

A better option would probably be to get a OS on the new server, and let it detect the LVM components.

Jimz0r 07-23-2014 07:24 PM

Quote:

Originally Posted by syg00 (Post 5208618)
A better option would probably be to get a OS on the new server, and let it detect the LVM components.

So if i installed centos on the new PC and plug in the 3 2tbs. It should just read the LVM information without the 500GB in the loop?

syg00 07-23-2014 07:44 PM

Been a whie since I built Centos, but it should have LVM support in all the right places by default - if not you can instal it and do a "vgchange -a y" to force it to go look for "new" (as in unknown) vgs.

Jimz0r 07-23-2014 08:12 PM

Quote:

Originally Posted by syg00 (Post 5208629)
Been a whie since I built Centos, but it should have LVM support in all the right places by default - if not you can instal it and do a "vgchange -a y" to force it to go look for "new" (as in unknown) vgs.

Thanks for all the advice. It is very helpful. Just one last question. Will it matter what ports I plug the drives into? As it is a linear LVM will it work out what order the drives go in or do I require to plug it in, in the same pattern that the drives were in, in the old server?

syg00 07-23-2014 08:20 PM

One would hope the on-disk metadata is suffficient - else make sure you have that 500Gig drive handy; with luck there will be something in /etc/lvm/backup.

Jimz0r 07-23-2014 08:35 PM

Sweet. Thanks heaps.

Put my mind at ease before I go on my rescue mission this weekend :D

rknichols 07-23-2014 09:27 PM

I'll second the advice to install a new OS on the new server and let it find the LVM disks. The big issue is the presence of drivers needed to access the root filesystem. If that old 500GB disk was PATA, the initrd would not have included SATA drivers. Your new server might well not even have any PATA ports. so trying to use some SATA<=>PATA adapter would not work for booting without that SATA driver in the initrd.

syg00 07-23-2014 09:37 PM

One more thing - if you do install Centos, and use LVM again, don't accept the default names for vgs and (maybe) lvs. In all probability the names will be the same as the ones you'll be trying to restore.
Can be fixed later, but a PITA you can (and should) avoid easily.

Jimz0r 07-23-2014 09:48 PM

Quote:

Originally Posted by rknichols (Post 5208675)
I'll second the advice to install a new OS on the new server and let it find the LVM disks. The big issue is the presence of drivers needed to access the root filesystem. If that old 500GB disk was PATA, the initrd would not have included SATA drivers. Your new server might well not even have any PATA ports. so trying to use some SATA<=>PATA adapter would not work for booting without that SATA driver in the initrd.

The motherboard it is on now is SATA. So if that is the only limitation it will be ok.

Quote:

Originally Posted by syg00 (Post 5208678)
One more thing - if you do install Centos, and use LVM again, don't accept the default names for vgs and (maybe) lvs. In all probability the names will be the same as the ones you'll be trying to restore.
Can be fixed later, but a PITA you can (and should) avoid easily.

I didn't use a default name I don't think. I plugged all the drives into my windows PC and ran EXT2explore to see if the drives were working and EXT2explore saw a LVM named Share01 (which I am pretty sure is what I named it.

Cheers for the advice though. You guys have been immensely helpful in calming my nerves lol.


All times are GMT -5. The time now is 08:43 AM.