我有一个非启动 HFS+ 分区。在 Windows diskmgmt.msc 中更改驱动器号后,我无法再在 OS X 中看到该驱动器。我可以在 Windows 中看到该驱动器及其内容。显然这是由于 Windows 覆盖了磁盘的 GUID 并将分区的名称从 HFS+ 更改为 FAT。
我甚至找到了一个链接到解决方案的帖子,但目标已经失效了。我查看了互联网档案。我搜索了“苹果讨论档案”。我尝试搜索链接。我尝试使用新的链接格式。
以下是主题:
https://discussions.apple.com/thread/2471125
以下是该帖子的无效链接:
http://discussions.apple.com/thread.jspa?messageID=11227763剳
截至昨晚,系统中的任何磁盘均未出现 SMART 错误。我将尝试在 Windows 中复制数据,但我更希望从 OS X 访问,因为有时由于符号链接和某些字符,将文件从 HFS+ 复制到 NTFS 时会出现错误。通常我会在 OS X 端制作一个 tarball,然后在 Windows 中解压。
那么,我该如何修复 GUID 以使该分区显示出来呢?当然,前提是这确实可以修复。
计算机中的驱动器和分区如下:
Bay 1: Win Boot - 1TB NTFS SSD (bootable)
Bay 2: Win Data - 1TB NTFS SSD
Bay 3: Mac Data 1 - 3TB HFS+ HDD RAID 1 (1TB unused)
Bay 4: 6TB HDD
Mac Boot Backup - 1TB HFS+ (bootable)
Mac Data Backup - 3TB HFS+
Win Boot Backup - 1TB NTFS (not bootable as of yet)
Win Data Backup - 1TB NTFS
Bay 5: Mac Data 2 - 3TB HFS+ HDD RAID 1 (1TB unused)
Bay 6: Mac Boot - 1TB HFS+ SSD (bootable)
问题出在 4 号盘的 Mac 数据备份分区上。目前,此磁盘只能通过 Mac 启动备份分区启动 OS X。通常,我从 Win 启动磁盘启动 Windows,从 Mac 启动磁盘启动 OS X。
Mac Pro 1,1(2006 年),Windows 7 Bootcamp,OS X 10.6。它无法启动 UEFI,只能启动 EFI。
$ diskutil repairvolume /dev/disk3s3
Started filesystem repair on disk3s3
** /dev/disk3s3
Invalid BS_jmpBoot in boot block: 000000
Volume repair complete
Updating boot support partitions for the volume as required
Error: -9957: Filesystem verify or repair failed
Underlying error: 8: POSIX reports: Exec format error
$ sudo fsck -fy /dev/rdisk3s3
** /dev/rdisk3s3
BAD SUPER BLOCK: MAGIC NUMBER WRONG
LOOK FOR ALTERNATE SUPERBLOCKS? yes
SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).
$ sudo fsck_hfs -fy /dev/rdisk3s3
** /dev/rdisk3s3
Executing fsck_hfs (version diskdev_cmds-491.6~3).
** Checking Journaled HFS Plus volume.
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume Mac Data Backup appears to be OK.
$ diskutil list disk3
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *6.0 TB disk3
1: EFI 209.7 MB disk3s1
2: Apple_HFS Mac Boot Backup 1000.0 GB disk3s2
3: Microsoft Basic Data 3.0 TB disk3s3
4: Microsoft Basic Data Win Boot Backup 1.0 TB disk3s4
5: Microsoft Basic Data Win Data Backup 1.0 TB disk3s5
$ sudo gdisk -l /dev/rdisk3
GPT fdisk (gdisk) version 0.8.10
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/rdisk3: 11721045168 sectors, 5.5 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): B006753D-13AC-4C49-88E1-F6C7E50FE896
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 11721045134
Partitions will be aligned on 8-sector boundaries
Total free space is 525717 sectors (256.7 MiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 1953534639 931.3 GiB AF00 Mac Boot Backup
3 1953796784 7807788799 2.7 TiB 0700 Win Data Backup
4 7808051200 9764546559 932.9 GiB 0700 Untitled
5 9764546560 11721043967 932.9 GiB 0700 Untitled
gdisk 错误地将分区 3 称为 Win Data Backup。分区 3 的正确名称是 Mac Data Backup。Win Data Backup 是分区 5 的名称。Win Data Backup 在上面的 diskutil 中显示正确。
答案1
我只需要使用 gdisk 将分区的 GUID 类型代码从 0700 更改为 AF00。最新版本的无段错误版本是 1.0.4。看起来 gdisk 还可以修复驱动器名称问题,例如将 Win Data Backup 更正为 Mac Data Backup。
# gdisk /dev/disk2
GPT fdisk (gdisk) version 1.0.4
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
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/disk2: 11721045168 sectors, 5.5 TiB
Sector size (logical): 512 bytes
Disk identifier (GUID): B006753D-13AC-4C49-88E1-F6C7E50FE896
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 11721045134
Partitions will be aligned on 8-sector boundaries
Total free space is 525717 sectors (256.7 MiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 1953534639 931.3 GiB AF00 Mac Boot Backup
3 1953796784 7807788799 2.7 TiB 0700 Win Data Backup
4 7808051200 9764546559 932.9 GiB 0700 Untitled
5 9764546560 11721043967 932.9 GiB 0700 Untitled
Command (? for help): t
Partition number (1-5): 3
Current type is 'Microsoft basic data'
Hex code or GUID (L to show codes, Enter = AF00):
Changed type of partition to 'Apple HFS/HFS+'
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk2.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.