def METHOD_NAME(self, target, quote_partition_name):
    """Write the partition table to disk"""
    # generate the command for sfdisk to create the table
    command = [
        "sgdisk",
        "-Z",  # erase the partition table
        target,
        "-g",  # needed for older sgdisk
    ]
    if self.uuid:
        command += ["-U", self.uuid]
    for i, part in enumerate(self.partitions):
        idx = i + 1  # partitions are 1-indexed
        # format is 'partnum:start:end'
        size = "0"
        if part.size:
            size_bytes = part.size
            size = f"+{size_bytes}"
        cmd = [
            "-n", f"{idx}:{part.start}:{size}"
        ]
        if part.name:
            part_name = f'"{part.name}"' if quote_partition_name else part.name
            cmd += [
                "-c", f"{idx}:{part_name}"
            ]
        if part.uuid:
            cmd += [
                "-u", f"{idx}:{part.uuid}"
            ]
        if part.type:
            cmd += [
                "-t", f"{idx}:{part.type}"
            ]
        if part.attrs:
            for attr in sorted(part.attrs):
                cmd += [
                    "-A", f"{idx}:set:{attr}"
                ]
        command += cmd
    subprocess.run(command,
                   encoding='utf8',
                   check=True)