LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-03-2008, 01:16 PM   #1
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Rep: Reputation: 15
Using lvremove without partitioning?


Hello,

My DC is won't repartition my server for me. They partitioned out the LVM when it should've been left as an LVM with free space. (To make it work with HyperVM/Xen) Since they won't repartition how can I remove the LogVol's within the VolGroup? I'll give some more info:

Code:
[root@ultima ~]# ls /dev/VolGroup00/
LogVol00  LogVol01

[root@ultima ~]# pvdisplay
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 111.69 GB / not usable 1018.00 KB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 3574
Free PE 0
Allocated PE 3574
PV UUID I69gev-z1zP-Cxo7-U3Oi-nqiK-VAC6-UgjaCk
I tried using lvremove and it doesn't work:
Code:
[root@ultima ~]# lvremove /dev/VolGroup00/LogVol00
Can't remove open logical volume "LogVol00"
-RageD
 
Old 06-03-2008, 03:10 PM   #2
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 228
Blog Entries: 1

Rep: Reputation: 34
Please try using -f option(forcefully):
Code:
lvremove -f /dev/VolGroup00/LogVol00
Complete guide for LVM:
http://www.redhat.com/docs/manuals/c...ger/index.html
 
Old 06-03-2008, 04:47 PM   #3
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Original Poster
Rep: Reputation: 15
I did try this prior (sorry didn't put it down) but I get the same response

Code:
[root@ultima ~]# lvremove -f /dev/VolGroup00/LogVol01
  Can't remove open logical volume "LogVol01"
Anyone more ideas?

-RageD
 
Old 06-03-2008, 06:45 PM   #4
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 228
Blog Entries: 1

Rep: Reputation: 34
Please make sure that your logical volume is not being used by any of processes.
Use 'lsof' or 'fuser' command for checking the same.

Also provide output of lvremove -vvvv.
Review http://osdir.com/ml/kernel.device-ma.../msg00091.html.
 
Old 06-03-2008, 08:10 PM   #5
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Here is the lvremove. I can't find them in use with the other commands.

LVM 00
Code:
[root@ultima ~]# lvremove -vvvv /dev/VolGroup00/LogVol00
#lvmcmdline.c:913         Processing: lvremove -vvvv /dev/VolGroup00/LogVol00
#lvmcmdline.c:916         O_DIRECT will be used
#config/config.c:864       Setting global/locking_type to 1
#locking/locking.c:138       File-based locking selected.
#config/config.c:841       Setting global/locking_dir to /var/lock/lvm
#toollib.c:219     Using logical volume(s) on command line
#locking/file_locking.c:164       Locking /var/lock/lvm/V_VolGroup00 WB
#device/dev-io.c:437         Opened /dev/hda RW O_DIRECT
#device/dev-io.c:134         /dev/hda: block size is 4096 bytes
#label/label.c:180       /dev/hda: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/hda
#device/dev-io.c:437         Opened /dev/root RW O_DIRECT
#device/dev-io.c:134         /dev/root: block size is 4096 bytes
#label/label.c:180       /dev/root: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/root
#device/dev-io.c:437         Opened /dev/hda1 RW O_DIRECT
#device/dev-io.c:134         /dev/hda1: block size is 1024 bytes
#label/label.c:180       /dev/hda1: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/hda1
#device/dev-io.c:437         Opened /dev/VolGroup00/LogVol01 RW O_DIRECT
#device/dev-io.c:134         /dev/VolGroup00/LogVol01: block size is 4096 bytes
#label/label.c:180       /dev/VolGroup00/LogVol01: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/VolGroup00/LogVol01
#device/dev-io.c:437         Opened /dev/hda2 RW O_DIRECT
#device/dev-io.c:134         /dev/hda2: block size is 2048 bytes
#label/label.c:158       /dev/hda2: lvm2 label detected
#cache/lvmcache.c:656         lvmcache: /dev/hda2: now orphaned
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#cache/lvmcache.c:656         lvmcache: /dev/hda2: now in VG VolGroup00
#cache/lvmcache.c:469         lvmcache: /dev/hda2: setting VolGroup00 VGID to 1DByVf0irKjhCA3qPwEjiS0ij0sIVx1T
#cache/lvmcache.c:691         lvmcache: /dev/hda2: VG VolGroup00: Set creation host to localhost.localdomain.
#label/label.c:158       /dev/hda2: lvm2 label detected
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#label/label.c:158       /dev/hda2: lvm2 label detected
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#format_text/format-text.c:323         Read VolGroup00 metadata (3) from /dev/hda2 at 6656 size 1118
#metadata/pv_manip.c:241         /dev/hda2 0:      0   3514: LogVol00(0:0)
#metadata/pv_manip.c:241         /dev/hda2 1:   3514     60: LogVol01(0:0)
#activate/activate.c:435         Getting device info for VolGroup00-LogVol00
#ioctl/libdm-iface.c:1569         dm version   OF   [16384]
#ioctl/libdm-iface.c:1569         dm info  LVM-1DByVf0irKjhCA3qPwEjiS0ij0sIVx1TWqBvyBHO1JPkBrmw21ocrC6hgcYFB33P OF   [16384]
#lvremove.c:60   Can't remove open logical volume "LogVol00"
#locking/file_locking.c:59       Unlocking /var/lock/lvm/V_VolGroup00
#device/dev-io.c:483         Closed /dev/hda2
LVM 01:
Code:
[root@ultima ~]# lvremove -vvvv /dev/VolGroup00/LogVol01
#lvmcmdline.c:913         Processing: lvremove -vvvv /dev/VolGroup00/LogVol01
#lvmcmdline.c:916         O_DIRECT will be used
#config/config.c:864       Setting global/locking_type to 1
#locking/locking.c:138       File-based locking selected.
#config/config.c:841       Setting global/locking_dir to /var/lock/lvm
#toollib.c:219     Using logical volume(s) on command line
#locking/file_locking.c:164       Locking /var/lock/lvm/V_VolGroup00 WB
#device/dev-io.c:437         Opened /dev/hda RW O_DIRECT
#device/dev-io.c:134         /dev/hda: block size is 4096 bytes
#label/label.c:180       /dev/hda: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/hda
#device/dev-io.c:437         Opened /dev/root RW O_DIRECT
#device/dev-io.c:134         /dev/root: block size is 4096 bytes
#label/label.c:180       /dev/root: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/root
#device/dev-io.c:437         Opened /dev/hda1 RW O_DIRECT
#device/dev-io.c:134         /dev/hda1: block size is 1024 bytes
#label/label.c:180       /dev/hda1: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/hda1
#device/dev-io.c:437         Opened /dev/VolGroup00/LogVol01 RW O_DIRECT
#device/dev-io.c:134         /dev/VolGroup00/LogVol01: block size is 4096 bytes
#label/label.c:180       /dev/VolGroup00/LogVol01: No label detected
#label/label.c:278         <backtrace>
#device/dev-io.c:483         Closed /dev/VolGroup00/LogVol01
#device/dev-io.c:437         Opened /dev/hda2 RW O_DIRECT
#device/dev-io.c:134         /dev/hda2: block size is 2048 bytes
#label/label.c:158       /dev/hda2: lvm2 label detected
#cache/lvmcache.c:656         lvmcache: /dev/hda2: now orphaned
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#cache/lvmcache.c:656         lvmcache: /dev/hda2: now in VG VolGroup00
#cache/lvmcache.c:469         lvmcache: /dev/hda2: setting VolGroup00 VGID to 1DByVf0irKjhCA3qPwEjiS0ij0sIVx1T
#cache/lvmcache.c:691         lvmcache: /dev/hda2: VG VolGroup00: Set creation host to localhost.localdomain.
#label/label.c:158       /dev/hda2: lvm2 label detected
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#label/label.c:158       /dev/hda2: lvm2 label detected
#format_text/format-text.c:954         /dev/hda2: Found metadata at 6656 size 1118 for VolGroup00 (1DByVf-0irK-jhCA-3qPw-EjiS-0ij0-sIVx1T)
#format_text/format-text.c:323         Read VolGroup00 metadata (3) from /dev/hda2 at 6656 size 1118
#metadata/pv_manip.c:241         /dev/hda2 0:      0   3514: LogVol00(0:0)
#metadata/pv_manip.c:241         /dev/hda2 1:   3514     60: LogVol01(0:0)
#activate/activate.c:435         Getting device info for VolGroup00-LogVol01
#ioctl/libdm-iface.c:1569         dm version   OF   [16384]
#ioctl/libdm-iface.c:1569         dm info  LVM-1DByVf0irKjhCA3qPwEjiS0ij0sIVx1TNnRLgOxGofcLaJKk8pzzTLjkCpDaiPnk OF   [16384]
#lvremove.c:60   Can't remove open logical volume "LogVol01"
#locking/file_locking.c:59       Unlocking /var/lock/lvm/V_VolGroup00
#device/dev-io.c:483         Closed /dev/hda2
-RageD
 
Old 06-04-2008, 12:08 PM   #6
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Any ideas??
 
Old 06-06-2008, 12:41 PM   #7
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Still no one?
 
Old 06-08-2008, 01:21 PM   #8
RageD
LQ Newbie
 
Registered: May 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Bump. *Hoping someone has some idea*
 
Old 06-20-2008, 01:39 PM   #9
trocster
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
Can't remove open logical volume

I have the same problem, logical volume with a partition table inside it.

lsof and fuser report nothing open.
mount, mtab, and proc/mount report it as not mounted.

so I do a kpartx -d /dev/vg/lvname
and ensure
multipathd -d -v3 -ll
reports no usage

I still can't lvremove /dev/vg/lvname
I cannot get partprobe or (ugh) reboots to update any partition information. in /dev/vg

no luck in getting device mapper to relinquish its hold either via:

dmsetup remove /dev/vg/lvname

Here is my setup
[root@uk1 ~]# lvm version
LVM version: 2.02.26-RHEL5 (2007-08-09)
Library version: 1.02.20 (2007-06-15)
Driver version: 4.11.0


and I was going to go on ...

but found that the /dev/vg symlinks are not updated from /dev/mapper/vg--

The trick for me was to check no mapper devices were active for that lv,
i.e. by deleting /dev/mapper/vg--lvpX or removing partitions via parted/fdisk


works now.
 
  


Reply

Tags
lvm, partition, partitioning


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
lvremove issue avijitp Linux - Software 1 07-12-2007 08:31 AM
Partitioning Leveecius Linux - Hardware 3 08-24-2006 04:54 AM
Partitioning brk3 Linux - General 4 09-03-2005 06:07 PM
Partitioning wondershowzen Linux - Newbie 3 06-20-2005 03:42 PM
Partitioning brokenflea Slackware 3 06-06-2004 11:55 PM


All times are GMT -5. The time now is 07:00 PM.

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