StackExchange (Apple): Rebuild partition table on external HDD - not writable
StackExchange (Apple): Partition map rebuild
diskutil unmountDisk /dev/disk2
- Remove the EFI partition:
gpt remove -i 1 /dev/disk2
- Destroy and recreate an empt partition table:
sudo gpt destroy /dev/disk2
sudo gpt create /dev/disk2
- Re-add the EFI partition:
gpt add -b 40 -i 1 -s 409600 -t
- Show the partition table info:
- Including starting blocks:
gpt -r show /dev/diskdisk2
diskutil list disk2
- Including starting blocks:
- Add a new partition:
gpt add -b <StartBlock> -i <IndexNumber> -s <SizeOfVolume> -t hfs disk2
- For example:
gpt add -b 409640 -i 2 -s 1465105374 -t hfs disk2
- Change the FS type of the new partition to case-sensitive and set the label:
newfs_hfs -s -v BackupHome /dev/disk2s3