I've been wanting to learn more about LVM, so I finally have taken the time to dive into it. Being the very smart computer guy that I am, I had the great wisdom to experiment with LVM on one of my LIVE servers! Now I cannot boot it!!! Of course, I have a lot of data on there that I would sure like to get back, so I hope my situation is recoverable and that you can help me. Here's my situation:
The server had a default Ubuntu 12.04.2 LTS install on it where it automatically partitioned the disk for me at install. It provided a regular boot partition of /dev/sda1 and it turned the remainder of the disk (/dev/sda5) into an LVM volume (ubuntu1) with /dev/ubuntu1/root and /dev/ubuntu1/swap_1 logical volumes. It has been running fine for a year or two and all is well.
Now comes me with my LVM experiments. I added a 2nd harddrive /dev/sdb and set it up as one partition. Then prepared for LVM use with
pvcreate /dev/sdb1. Then I added it to my already established volume group with
vgextend ubuntu1 /dev/sdb1. Now, just as an experiment, I was going to copy everything from /dev/sda5 over to it so I used
pvmove /dev/sda5 /dev/sdb1. After seeing that this was going to take a long time, I aborted that process with
ctrl-c. That was my first mistake. Then I ran
fdisk /dev/sdb and deleted the partition, which was apparently my second mistake.
Now the volume group "ubuntu1" is in an unstable state and I can no longer boot the server. It does however boot to the grub menu but when I try to load Ubuntu it complains that it cannot find the /dev/mapper/ubuntu1-root logical volume and drops me to a shell.
In trying to fix the problem, I ran
pvmove --abort but it could no longer find the deleted partition and said it cannot change vg ubuntu1 while PVs are missing. I also tried
vgreduce ubuntu1 --removemissing but that failed also and complained that there are still partial LVs in the volume group. I even tried the
--force option of vgreduce, but same thing.
When I do a
pvdisplay it shows the /dev/sda5 volume, but it also shows the sdb volume and calls it an "unknown device", and both are a part of the ubuntu1 volume group.
Is there a way out of this? When pvmove was running, was it actually "moving" the data or was it just copying? Assuming it was only copying, it seems to me that if I were able to get LVM to forget about the unknown device, then all would be fine? Or, is there a way to put the partition back on that 2nd drive so the
pvmove --abort command would do it's thing? I don't know but if a person knowledgeable with LVM could help me I'd sure appreciate it. Thank you.