---sgdisk 分区表

https://www.cnblogs.com/mountain2011/p/9622001.html

sgisk  gpt分区表整定工具,  gpt patmanipulator

写一下我关注的使用项目:
a) 分区表的备份和恢复
1. sgdisk --backup=/root/sdb.partitiontable /dev/sdb
2. 如果发生故障,可以使用sgdisk命令的--load-backup选项还原分区表

https://askubuntu.com/questions/211477/how-to-remove-gpt-from-hdd

def clear_gpt(target):

'''
According to http://en.wikipedia.org/wiki/GUID_Partition_Table - GPT
stores partition data in the first and last 34 LBA blocks. A LBA sector
is normally 512 bytes.
'''
fd = open(target, "w+")
fd.seek(0)
fd.write('\0' * 34 * 512)
print "done nuking data at the beginning of disk", target
fd.seek(0, 2) # SEEK_END is 2
disk_size = fd.tell()
fd.seek(disk_size - 34*512)
fd.write('\0' * 34 * 512)
print "done nuking data at the end of disk", target

 

转载于:https://www.cnblogs.com/bzhao/p/10959400.html

你可能感兴趣的:(---sgdisk 分区表)