Martin Hierling
2008-Apr-08 05:31 UTC
[Xen-users] howto delete a lvm with windows partition
Hi List, slightly OT but i have Xen and Windows running (xen 3.2.0, hvm, win 2k3) on top of a lvm volume. Now i want to delete such a volume but i got the message: $ lvremove /dev/Xen0/Win2kServer Can''t remove open logical volume "Win2kServer" The volume is not in use by any VM, but there is a partition table on it with 8Megs of free space and a ntfs partition. I also got 2 devnodes i /dev/mapper : brw-r----- 1 root disk 254, 52 Mar 27 14:03 Xen0-Win2kServer brw-r----- 1 root disk 254, 53 Mar 27 14:03 Xen0-Win2kServer1 So how can i remove such a lvm volume? regards Martin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tiago Cruz
2008-Apr-08 13:20 UTC
Re: [Xen-users] howto delete a lvm with windows partition
On Tue, 2008-04-08 at 07:31 +0200, Martin Hierling wrote:> Hi List,Hi Martin,> devnodes i /dev/mapper : > brw-r----- 1 root disk 254, 52 Mar 27 14:03 Xen0-Win2kServer > brw-r----- 1 root disk 254, 53 Mar 27 14:03 Xen0-Win2kServer1Try: # kpartx -d /dev/mapper/Xen0-Win2kServer The device "Xen0-Win2kServer1" MUST go away, so you will be able to delete this device. Regards -- Tiago Cruz http://everlinux.com Linux User #282636 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ross S. W. Walker
2008-Apr-08 14:10 UTC
RE: [Xen-users] howto delete a lvm with windows partition
Martin Hierling wrote:> > Hi List, > > slightly OT but i have Xen and Windows running (xen 3.2.0, hvm, win > 2k3) on top of a lvm volume. Now i want to delete such a volume but i > got the message: > $ lvremove /dev/Xen0/Win2kServer > Can''t remove open logical volume "Win2kServer" > > The volume is not in use by any VM, but there is a partition table on > it with 8Megs of free space and a ntfs partition. I also got 2 > devnodes i /dev/mapper : > brw-r----- 1 root disk 254, 52 Mar 27 14:03 Xen0-Win2kServer > brw-r----- 1 root disk 254, 53 Mar 27 14:03 Xen0-Win2kServer1 > > So how can i remove such a lvm volume?What''s the output of ''lvs''? Maybe it is open somewhere when you think it is not. If you find it is open an ''lsof /dev/mapper'' may show you what process has it open. -Ross ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Martin Hierling
2008-Apr-08 16:32 UTC
Re: [Xen-users] howto delete a lvm with windows partition
Hi,> What''s the output of ''lvs''? Maybe it is open somewhere when you > think it is not. If you find it is open an ''lsof /dev/mapper'' > may show you what process has it open.@Ross: $ lvs | grep Win2k Win2kServer Xen0 -wi-ao 8.00G dont know what it tells me. ~ $ lsof /dev/mapper/Xen0-Win2kServer ~ $ lsof /dev/mapper/Xen0-Win2kServer1 no output! @Tiago: $ partx -l /dev/mapper/Xen0-Win2kServer # 1: 0- -1 ( 0 sectors, 0 MB) # 2: 0- -1 ( 0 sectors, 0 MB) # 3: 0- -1 ( 0 sectors, 0 MB) # 4: 0- -1 ( 0 sectors, 0 MB) $ partx -d /dev/mapper/Xen0-Win2kServer error deleting partition 1: BLKPG: Invalid argument no success... any more ideas? regards Martin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Martin Hierling
2008-Apr-08 16:37 UTC
Re: [Xen-users] howto delete a lvm with windows partition
Hi, dont know what did the trick, but partx -d /dev/xy and deleting the partitions with fdisk and reboot to reread the partition table, after that it is possible to delete the device! tnx to Ross and Tiago Martin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tiago Cruz
2008-Apr-08 16:41 UTC
Re: [Xen-users] howto delete a lvm with windows partition
On Tue, 2008-04-08 at 18:32 +0200, Martin Hierling wrote:> @Tiago: > $ partx -l /dev/mapper/Xen0-Win2kServerMartin, It''s not "partx"! The correct command was "kpartx(8)": # kpartx -d /dev/mapper/Xen0-Win2kServer kpartx - Create device maps from partition tables -d Delete partition mappings # rpm -qf /sbin/kpartx kpartx-0.4.7-12.el5_1.3 -- Tiago Cruz http://everlinux.com Linux User #282636 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Martin Hierling
2008-Apr-08 18:08 UTC
Re: [Xen-users] howto delete a lvm with windows partition
Tiago:> It''s not "partx"! The correct command was "kpartx(8)":the one who can read are in advantage :-( i have tried it with kpartx and it works like a charm. tnx again, Martin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users