Comment 5 for bug 1896638

Revision history for this message
Francis Ginther (fginther) wrote :

I've updated the find_device_for_file() function in /usr/bin/hibinit-agent to:

def find_device_for_file(filename):
    # Find the mount point for the swap file ('df -P /swap')
    df_out = check_output(['df', '-P', filename]).decode('ascii')
    dev_str = df_out.split("\n")[1].split()[0]
    lsblk_out = check_output(['lsblk', '-dno', 'PARTUUID', dev_str]).decode('ascii')
    uuid_str = lsblk_out.strip()
    return "PARTUUID=%s" % (uuid_str)

I've tested this on xenial and bionic. With xenial, I would see 2-3% failures on certain instance types due to this issue. Now I see none.