LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-20-2004, 09:10 AM   #1
seastar
LQ Newbie
 
Registered: Dec 2003
Distribution: RedHat 8
Posts: 8

Rep: Reputation: 0
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
 
Old 01-20-2004, 11:45 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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.
 
Old 01-21-2004, 12:19 AM   #3
seastar
LQ Newbie
 
Registered: Dec 2003
Distribution: RedHat 8
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 01-21-2004, 11:43 AM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Have you tried running vgscan as suggested? What does it report
 
Old 01-21-2004, 08:41 PM   #5
seastar
LQ Newbie
 
Registered: Dec 2003
Distribution: RedHat 8
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 01-21-2004, 11:21 PM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two LVM VolGroup's, same name, one is system disk - what to do? ffingers Linux - Hardware 11 05-12-2010 02:59 PM
Disk is already fully (1) partitioned with XP, how can I squeeze a new partition in? garvey Linux - Software 7 11-03-2005 03:02 PM
Suspend to Disk (Possible with LVM?) dino9832 Linux - Laptop and Netbook 1 10-05-2004 09:16 AM
external partitioned usb hard disk mr_a_ali Linux - Hardware 2 08-14-2004 10:22 AM
Problem with boot loaders in a partitioned disk! tolis Linux - General 1 03-01-2004 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration