@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

HDDをAPFSにフォーマットしたらMac OS拡張(Apple HFS)に戻せなくなって焦った

APFSはコンテナ管理のようなことをしているようで、コンテナ情報があるとAPFSから変更できない様子。 コンテナ(ボリューム)を消すとMac OS拡張に戻せる。

外部ディスクをAPFSにフォーマットするとTimeMachineでは利用できないとのことで戻そうとして戻せず焦った。

f:id:peccu:20171221100326p:plain

f:id:peccu:20171221100338p:plain

コマンドで解決

コマンドで解決するならこの記事を参考に diskutil コマンドを使う www.techrepublic.com

% diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         121.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +121.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            115.9 GB   disk1s1
   2:                APFS Volume Preboot                 19.3 MB    disk1s2
   3:                APFS Volume Recovery                506.6 MB   disk1s3
   4:                APFS Volume VM                      3.2 GB     disk1s4

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk3
   1:                        EFI EFI                     209.7 MB   disk3s1
   2:                 Apple_APFS Container disk4         119.8 GB   disk3s2

/dev/disk4 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +119.8 GB   disk4
                                 Physical Store disk3s2
   1:                APFS Volume BackUp                  950.3 KB   disk4s1

Apple_APFS Container disk4 119.8 GB disk3s2 が消したいディスク(/dev/disk3)のコンテナなので、コンテナを消す。

% diskutil apfs deleteContainer /dev/disk3s2
Started APFS operation on disk3s2
Deleting APFS Container with all of its APFS Volumes
Assuming that the APFS Container is damaged; any additional Physical Store disks which define the Container might not be found for reformatting and might need to be handled separately
Deleting Container
Switching content types
Reformatting former APFS disk
Initialized /dev/rdisk3s2 as a 111 GB case-insensitive HFS Plus volume with a 16384k journal
Mounting disk
Finished APFS operation on disk3s2

確認すると Apple_HFS に戻っている。

% diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         121.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +121.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            115.7 GB   disk1s1
   2:                APFS Volume Preboot                 19.3 MB    disk1s2
   3:                APFS Volume Recovery                506.6 MB   disk1s3
   4:                APFS Volume VM                      3.2 GB     disk1s4

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk3
   1:                        EFI EFI                     209.7 MB   disk3s1
   2:                  Apple_HFS Untitled                119.7 GB   disk3s2

%

Disk Utility.appで解決

編集メニューからAPFSボリュームを削除できる。

ツールバーの表示メニューから、全てのデバイスを表示すれば、物理ディスクも表示されるので、そこから消去ボタンを使ってもMac OS拡張を選ぶこともできる。