import struct with open('/tmp/fs_meta.img', 'r+b') as f: f.seek(1024) sb = bytearray(f.read(1024)) ro_compat = struct.unpack_from('