1753916 Members
8107 Online
108810 Solutions
New Discussion юеВ

Remove logical volume

 
D. Versluis
Occasional Contributor

Remove logical volume

Hai,

When I want to remove a logical volume (HP/9000, 10.20), I get the error:
Couldn't remove Logical volume "/dev/vg03/lvol10"
You must lvrmboot -s before removing a swap device.

When I type: lvrmboot -s /dev/vg03, I get the error:
No valid Boot Data Reserved Areas exist on any of the
Physical Volumes in the Volume Group "/dev/vg03".
Issue the pvcreate -B command to create a Boot Area on a Physical Volume.
The fstype of this volume is HFS (fstype /dev/vg03/lvol10). This file is not
the last file in the directory.

Can somebody help me please?
Thanks.
4 REPLIES 4
Chris Lonergan_1
New Member

Re: Remove logical volume

From what you've said it sounds like the lvol is secondary swap. You can
determine this by use of the swapinfo command.

If it is then you need to:

Disable this swap by editing out the line in /etc/fstab
Reboot the machine
Then remove the lvol.

Chris
June Hou
Occasional Advisor

Re: Remove logical volume

Funny, I have the exactly same problem! I'm removing some old VG's (nothing system related, mind you), and the last one, an old database raw volume, has just this difficulty.

The thing is, this LV isn't a swap volume at all. In fact, no disk in this VG has a boot area. It's just a normal user LV, so I can't imagine how LVM thinks it's a swap volume. It's not in /etc/fstab, nor does lvlnboot -v know anything about it.

Does anybody know the gimmick to shake this LV loose? Thanks in advance. =-)

-cheers, Craig S. Bell
"Nothing works, and nobody cares." -Woody Allen
June Hou
Occasional Advisor

Re: Remove logical volume

By the way, this is HP-UX 10.20 on a two-way K420, with an 8-user license. The last patch bundle applied was B.10.20.43 (not the latest, I know). -cheers, CSB
"Nothing works, and nobody cares." -Woody Allen
June Hou
Occasional Advisor

Re: Remove logical volume

Heyyy, I answered my own question. =-) =-)

Fortunately, I had some extra disks around (since I was removing old VG's). To get rid of my bad volume (let's call it /dev/vg/badlv) , I made a bootable disk, and added it to the VG in question:

# pvcreate -B newdisk
# mkboot newdisk
# vgextend vg newdisk

Next, I moved all of the physical extents from the original disk to this new disk, and got rid of the old disk.

# pvmove olddisk newdisk
# vgreduce vg olddisk

...Now, I have a bootable disk with all of the volumes, including the troublesome one. We can use lvlnboot to make mv bad LV a swap device, and see if that helps.

Before we do that, we have to make a root LV. This has to be contiguous, and can't have bad block relocation. The alleged swap LV must be contiguous, too. Here we go:

# lvcreate -l 100 -n dummy_root vg
# lvchange -C y /dev/vg/badlv
# lvchange -C y /dev/vg/dummy_root
# lvchange -r n /dev/vg/dummy_root

Now, I can create the root and swap flags:

# lvlnboot -r /dev/vg/dummy_root
# lvlnboot -s /dev/vg/badlv

Then, I turn right around and get rid of them:

# lvrmboot -s vg
# lvrmboot -r vg

...wow, I was able to get LVM to forget about this silly swap area business. =-) Finally, I remove the LV's, and then get rid of the VG altogether:

# lvremove /dev/vg/dummy_root
# lvremove /dev/vg/badlv
# vgremove vg

...All done. I guess there was just a bad bit in my lvmtab. Once I was able to convince LVM that my bad LV was a legitimate swap area, it was perfectly happy to let me un-make it a swap area.

It's probably too late to help the original poster, but here's hoping it helps the next sysadmin. =-) -cheers, Craig S. Bell
"Nothing works, and nobody cares." -Woody Allen