如何将 HDD 从 GPT 分区转换为无分区并保持 BTRFS 文件系统完好无损?

如何将 HDD 从 GPT 分区转换为无分区并保持 BTRFS 文件系统完好无损?

我有一块 8TB 的 Seagate Archive HDD,使用 GPT 分区:BTRFS 文件系统(约 1TB),其余部分现在都空闲了。我想将此 HDD 转换为无分区(让 BTRFS 管理整个驱动器),同时保持 BTRFS 文件系统数据完好无损。这可能吗?

Ubuntu Server 14.04(Btrfs v3.12,Linux 版本 3.19.0-64-generic)

注意:这不是启动盘,仅用于存储

答案1

我没有使用过 Btrfs(对 ZFS 更有经验),但要注意分区,首先想到的实用程序是 gdisk(8)。

GPT fdisk 文本模式分区工具

一份大纲:

$ sudo gdisk
GPT fdisk (gdisk) version 1.0.1

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 51A560B1-D116-479F-A8A2-2A8F86C89931
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3437 sectors (1.7 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  EFI System Partition
   2         1050624         2050047   488.0 MiB   8300  
   3         2050048      1953523711   930.5 GiB   8300  

Command (? for help): r

Recovery/transformation command (? for help): ?
b       use backup GPT header (rebuilding main)
c       load backup partition table from disk (rebuilding main)
d       use main GPT header (rebuilding backup)
e       load main partition table from disk (rebuilding backup)
f       load MBR and build fresh GPT from it
g       convert GPT into MBR and exit
h       make hybrid MBR
i       show detailed information on a partition
l       load partition data from a backup file
m       return to main menu
o       print protective MBR data
p       print the partition table
q       quit without saving changes
t       transform BSD disklabel partition
v       verify disk
w       write table to disk and exit
x       extra functionality (experts only)
?       print this menu

Recovery/transformation command (? for help): m

Command (? for help): x

Expert command (? for help): ?
a       set attributes
c       change partition GUID
d       display the sector alignment value
e       relocate backup data structures to the end of the disk
g       change disk GUID
h       recompute CHS values in protective/hybrid MBR
i       show detailed information on a partition
l       set the sector alignment value
m       return to main menu
n       create a new protective MBR
o       print protective MBR data
p       print the partition table
q       quit without saving changes
r       recovery and transformation options (experts only)
s       resize partition table
t       transpose two partition table entries
u       replicate partition table on new device
v       verify disk
w       write table to disk and exit
z       zap (destroy) GPT data structures and exit
?       print this menu

Expert command (? for help): q
$ uname -a
Linux momh167-gjp4-kubuntu-hpelitebook850g2 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ 

(可以zap(销毁)GPT 数据结构并退出是否构成解决方案的一部分?

相关内容