moby: Base Device UUID verification failed in case of lvm resize
I’ve done a resizing of lvm partitions on centos 7 minimal install with default settings, with these commands :
umount /home/ lvremove /dev/centos/home lvextend --size +50.00GB -r /dev/mapper/centos-root lsblk sed -i ‘/centos-home/d’ /etc/fstab
and after a reboot, docker fails to start returning this error:
prior storage driver “devicemapper” failed: Base Device UUID verification failed
CLARIFICATION:
Docker data was stored on default installation path ** /var/lib/docker** mounted on ** /dev/mapper/centos-root**. The deleted lvm ** /dev/centos/home** was totally empty.
I think this is because of the new functionality introduced with docker 1.8 : https://github.com/docker/docker/issues/13896
It should be there a way to reinizialize the uuid, because actually i’m with the system totally broken.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 57 (22 by maintainers)
Got my data back by just changing the UUID here:
Getting the same issue after having run out of disk space on a centos VM. Is there a way to recover my docker data?
@gordontyler So here is the summary of what I have tried.
Ok, lets try to do some debugging. First of all make sure you have copied all your data. So that if we lose something in debugging process, you can restore it.
Try following. And see if you can activate thin pool and base thin device and if UUID matches the one stored in docker.
Stop docker
$systemctl stop docker
Run “losetup” and make sure /var/lib/docker/devicemapper/devicemapper/metadata is mapped to /dev/loop0 and /var/lib/docker/devicemapper/devicemapper/data is mapped to /dev/loop1. Otherwise run following.
$ losetup -f data $ losetup -f metadata
Create thin pool.
$ dmsetup create thin-pool --table “0 209715200 thin-pool /dev/loop1 /dev/loop0 128 0”
Make sure pool got created
$ dmsetup table thin-pool
Find the thin id of base device and size of device.
$ cat /var/lib/docker/devicemapper/metadata/base
Look for field “device_id”, that’s the thin device id of base device. Make a note of it. Also not “size”. Say
base_device_id=X base_size=Y
Device base device size by 512 to convert it into sectors.
base_size_sectors=Y/512
Activate base thin device
$ dmsetup create base-thin --table “0 $base_size_sectors thin /dev/mapper/thin-pool $base_device_id”
ex.
$ dmsetup create base-thin --table “0 209715200 thin /dev/mapper/thin-pool 1”
Make sure thin device got activate.
$ dmsetup table base-thin
Run “blkid” and figure out UUID of base device.
$ blkid /dev/mapper/base-thin
Make a note of UUID.
Now open /var/lib/docker/devicemapper/metadata/deviceset-metadata and make sure BaseDeviceUUID stored there matches with UUID noted in previous step.