Removing orphaned snapshot devices

Use this procedure to identify orphaned snapshot devices in the LVM thin pool for application data, and to remove them.
  1. Log in to the master host as root, or as a user with superuser privileges.
  2. Identify the location of tenant volumes.
    grep -E '^\b*SERVICED_VOLUMES_PATH' /etc/default/serviced
    • If the command returns a result, the location of tenant volumes is the value of the SERVICED_VOLUMES_PATH variable.
    • If the command does not return a result, the location of tenant volumes is the default value of SERVICED_VOLUMES_PATH, /opt/serviced/var/volumes.
  3. Identify the device of the serviced thin pool belongs.
    ls /dev/mapper | grep serviced
    Example result:
    serviced-serviced--pool
    serviced-serviced--pool_tdata
    serviced-serviced--pool_tmeta

    The first result is the thin pool device. The other results represent the data and metadata portions of the device.

  4. Check for orphaned snapshot devices.
    Replace Thin-Pool-Device with the name of the thin pool device from the previous step, and replace Volumes-Path with the location of tenant volumes:
    serviced-storage -o dm.thinpooldev=/dev/mapper/Thin-Pool-Device \
      check Volumes-Path
    • If the result is No orphaned devices found, stop. There are no orphaned snapshot devices to remove.
    • If the result is Orphaned devices were found, perform the next step.
  5. Remove orphaned snapshot devices.
    Replace Thin-Pool-Device with the name of the thin pool device from the previous step, and replace Volumes-Path with the location of tenant volumes:
    serviced-storage -o dm.thinpooldev=/dev/mapper/Thin-Pool-Device \
      check -c Volumes-Path