MvG*_*MvG 9 parted gpt mbr disk gdisk
我有一个 USB 笔式驱动器,我想把它变成一个可启动的 MBR 设备。但是,在其历史上的某个时刻,该设备上有 GPT,我似乎无法摆脱它。即使我跑mklabel dos
进去parted
,grub-install
仍然抱怨
Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet..
Run Code Online (Sandbox Code Playgroud)
我不想保留任何数据。我只想清除以前 GTP 的所有痕迹,最好使用一些比 add if=/dev/zero of=…
将整个驱动器清零更快的机制。我更喜欢基于终端(命令行或诅咒)的方法,但一些常见且免费的图形工具也可以。
Flo*_*elf 12
如果你不想摆弄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
Run Code Online (Sandbox Code Playgroud)
核实:
$ 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):
Run Code Online (Sandbox Code Playgroud)
如果您想要单个命令,而不是在 gdisk 中导航交互式菜单,请尝试:
$ sudo sgdisk -Z /dev/sdx
Run Code Online (Sandbox Code Playgroud)
将 sdx 替换为相关磁盘的名称。(显然 - 不要擦除系统磁盘上的分区信息;)