Skip to content

Base Device UUID verification failed in case of lvm resize #15721

Closed as not planned

Description

@shakisha

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 :
#13896

It should be there a way to reinizialize the uuid, because actually i'm with the system totally broken.

Activity

  1. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    so looks like you have a volume group centos on the system. Looks like you had two logical volumes "home" and "centos-root" in the volume group. Then you decided to remove "home" logical volume and grow "centos-root" logical volume. Is that right.

    So are you using loop devices for docker? And these are in /var/lib/docker?

    If that's the case, I don't think above operation should break docker. Your loop files are on centos-root volume and you have grown that volume that should not touch the loop files and that means pool should remain same and that means UUID of base device should remain same.

    I think there is issue somewhere else. Are you sure /var/lib/docker is on centos-root volume and it was not bind mounted to something on "home" volume?

    Are you able to reproduce this issue?

  2. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    For reproducing the issue:

    1. install centos 7.0 minimal install with default disk settings (on a 120gb ssd)
    2. install docker 1.7
    3. update to docker 1.8
    4. run 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'
    5. reboot the machine.

    this is lvm structure now:

    *df -a *
    ´/dev/mapper/centos-root 99589120 68962196 30626924 70% /´

    i was sure about the location of docker inside /var/lib/docker (the files are still here) and default mountpoint of centos lvm ----> /dev/centos/home is /home
    i still need to make docker operative, actually i'm totally outofservice

    (why markdown isn't working?)

  3. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    You are passing device mapper device to lvextend (/dev/mapper/centos-root). Does it even work? I thought you need to provide path to logical volume. Which probably is centos/centos-root in your case. IOW, command probably needs to be.

    lvextend --size +50G -r centos/centos-root

    I have never tried passing in device mapper devices directly to lvm commands and I would be surprised if that's allowed.

  4. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    And why are you deleting /home. Does the system even boot and work without /home. Why not leave some free space in volume group during installation and use that space to grow root. (instead of deleting /home).

  5. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    the
    ´lvextend --size +50.00GB -r /dev/mapper/centos-root´
    it worked and now i'm still stucked because i can't start docker.
    there isn't a way to initialize docker Base Device UUID to let it work again?

  6. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    I think something has gone wrong with your thin pool and that's why you are getting this error. I doubt overriding this UUID will get you going. But if you want to try anyway, downgrade your docker to older version and see if you can start that.

    Also I tried extending logical volume using device name and it does not work for me.

    [root@vm2-f22 mapper]# lvextend --size +10G -r /dev/mapper/test-vivek-lv
    skip_dev_dir: Couldn't split up device name test-vivek-lv.
    Path required for Logical Volume "test-vivek-lv".
    Please provide a volume group name
    Run `lvextend --help' for more information.

    • Can you provide following information from your system.
    • output of "lvs"
    • output of "vgs"
    • output of "pvs"
    • contents of "/etc/sysconfig/docker-storage" file
  7. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    lvs
    LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert

    root centos -wi-ao---- 95,00g
    swap centos -wi-ao---- 2,00g

    vgs
    VG #PV #LV #SN Attr VSize VFree centos 1 2 0 wz--n- 99,51g 2,51g

    pvs
    PV VG Fmt Attr PSize PFree /dev/sda2 centos lvm2 a-- 99,51g 2,51g

    no docker-storage file found on all the system.

  8. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor
    • ok, can you upload/paste the error logs from docker daemon.
    • paste the output of "mount" command.
    • ls -l /var/lib/docker/devicemapper/devicemapper/
  9. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    i've tried downgrade to docker 1.7.1 from yum, but i was facing the same error (really strange)
    i'm, now recovering the machine image because i forgot to make a snapshot, i will do it inside 20 minutes.

  10. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    docker daemon error
    WARN[0000] please use 'docker daemon' instead. INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) ERRO[0000] [graphdriver] prior storage driver "devicemapper" failed: Base Device UUID verification failed. Possibly using a different thin pool then last invocation:exit status 2 FATA[0000] Error starting daemon: error initializing graphdriver: Base Device UUID verification failed. Possibly using a different thin pool then last invocation:exit status 2

    mount
    proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=933148k,nr_inodes=233287,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,seclabel,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb) configfs on /sys/kernel/config type configfs (rw,relatime) /dev/mapper/centos-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota) selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel) debugfs on /sys/kernel/debug type debugfs (rw,relatime) mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) /dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

    ls -l /var/lib/docker/devicemapper/devicemapper/
    -rw-------. 1 root root 107374182400 19 ago 04.04 data
    -rw-------. 1 root root 2147483648 20 ago 18.26 metadata

  11. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    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.

  12. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    on losetup i have got the values in reverse order:
    schermata 2015-08-20 alle 19 19 07

    the command dmsetup create thin-pool --table "0 209715200 thin-pool /dev/loop1 /dev/loop0 128 0"
    gives me busy resource.

    i have also a snapshot of the machine before the resize, can i give you something about that machine to trace the issue?

  13. shakisha commented on Aug 20, 2015

    @shakisha
    Author

    sorry, taken the snapshot that i was believing before resize, but was already resized and it's working properly, so, the issue maybe some kinda of data corruption.

    How i can debug that? can i pass /var/lib/docker from old machine (not working) to new one?

  14. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    So you have the snapshot after resize and that's working properly with docker? Then we don't have the issue anymore?

  15. rhvgoyal commented on Aug 20, 2015

    @rhvgoyal
    Contributor

    I would recommend that install a machine and do simple resize there and play with it and make sure resize is not breaking docker. I suspect you are doing something wrong in your steps.

  16. 29 remaining items

  17. rhvgoyal commented on Nov 6, 2015

    @rhvgoyal
    Contributor

    @gordontyler So here is the summary of what I have tried.

    • Problem happens due to thin pool being full. Now pool has reached a state where it needs to go through thin_check/thin_repair.
    • For the case of loop devices, I grew the space fs under loop devices, shutdown thin pool, used thin_repair to repair metadata file and replaced old metadata file with new repaired metadata file and restarted docker and that got me going.
    • It is recommended to use lvm thin pool (instead of using thin pool on top of loop devices). In that case you should be simple be able to add more space to volume group backing up lvm thin pool and then I just had to deactivate the lvm thin pool and reactivate it again and it worked for me.
  18. gordontyler commented on Nov 6, 2015

    @gordontyler

    So if Docker is configured to use devicemapper in direct-lvm mode instead of loop-lvm, I should be able to live resize the volume group while Docker is running without error? I'm a little new to this LVM business so I'm a little fuzzy on the details of how it works.

  19. rhvgoyal commented on Nov 6, 2015

    @rhvgoyal
    Contributor

    @gordontyler

    Ideally yes. We have tool called docker-storage-setup which will automatically setup lvm thin pool for you and configure thin pool in such a way that it grows automatically (as long as there is space in volume group).

    If volume group runs out of space, you should be able to add more space and that should make docker going again.

    May be there is a bug in centos7.1 as I had to manually reactivate the thin pool after growing volume group. There have been some fixes in this area so I am hoping when centos 7.2 comes out, one does not have to reactivate thin pool manually and it should continue to work as soon as more space is added to volume group.

  20. gordontyler commented on Nov 6, 2015

    @gordontyler

    Thanks for the info.

  21. astewart-twist commented on Nov 20, 2015

    @astewart-twist

    Getting the same issue after having run out of disk space on a centos VM. Is there a way to recover my docker data?

  22. stefanleh commented on Mar 22, 2016

    @stefanleh

    How can i get back my data? I am using a separate partition for the data /usr/bin/docker daemon -g /docker -H tcp://0.0.0.0:4243 -H fd:// and removed the /var/lib/docker directory and restarted the service, but its still complaining about different UUIDs.

    Mar 22 09:48:22 docker-host-fkb systemd[1]: Starting Docker Application Container Engine...
    Mar 22 09:48:22 docker-host-fkb docker[11598]: time="2016-03-22T09:48:22.639475009+01:00" level=warning msg="/!\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\"
    Mar 22 09:48:22 docker-host-fkb docker[11598]: time="2016-03-22T09:48:22.703095064+01:00" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
    Mar 22 09:48:22 docker-host-fkb docker[11598]: time="2016-03-22T09:48:22.742168506+01:00" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: devmapper: Base Device UUID and Filesystem verification failed.devmapper: Current Base Device UUID:13fb87a8-4c80-4fe3-95dc-96b1af83acf8 does not match with stored UUID:aae8eb6b-2998-4018-9531-bbbdc12d46b8. Possibly using a different thin pool than last invocation"
    Mar 22 09:48:22 docker-host-fkb docker[11598]: time="2016-03-22T09:48:22.742275420+01:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed.devmapper: Current Base Device UUID:13fb87a8-4c80-4fe3-95dc-96b1af83acf8 does not match with stored UUID:aae8eb6b-2998-4018-9531-bbbdc12d46b8. Possibly using a different thin pool than last invocation"
    Mar 22 09:48:22 docker-host-fkb systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    Mar 22 09:48:22 docker-host-fkb systemd[1]: Failed to start Docker Application Container Engine.
    Mar 22 09:48:22 docker-host-fkb systemd[1]: Unit docker.service entered failed state.
    Mar 22 09:48:22 docker-host-fkb systemd[1]: docker.service failed.
    
  23. stefanleh commented on Mar 22, 2016

    @stefanleh

    Got my data back by just changing the UUID here:

    [root@docker-host-fkb docker]# grep "aae8eb6b-2998-4018-9531-bbbdc12d46b8" * -R
    devicemapper/metadata/deviceset-metadata:{"next_device_id":1,"BaseDeviceUUID":"aae8eb6b-2998-4018-9531-bbbdc12d46b8","BaseDeviceFilesystem":"xfs"}
    
  24. cornfeedhobo commented on Apr 6, 2016

    @cornfeedhobo

    I am experiencing this issue in a CentOS 7 image running 1.10 off the official repos. Using the docker-storage-setup project to manage the lvm volume and everything breaks when resizing.

  25. rhvgoyal commented on Apr 7, 2016

    @rhvgoyal
    Contributor

    @cornfeedhobo Which centos 7 image you are using. Can you give me a pointer. Also give me detailed steps of reproducing this problem. I want to see what's happening.

  26. LubosD commented on May 30, 2016

    @LubosD

    I've run into the same issue after the filesystem ran out of disk space on a LVM volume and BEFORE I resized the the volume. Running blkid on the target DM device works just fine.

    To me it seems that running out of space corrupts Docker's structures and then it cannot recover 👎 I don't think that resizing has anything to do with it.

  27. cornfeedhobo commented on May 30, 2016

    @cornfeedhobo

    @rhvgoyal I'll try and make a packer template to describe the issue soon.

  28. ethirolle commented on Jun 17, 2016

    @ethirolle

    @rhvgoyal

    Thanks for your very helpful info on this issue. You stated above: "For the case of loop devices, I grew the space fs under loop devices, shutdown thin pool, used thin_repair to repair metadata file and replaced old metadata file with new repaired metadata file and restarted docker and that got me going."

    I think I have the exact same situation you had (loopback thin pool, same I/O errors in kernel log, thin pool put in "ro" mode). But I cannot figure out how to do some of the steps you listed above. Every time I try to do thin_repair on my metedata file, I get

    # thin_repair -i metadata -o metadata-fix
    Couldn't stat dev path
    

    This happens even if I first do dmsetup remove to remove the devicemapper for this thin pool.

    Would you mind providing more detail on how you:

    • grew the space fs under loop devices
    • shutdown thin pool
    • used thin_repair to repair metadata file
  29. Ryuzavi commented on Aug 10, 2016

    @Ryuzavi

    I also had this issue yesterday and it was a complete blocker:

    docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Tue 2016-08-09 10:30:44 BST; 23min ago
         Docs: https://docs.docker.com
      Process: 2610 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)
     Main PID: 2610 (code=exited, status=1/FAILURE)
    
    Aug 09 10:30:43 docker01 systemd[1]: Starting Docker Application Container Engine...
    Aug 09 10:30:43 docker01 dockerd[2610]: time="2016-08-09T10:30:43.734710210+01:00" level=info msg="libcontainerd: new containerd process, pid: 2616"
    Aug 09 10:30:44 docker01 dockerd[2610]: time="2016-08-09T10:30:44.767439991+01:00" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
    Aug 09 10:30:44 docker01 dockerd[2610]: time="2016-08-09T10:30:44.822069024+01:00" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: devmapper: Base Device UUID and Filesystem verification failed: devmapper: Failed to find uuid for device /dev/mapper/docker-253:0-525713-base:exit status 2"
    Aug 09 10:30:44 docker01 dockerd[2610]: time="2016-08-09T10:30:44.822285680+01:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed: devmapper: Failed to find uuid for device /dev/mapper/docker-253:0-525713-base:exit status 2"
    Aug 09 10:30:44 docker01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    Aug 09 10:30:44 docker01 systemd[1]: Failed to start Docker Application Container Engine.
    Aug 09 10:30:44 docker01 systemd[1]: Unit docker.service entered failed state.
    Aug 09 10:30:44 docker01 systemd[1]: docker.service failed.
    

    Found quite a few threads like this one that suggested it was indeed due to the resize in centos (which I did do a while back) or that the devicemapper "partition" had hit it's own internal size limit and become corrupted.

    Sadly there was no clear solution from what I could see. This become irrelevant though as it also became quickly clear that devicemapper is not liked or preferred at all in the community:

    Friends Don't Let Friends Run Docker on Loopback in Production
    Docker Storage Driver: Don't Use Devicemapper
    What Discourse (docker forum software) had to say about Devicemapper when asked
    Discourse Reply

    Indeed the default loopback storage that docker pick out of the box is utterly unrecommened even by themselves for production. You get this in docker info:

    WARNING: Usage of loopback devices is strongly discouraged for production use. Use --storage-opt dm.thinpooldev to specify a custom block storage device

    So we switched to overlay2, keeping an eye on it and backing up everything. Thankfully we had the foresight to either backup everything or have stuff on external volumes. But there was a risk of total data loss here. I think Docker should be more clear about data storage drivers, maybe not support loopback at all as well as the early convenience leads to problems later on.

    Anyhoo, hope this helps folks.

  30. thaJeztah commented on Jun 6, 2023

    @thaJeztah
    Member

    The devicemapper storage-driver was deprecated, and has been removed, so closing issues related to this storage-driver. See;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions