How to remove all LVs VGs and Partitions On All Drives Before Installing 12.04
Solution 1
I was unable to delete a partition because it was in use by a Volume Group (system). I was told it was unable to delete that Volume Group because a Physical Volume was missing.
Once I ran vgreduce --removemissing system
I was able to delete the Volume Group and then the partition leaving me right where I wanted to be.
Thanks for the suggested answers, they got me thinking on the right track.
Solution 2
Just for the sake of this question, I just encountered the same problem and here's how I fixed it (all these commands were entered from a live session) :
sudo vgdisplay
then I located the group name to delete
sudo vgremove <groupname>
said y
es to all questions.
Then, I could manually format the whole device thing with GParted.
Solution 3
All you need to do is choose the "use whole disk" option in the installer. It will wipe out whatever is on the drive.
Solution 4
I experienced a similar situation.
I found that I had to go through the installation process to the part where you select the mode of creating the partitions: Guided or Manual.
Then I could use the Alt+F2 to switch to another console. When I typed help
, it did not show any of the LVM commands. I used vgdisplay
to see the name of VirtualGroup.
I then specified vgreduce -v -f <inserted my VirtualGroup name from the vgdisplay>
- where the v
flag specifies verbose so I could see what LVM was doing, and the f
flag to force, since the first few times it complained about not finding the missing drive.
Then I switched back to the main console Alt+F1 and selected Guided using LVM. The installer found the fixed LVM partition and deleted it, so that I could continue with the install.
Related videos on Youtube
Mark
Updated on September 18, 2022Comments
-
Mark over 1 year
I have 2 hard drives that had been used for Ubuntu Server 11.10. Now I would like to start from scratch with 12.04 but I'm having some trouble with the existing logical volumes and volume groups. Erasing data during install looks like it's going to take days. Is there a quick and simple way to wipe out all volumes/groups/partitions so I can start with 2 empty drives? When I set this up on 11.04 it took me a while to learn how to do it and I've since forgotten most of what I learned.
For what it's worth, I'm only using this box to learn about Linux.
-
Mark over 11 yearsWill that limit what I can do with the drive(s) after install?
-
Mark over 11 yearsGave it a shot. Here's what I got- Unable to automatically remove LVM data. Because the volume group(s) on the selected device also consist of physical volumes on other devices, it's not safe to remove automatically. Please remove it's LVM data first.
-
psusi over 11 years@Mark, that's weird... choose manual partitioning and delete the existing partitions then.
-
Mark over 11 yearsIt tells me the partition is in use by LVM volume group. When I try to delete the volume group it tells me it can't because 1 or more logical volumes may be in use. It's showing me 0 Free Physical Volumes, 2 Used PVs, 1 VG and 0 Logical Volumes. I do see that the VG consists of 2 PVs - /dev/sda2 and unknown. Virtual Console(4) tells me it can't change Virtual Group while PVs are missing. I hope that makes some sense to you. I'm confused.
-
Mark over 11 yearsHa! I got it. Had to use
vgreduce --removemissing system
. Now I have two clean, empty drives. I should probably read up on LVM before going ahead with installation. Heck, it's a "learning" server. Thanks for the help! -
NickG almost 11 yearsJust to add to that, press ALT-F2 whilst using the Ubuntu installer to bring up a console, where you can enter
vgreduce --removemissing system
as suggested. -
Erik over 9 yearsI used
vgremove <LVM Group Name>
-
Matt Coubrough over 8 yearsI had the same problem when installing Ubuntu 14.04.3 and totally replacing an old CentOS install and this solution worked well for me.
-
wawa over 8 yearsDid the trick for me, after that I was able to format the disk with gparted from the live cd.
-
BrainSlugs83 about 8 yearsDid not work
vgremove
says try callingvgreduce --removemissing
but that also fails. -
BrainSlugs83 about 8 years+1, I was able to make this work -- changing
system
for the volume group name, this put me in a good enough state thatvgremove
started working. Woot! -
Tzunghsing David Wong about 8 yearsJust ran into the same issue and this answer solves the problem. Just for the record, I used "sudo vgscan" which gives a terse output (than "sudo vgdisplay")