LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 02-03-2011, 08:50 PM   #1
Boardy
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Rep: Reputation: 0
Manually and forcibly remove LVM configuration


Unbeknownst to me the LVM volume (on LUN) that I removed from my server was in use by another system. So instead of vgexporting the volume group on one of the servers and then lv,vg,pv-removing it on the other I dismantled the LVM devices my servers (as belwo).

0. unmount the filesystem
1. Remove logical volume (lvremove <vg>/<lv>)
2. Remove volume group (vgremove <vg>)
3. Remove LVM metadata from disk device (pvremove <dm-xx>)
4. Remove multipaths to disk (echo 1 > /sys/class/scsi_device/<h:c:t:l>/device/delete)
5. Mask and destroy the underlying LUN

I am now in the position that I can not remove the LVM configuration or multipath devices from the other server because it does not know about the volume group and can't see the disk.

For example vgdisplay errors as below

[root@chclnxora3 ql-dynamic-tgt-lun-disc-2.17]# vgdisplay -v VolGroupSharedRefresh23
Using volume group(s) on command line
Finding volume group "VolGroupSharedRefresh23"
/dev/dm-6: read failed after 0 of 4096 at 0: Input/output error
/dev/VolGroupSharedRefresh23/SharedRefresh23: read failed after 0 of 4096 at 0: Input/output error
Wiping cache of LVM-capable devices
/dev/mapper/sharedrefresh: read failed after 0 of 4096 at 644245028864: Input/output error
/dev/mapper/sharedrefresh: read failed after 0 of 4096 at 644245086208: Input/output error
/dev/mapper/sharedrefresh: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/sharedrefresh: read failed after 0 of 4096 at 4096: Input/output error
/dev/mapper/sharedrefresh: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/VolGroupSharedRefresh23-SharedRefresh23: read failed after 0 of 4096 at 644140171264: Input/output error
/dev/mapper/VolGroupSharedRefresh23-SharedRefresh23: read failed after 0 of 4096 at 644140228608: Input/output error
/dev/mapper/VolGroupSharedRefresh23-SharedRefresh23: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/VolGroupSharedRefresh23-SharedRefresh23: read failed after 0 of 4096 at 4096: Input/output error
/dev/mapper/VolGroupSharedRefresh23-SharedRefresh23: read failed after 0 of 4096 at 0: Input/output error
Volume group "VolGroupSharedRefresh23" not found

How on earth can I tidy up this mess?
 
Old 03-01-2011, 09:06 AM   #2
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Oh snap.

This has never happened to me, but only because I have EXTREME paranoia about this kind of thing.

I see you got a flood of sympathetic responses! lol

I see the post is quite old, did you fix it?

My best guess would be to mess with a copy of /etc/lvm/backup/VolGroupSharedRefresh23 or any other LVM config backup you have...
Then try and load it with a 'vgcfgrestore'...

But I'd do some serious Google'ing and drink a bottle of Jack first!

All the best.
 
Old 03-02-2011, 02:05 PM   #3
Boardy
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
Sadly not; either no one knows or no one cares. *SOB!*
 
Old 03-02-2011, 07:29 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Quote:
removed from my server was in use by another system
Exactly how was it 'shared'; NFS, cluster, sshfs, samba... ?
Assuming you want to destroy it ie not try to recover in situ (impossible imho), you need to 'disconnect' the 2 systems using the approriate cmds depending on how it was 'shared'.
If the 2nd server has no other LVMs, you could next try uninstalling LVM sw on there, or try these 2 links to help you edit the cfgs as needed.
http://tldp.org/HOWTO/LVM-HOWTO/
http://sunoano.name/ws/public_xhtml/lvm.html
 
Old 03-03-2011, 02:03 PM   #5
Boardy
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
As far as I can discern the LUN was presented to one of the servers and the LVM structures created; then the same LUN was presented simultaneously to the other server (to provide read only access to the data(?)) and the LVM stuctures were detected and imported (They are stored on the disk device, right?). My problem is that I have effectively removed the LVM structures from the LUN (and destroyed the LUN) when removing it from the first server. This has left the second server with some limited knowledge of the LVM configuration but absolutely no access to the LUN or it's LVM info. My task is to tidy up the second server so that it has absolutely no trace of the PV, VG and LVs. Sadly it uses LVM for many other volumes so I can not just uninstall LVM.
 
Old 03-04-2011, 01:14 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Quote:
then the same LUN was presented simultaneously to the other server
this is the key pt as per my prev qn; how was it 'presented' ie what protocol eg via a SAN, sshfs, nfs ... ?
Which system is the LVM disk(s) actually/primarily attached to? If the 1st system, then check those links to fix the cfgs on the 2nd system.
If the disk(s) are attached to the 2nd system, then you may also have to look at fdisk.
 
Old 03-06-2011, 02:32 PM   #7
Boardy
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
The LUN was presented by the SAN.
I don't know in which order the hosts were presented the disk.
The configuration is completely removed from one host and the disk is no longer there.
 
  


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
forcibly remove broken package edgjerp Linux - Software 8 05-01-2008 12:41 AM
Forcibly Remove Dead Smb Mounts tunasashimi Linux - Networking 3 06-13-2005 11:51 PM
Manually remove devices bhughesiii Linux - Hardware 2 12-16-2004 03:58 PM
How to manually remove hardware from SuSE? TongueTied Linux - Hardware 2 05-04-2004 02:21 AM
remove rpm manually? ldhertert Linux - Newbie 6 10-03-2003 08:42 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration