Skip to content

Instantly share code, notes, and snippets.

@chiehwen
Last active September 7, 2016 09:12
Show Gist options
  • Select an option

  • Save chiehwen/6be96eccdf3635d97fea to your computer and use it in GitHub Desktop.

Select an option

Save chiehwen/6be96eccdf3635d97fea to your computer and use it in GitHub Desktop.

使用 diskutil 工具來查看 Mac 系統下的硬碟使用狀況

% diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            999.7 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *7.7 GB     disk2
   1:                 DOS_FAT_32 UNTITLED                7.7 GB     disk2s1

權限不夠,dd 需使用 root 權限,在前面加上 sudo 即可

% dd if=debian-7.2.0-amd64-CD-1.iso of=/dev/disk2 bs=2M
dd: failed to open ‘/dev/disk2’: Permission denied

% sudo dd if=debian-7.2.0-amd64-CD-1.iso of=/dev/disk2 bs=2M

資源忙碌,這是表示你沒有事先卸載隨身碟

建議使用 diskutil unmountDisk 卸載隨身碟,而不是在 Finder 上移除隨身碟。

% sudo dd if=debian-7.2.0-amd64-CD-1.iso of=/dev/disk2 bs=2M
dd: failed to open ‘/dev/disk2’: Resource busy

% diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful

使用 diskutil 卸載隨身碟時,不需使用 sudo 來卸載

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment