44
44
:param block_device: str: Full path of block device to clean.
46
47
# sometimes sgdisk exits non-zero; this is OK, dd will clean up
47
call(['sgdisk', '--zap-all', '--mbrtogpt',
48
call(['sgdisk', '--zap-all', '--', block_device])
49
call(['sgdisk', '--clear', '--mbrtogpt', '--', block_device])
49
50
dev_end = check_output(['blockdev', '--getsz',
50
51
block_device]).decode('UTF-8')
51
52
gpt_end = int(dev_end.split()[0]) - 100