# LVM2: Couldn't find device with uuid... [solved]

## weird wonko

I set up LVM2 some days ago, without problems. But today my box crashed, and after rebooting, I get "Couldn't find device with uuid" errors. With /usr, /var, /home, /opt and /tmp being on logical volumes, nothing is working now. I do not know what the error is, if it came by the crash, or if I did something. I found some postings here and in usenet, but nothing that really helped me. There are some things I will try, but I do not know much about LVM2 yet and I really do not want to lose my data, so I hesitated. Maybe someone here knows what's wrong, I hope so.

More detail. This is the setup I had:

```
hda1    /boot   16M

hda2    swap    1.5G

hda3    /       1G

hda5    lvm0    20G

hda6    lvm0    20G

hda7    /data   75G

```

All was fine, rebooting was no problem. But my home partition was too small, so the plan was to delete the /data partition and create more  LVM partitions (20 G each) for my lvm0 volume group, and to resize my /home then.

I first set up another volume group on an external USB drive to backup the /data partititon, this was no problem, and this volume group is still okay.  Then I deleted hda7 and created hda7 to hda10. I used vgextend to add hda7 to the lvm0 volume group.

That's it, I did nothing more yet. One day later (without rebooting), X suddenly crashed (probably due to emerging a new xorg-x11), even the text mode was affected, I had to reboot. And from now on I no longer have the lvm0 group, because a device cannot be found.

lvdisplay gives this output:

```
  --- Physical volume ---

  PV Name               /dev/hda5

  VG Name               lvm0

  PV Size               19.07 GB / not usable 0   

  Allocatable           yes (but full)

  PE Size (KByte)       4096

  Total PE              4882

  Free PE               0

  Allocated PE          4882

  PV UUID               pLrBnp-GFg5-Vo7r-7f6v-rgei-kFjD-7kYJKI

   

  --- Physical volume ---

  PV Name               /dev/hda6

  VG Name               lvm0

  PV Size               19.07 GB / not usable 0   

  Allocatable           yes 

  PE Size (KByte)       4096

  Total PE              4882

  Free PE               36

  Allocated PE          4846

  PV UUID               ckjttL-JX0i-JDwv-qPXp-Nzhh-2VLp-1Av2qY

   

  --- Physical volume ---

  PV Name               unknown device

  VG Name               lvm0

  PV Size               68.46 GB / not usable 0   

  Allocatable           yes 

  PE Size (KByte)       4096

  Total PE              17527

  Free PE               17527

  Allocated PE          0

  PV UUID               bKQmb3-BPL3-eZd0-qcpZ-1QoP-DHq3-2S6R6R

```

The last uid (bkQ...) is the one that cannot be found. It probably is on the hda7 partition I just added to the lvm0 volume group. Maybe I could just delete it, but I do not want to lose data. In fact, that's what I just did some days ago, I accidentally rm -rf'ed most of my system, and what I am working with now is the backup. 

Sorry if this sounds confused, but I am confused, tired, and hjave no clue what is going on.

Meta question: Is LVM easy? Do I need to know it in detail? I have it running already for half a year on another PC, and had no problems yet. Wiping my disk accidentally gave me the chance to change my main system to LVM. LVM gives much more flexibility, but if something goes wrong, I am in deep trouble.

Thanks for reading,

        WonkoLast edited by weird wonko on Fri Jan 14, 2005 12:17 pm; edited 1 time in total

----------

## nemo_

what does pvdisplay /dev/hda7 say ?

you might want to look at vgcfgrestore, assuming you have a config backup in /etc/lvm (which _should_ be the case).

here's an excerpt from vgcfgrestore's man page :

 *Quote:*   

> REPLACING PHYSICAL VOLUMES
> 
>        vgdisplay --partial --verbose will show you the UUIDs and sizes of any PVs that are no longer present.  If
> 
>        a PV in the VG is lost and you wish to substitute another of the same  size,  use  pvcreate  --restorefile
> ...

 

if your hda7 physical volume is ok I guess you can restore the LVM config by forcing the UUID as stated there but I've never had to do something like that so far ..

----------

## weird wonko

I just fixed the problem. No data was lost, all seems to be fine again. I feel better now  :Very Happy: 

I first backupped the partitions with dd to another drive (after moving around lots of data to create the 2x20 G free space), then I tried some things that were mentioned in other posts here and on usenet, like using vgcfgrestore, without success. (nemo_, I did this last night so I did not try the --partial option you mentioned. But thanks anyway, I think this solution should also have worked.)

I also deleted the additional hda7 to hda10 partitions I had created, so the layout was the same as before. This also didn't help.

Then I had a closer look at the /etc/lvm/backup directory. There is a lvm0 file containing information about this logical volume, with a list of physical volumes. pv0 (hda5) and pv1 (hda6) seemed to be okay, but there was also a pvm2 entry, with the uuid that gave me the trouble. This came from my pvcreate /dev/hda7 and vgextend lvm0 /dev/hda7 commands. Maybe I just forgot to issue vgchange -a n after that? I still don't know. But after commenting out this entry, all was working fine again.

Wonko

----------

