LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   remounting a lvm partitioned disk on new box (http://www.linuxquestions.org/questions/linux-software-2/remounting-a-lvm-partitioned-disk-on-new-box-136693/)

seastar 01-20-2004 09:10 AM

remounting a lvm partitioned disk on new box
 
How do I mount an existing LVM volume without loosing the data?

I have a disk (partitioned with lvm) that I need to get data from; original system is gone.
I have connected the drive to a new box (/dev/hdc)
I'm trying to figure out how to mount the volumes without loosing the data.

using Redhat 8; I have been through the lvm man pages; all options seem to include reinitializing the disk to get the volumes mounted.

fdisk shows:
----------------------------------------------------------------------
Disk /dev/hdc: 255 heads, 63 sectors, 19929 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 1305 10482381 8e Linux LVM
/dev/hdc2 1306 1436 1052257+ 8e Linux LVM
/dev/hdc4 1437 19929 148545022+ 5 Extended
/dev/hdc5 1437 2059 5004216 8e Linux LVM
/dev/hdc6 2060 2682 5004216 8e Linux LVM

crabboy 01-20-2004 11:45 AM

You should only have to do a pvscan and vgimport on the new system.

This will help:
http://tldp.org/HOWTO/LVM-HOWTO/x978.html

Let us know if you have problems with it.

seastar 01-21-2004 12:19 AM

I was able to get one vol grp remounted as well as the log vol associated.

[root@wdrlnxws2 root]# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- ACTIVE PV "/dev/hdc1" of VG "vg02" [9.99 GB / 0 free]
pvscan -- inactive PV "/dev/hdc2" is associated to unknown VG "vg00" (run vgscan)
pvscan -- inactive PV "/dev/hdc5" is associated to unknown VG "vg01" (run vgscan)
pvscan -- ACTIVE PV "/dev/hdc6" of VG "vg02" [4.77 GB / 2.77 GB free]
pvscan -- total: 4 [20.55 GB] / in use: 4 [20.55 GB] / in no VG: 0 [0]

the other two vol groups give me errors on export and import (see below)
any ideas for safe mounting or am i hosed with vg00 and vg01?
NOTE: i did not export these vol groups before i shut down the old system.


[root@wdrlnxws2 root]# vgexport vg00
vgexport -- ERROR "vg_read_with_pv_and_lv(): current PV" reading data of volume group "vg00"

[root@wdrlnxws2 root]# vgexport vg01
vgexport -- ERROR "vg_read_with_pv_and_lv(): current PV" reading data of volume group "vg01"

[root@wdrlnxws2 root]# vgimport vg00 /dev/hdc2
vgimport -- ERROR: physical volume "/dev/hdc2" doesn't belong to an exported volume group

[root@wdrlnxws2 root]# vgimport vg01 /dev/hdc5
vgimport -- ERROR: physical volume "/dev/hdc5" doesn't belong to an exported volume group

crabboy 01-21-2004 11:43 AM

Have you tried running vgscan as suggested? What does it report

seastar 01-21-2004 08:41 PM

i'm sorry; i forgot to put that in my earlier response.

root@wdrlnxws2 etc]# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found active volume group "vg02"
vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of volume group "vg00" from physical volume(s)
vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of volume group "vg01" from physical volume(s)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume groups

crabboy 01-21-2004 11:21 PM

I had your exact problem about two years ago, when a system had died and I moved the drives to a new machine. I can't remember exactly what I did to get everything to work, but I did not loose any data.

Have you tried running the vgimport with the -f flag? Force the import even if the pv was not flaged as exported.


All times are GMT -5. The time now is 07:06 AM.