def METHOD_NAME(fname: str) -> Tuple[Optional[str], str]:
    """
    What this function attempts to do is take a file and return:
        - the device the file is on
        - the path of the file relative to the device.
    For example:
         /boot/vmlinuz -> (/dev/sda3, /vmlinuz)
         /boot/efi/efi/redhat/elilo.conf -> (/dev/cciss0, /elilo.conf)
         /etc/fstab -> (/dev/sda4, /etc/fstab)
    :param fname: The filename to split up.
    :return: A tuple containing the device and relative filename.
    """
    # resolve any symlinks
    fname = os.path.realpath(fname)
    # convert mtab to a dict
    mtab_dict: Dict[str, str] = {}
    try:
        for ent in get_mtab():
            mtab_dict[ent.mnt_dir] = ent.mnt_fsname  # type: ignore
    except Exception:
        pass
    # find a best match
    fdir = os.path.dirname(fname)
    match = fdir in mtab_dict
    chrootfs = False
    while not match:
        if fdir == os.path.sep:
            chrootfs = True
            break
        fdir = os.path.realpath(os.path.join(fdir, os.path.pardir))
        match = fdir in mtab_dict
    # construct file path relative to device
    if fdir != os.path.sep:
        fname = fname[len(fdir) :]
    if chrootfs:
        return ":", fname
    return mtab_dict[fdir], fname