def LinGetRawDevice(path):
 device_map = GetMountpoints()
 path = utils.SmartUnicode(path)
 mount_point = path = utils.NormalizePath(path, '/')
 result = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.OS)
 while mount_point:
  try:
   (result.path, fs_type) = device_map[mount_point]
   if (fs_type in ['ext2', 'ext3', 'ext4', 'vfat', 'ntfs']):
    result.pathtype = rdf_paths.PathSpec.PathType.OS
   else:
    result.pathtype = rdf_paths.PathSpec.PathType.UNSET
   path = utils.NormalizePath(path[len(mount_point):])
   result.mount_point = mount_point
   return (result, path)
  except KeyError:
   mount_point = os.path.dirname(mount_point)

def LinGetRawDevice ( path ) : device_map = GetMountpoints ( ) path = utils . SmartUnicode ( path ) mount_point = path = utils . NormalizePath ( path , '/' ) result = rdf_paths . PathSpec ( pathtype = rdf_paths . PathSpec . PathType . OS ) while mount_point : try : ( result . path , fs_type ) = device_map [ mount_point ] if ( fs_type in [ 'ext2' , 'ext3' , 'ext4' , 'vfat' , 'ntfs' ] ) : result . pathtype = rdf_paths . PathSpec . PathType . OS else : result . pathtype = rdf_paths . PathSpec . PathType . UNSET path = utils . NormalizePath ( path [ len ( mount_point ) : ] ) result . mount_point = mount_point return ( result , path ) except KeyError : mount_point = os . path . dirname ( mount_point )
resolve the raw device that contains the path .