LVM (volume manager) and virtual disks


 
Thread Tools Search this Thread
Operating Systems Linux LVM (volume manager) and virtual disks
# 1  
Old 05-15-2009
LVM (volume manager) and virtual disks

Smilie
Hi guys,

I'm pulling my hair out over this one. I am trying to set up a virtual server environment. ( I am using VirtualBox, but I think this is irrelevant to this problem.) I have downloaded a pre-packaged Linux virtual disk, with which I have successfully started a virtual instance of a Linux server. Now, my goal is (nevermind why for now) to use one virtual machine to modify the root disk of another (which is turned off during this process). Here are the steps I take:
  1. Create and test a virtual linux server (as noted above), called vs-A
  2. Clone the disk used by vs-A (while vs-A is stopped). Let's call the first disk vhd-A1 and the new clone, vhd-A2.
  3. Create a new virtual linux server, vs-B which uses vhd-A2. This works. Power it off.
  4. Now tell vs-A to use vhd-A1 at /dev/hda (as usual) and to use vhd-A2 as /dev/hdb.
  5. Start vs-A
So now, vs-A is running with /dev/hda and /dev/hdb. But trying to do anything with hdb doesn't seem to work. I'd like to know why and to try to remedy that.

Code:
# dumpe2fs /dev/hdb2
dumpe2fs 1.39 (29-May-2006)
dumpe2fs: Bad magic number in super-block while trying to open /dev/hdb2
[expected -- it's "encapsulated" in an LVM]

# pvs -a
  Found duplicate PV pLPlWtPxq1A8JBAfSqrDWdhYZM2PpVr0: using /dev/hdb2 not /dev/hda2
  PV                       VG         Fmt  Attr PSize  PFree
  /dev/VolGroup00/LogVol01                 --       0     0
  /dev/hda1                                --       0     0
  /dev/hdb1                                --       0     0
  /dev/hdb2                VolGroup00 lvm2 a-   19.88G    0
  /dev/hdb2                VolGroup00 lvm2 a-   19.88G    0
<other output>

# lvscan
  Found duplicate PV pLPlWtPxq1A8JBAfSqrDWdhYZM2PpVr0: using /dev/hdb2 not /dev/hda2
  ACTIVE            '/dev/VolGroup00/LogVol00' [18.88 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [1.00 GB] inherit


# pvscan
  Found duplicate PV pLPlWtPxq1A8JBAfSqrDWdhYZM2PpVr0: using /dev/hdb2 not /dev/hda2
  PV /dev/hdb2   VG VolGroup00   lvm2 [19.88 GB / 0    free]
  Total: 1 [19.88 GB] / in use: 1 [19.88 GB] / in no VG: 0 [0   ]

# pvs
  Found duplicate PV pLPlWtPxq1A8JBAfSqrDWdhYZM2PpVr0: using /dev/hdb2 not /dev/hda2
  PV         VG         Fmt  Attr PSize  PFree
  /dev/hdb2  VolGroup00 lvm2 a-   19.88G    0

# :Fine, I'll just overwrite the thing!
#  mke2fs -b 4096 -O dir_index,spare_super /dev/hdb2
mke2fs 1.39 (29-May-2006)
/dev/hdb2 is apparently in use by the system; will not make a filesystem here!


Is there a tool or a technique to deal with this situation? Is there a way to rename the uuid? If so, how do I specify that I want the uuid of /dev/hdb changed? Is there a way to associate an existing physical partition to a new group? How do admins do disaster recovery with LVM in these kinds of situations?
# 2  
Old 05-15-2009
what is your ultimate goal for this disk. Do you care about the data on the disk? If so, have you thought about doing a vgchange and vgscan? It might even be better to, if you can, use the original machine to export the vg information and then import it on the other machine
# 3  
Old 05-15-2009
well, preferably, i would like to keep it. the idea is to clone the disk, make some changes to it (using a "master" vm), and then use it in another vm.

I didn't see anything meaningful that I could with vgchange.
# 4  
Old 05-15-2009
You should be able to take the disk with the LVM info on it, do a vgscan on it and import the VG information. You may need to do a vgimport
# 5  
Old 05-18-2009
Thanks, mark54g. I read up on vgimport, and this didn't seem to be what I needed. Anyway, I decided to approach my problem differently: by using a Linux-recovery-DVD/ISO from which to boot the VM. This works and didn't cause configuration headaches.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Disks are not visible in Veritas Volume manager

Hi I have created a new setup for VCS for doing some testing on virtual box. After creating 3 Solaris 10 machine (147148-26) with VCS. Here I have used one machine as ISCSI Storage. VCS Version is bash-3.2# /opt/VRTS/bin/haclus -value EngineVersion 6.0.10.0 bash-3.2# bash-3.2# pkginfo... (4 Replies)
Discussion started by: hb00
4 Replies

2. Red Hat

Configure LVM to gain access to the data on disks

Hello friends, We had to upgrade RHEL 4.x to 5.7 so we took complete backup. Since DIRECT UPGRADE not possible, we rebuilt 5.7 from scratch. We had lvm configuration on DATA disks in previous OS and now we need to configure such that we should be able to have same old LVM configuration (like... (1 Reply)
Discussion started by: prvnrk
1 Replies

3. Red Hat

Create volume using LVM over 2 physical disks

I wanted to know how we can combine volumes over 2 physical drives. # fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 ... (16 Replies)
Discussion started by: ikn3
16 Replies

4. UNIX for Dummies Questions & Answers

VERITAS Volume Manager - mirror a disk/volume

I have a machine (5.10 Generic_142900-03 sun4u sparc SUNW,Sun-Fire-V210) that we are upgrading the storage and my task is to mirror what is already on the machine to the new disk. I have the disk, it is labeled and ready but I am not sure of the next steps to mirror the existing diskgroup and... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies

5. Solaris

RAID manager or veritas volume manager

Can somebody kindly help me to determine which one i should choose to better manipulate OS volume. RAID manager or veritas volume manager? Any critical differences between those two? Thanks in advance. (5 Replies)
Discussion started by: beginningDBA
5 Replies

6. SuSE

Remove disks from VGs in LVM

Hi, I have following set up on Open suse 11 vgdisplay pvdisplay lvdisplay I would like to remove these disks /dev/sdb and /dev/sdc from LVM and do not use them for anything.. Can anyone please help me with this ? (1 Reply)
Discussion started by: upengan78
1 Replies

7. Solaris

How to resize mirror volume in veritas volume manager 3.5 on Solaris 9 OE

Hi all, I have a problem with vxvm volume which is mirror with two disks. when i am try to increase file system, it is throwing an ERROR: can not allocate 5083938 blocks, ERROR: can not able to run vxassist on this volume. Please find a sutable solutions. Thanks and Regards B. Nageswar... (0 Replies)
Discussion started by: nageswarb
0 Replies

8. UNIX for Advanced & Expert Users

LVM - Extending Logical Volume within Volume Group

Hello, I have logical volume group of 50GB, in which I have 2 logical volumes, LogVol01 and LogVol02, both are of 10GB. If I extend LogVol01 further by 10GB, then it keeps the extended copy after logical volume 2. I want to know where it keeps this information Regards Himanshu (3 Replies)
Discussion started by: ghimanshu
3 Replies

9. Linux

Problem for restoring lvm on different disks

Hi all, I have a server running in RH ES4, the SCSI HD are running in RAID 1. I backup the LVM config by using 'vgcfgbackup' and then remove all the HD. I insert another HD (same size & branch but different model) into the machine and run linux rescue to recreate the... (0 Replies)
Discussion started by: donaldfung
0 Replies
Login or Register to Ask a Question