![删除所有 GPT 磁盘标签痕迹](https://linux22.com/image/64793/%E5%88%A0%E9%99%A4%E6%89%80%E6%9C%89%20GPT%20%E7%A3%81%E7%9B%98%E6%A0%87%E7%AD%BE%E7%97%95%E8%BF%B9.png)
我有一个 USB 笔式驱动器,我想将其变成可启动的 MBR 设备。然而,在其历史上的某个时刻,该设备上有 GPT,我似乎无法摆脱它。即使我跑mklabel dos
进去parted
后grub-install
仍然抱怨
Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet..
我不想保留任何数据。我只想清除以前 GTP 的所有痕迹,最好使用某种比将dd if=/dev/zero of=…
整个驱动器归零更快的机制。我更喜欢基于终端(命令行或诅咒)的方法,但一些常见的免费图形工具也可以。
答案1
如果你不想摆弄dd
,gdisk
可以这样做:
$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): ?
b back up GPT data to a file
<snip>
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Command (? for help): x
Expert command (? for help): ?
a set attributes
<snip>
w write table to disk and exit
z zap (destroy) GPT data structures and exit
? print this menu
Expert command (? for help): z
About to wipe out GPT on /dev/sdb. Proceed? (Y/N): Y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): Y
核实:
$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
Command (? for help):
答案2
你可以这样做wipefs
:
擦拭布可以从指定设备中删除文件系统、raid 或分区表签名(魔术字符串),以使签名对 libblkid 不可见。 wipefs 不会擦除文件系统本身或设备中的任何其他数据。
答案3
如果您想要单个命令,而不是在 gdisk 中导航交互式菜单,请尝试:
$ sudo sgdisk -Z /dev/sdx
将 sdx 替换为相关磁盘的名称。 (显然 - 不要擦除系统磁盘上的分区信息;)