[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] Can not use vgimportclone multiple times for the attached disk



> I successfully mounted the associated logical volume from the backup of

> the same machine. Before SCSI scan I have only /dev/sda2 After SCSI 
> bus scan (rescan-scsi-bus.sh) I can see the new disk attached to my RHEL 
> machine.
>
> # vgimportclone -n NEWVG /dev/sdc2
> 
> It successfully rename the VG.
> #vgchange -ay NEWVG
>
> I am able to mount the logical volumes associated with this VG to verify
> the backup.
>
> After verifying I un-mounted logical volume and remove the volume group.
> Vgremove -f NEWVG 

This doesn't do what you think it does!  

vgremove removes the metadata from the physical volumes in the volume group, essentially destroying it.  So now /dev/sdc2 is not part of a vg at all. 

If you're just trying to unpresent /dev/sdc2 then you probably want to use vgexport to make the vg safe to export, then physically pull the disk.  While it is possible to do, LVM does not provide a way to make the linux forget about the disk, just as you have to use a seperate script to get it to recognize it in the first place.

As Stuart says, if you tell us more about what you're trying to do maybe we can be a bit more helpful :)


As an aside vgimportclone is only necesary if the metadata is an exact clone of that from an existing pv/vg if you've run it once then you dont need to run it again on that vg because the metadata has been already altered and therefore its no longer an exact clone (the data's the same but the disk headers are different)

chris



      



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]