24

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.

Ravindra S
  • 103
  • 1
  • 1
  • 10
Mark
  • 483

5 Answers5

35

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 yes to all questions.

Then, I could manually format the whole device thing with GParted.

9

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.

Mark
  • 483
4

All you need to do is choose the "use whole disk" option in the installer. It will wipe out whatever is on the drive.

psusi
  • 38,031
2

Booting from a LiveCD, starting GParted and creating a new partition table on each drive will effectively remove all existing partitions. The amount of data written will be negligible, so it should not take long.

All data on the drives will be lost.

Sergey
  • 44,353
1

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.

Pabi
  • 7,429