我从以下位置获取磁盘的UUID和标签 diskutil info disk0s4
diskutil info disk0s4
Device Identifier: disk0s4
Device Node: /dev/disk0s4
Whole: No
Part of Whole: disk0
Device / Media Name: Untitled
Volume Name: Data
Mounted: No
File System Personality: HFS+
Type (Bundle): hfs
Name (User Visible): Mac OS Extended
Journal: Unknown (not mounted)
Owners: Disabled
Partition Type: Apple_HFS
OS Can Be Installed: No
Media Type: Generic
Protocol: PCI
SMART Status: Verified
Volume UUID: F8C88B2D-5412-343B-8969-254F3AC559B8
Disk / Partition UUID: 1738336E-68DD-46B1-997E-57469CF0472D
Total Size: 338.0 GB (337984569344 Bytes) (exactly 660126112 512-Byte-Units)
Volume Free Space: 0 B (0 Bytes) (exactly 0 512-Byte-Units)
Device Block Size: 512 Bytes
Read-Only Media: No
Read-Only Volume: Not applicable (not mounted)
Device Location: Internal
Removable Media: No
Solid State: Yes
mount
使用卷标不起作用:
$ sudo mount -t hfs LABEL=Data /Users/user/test
GetMasterBlock: Error 2 opening LABEL=Data
GetMasterBlock: Error 2 opening LABEL=Data
mount_hfs: error on mount(): error = -1.
mount_hfs: No such file or directory
mount
使用卷UUID不能使用带引号或不带引号:
$ sudo mount -t hfs uuid=F8C88B2D-5412-343B-8969-254F3AC559B8 /Users/user/test
GetMasterBlock: Error 2 opening uuid=F8C88B2D-5412-343B-8969-254F3AC559B8
GetMasterBlock: Error 2 opening uuid=F8C88B2D-5412-343B-8969-254F3AC559B8
mount_hfs: error on mount(): error = -1.
mount_hfs: No such file or directory
$ sudo mount -t hfs UUID="F8C88B2D-5412-343B-8969-254F3AC559B8" /Users/user/test
GetMasterBlock: Error 2 opening UUID=F8C88B2D-5412-343B-8969-254F3AC559B8
GetMasterBlock: Error 2 opening UUID=F8C88B2D-5412-343B-8969-254F3AC559B8
mount_hfs: error on mount(): error = -1.
mount_hfs: No such file or directory
mount
使用卷标识符有效
mymac:~ user$ sudo mount -t hfs /dev/disk0s4 /Users/user/test
更新:
我的目标是mount
在/etc/fstab
要将卷挂载到自定义挂载点时插入该行。
fstab
:UUID=<volume_uuid> /mount/point auto
,然后运行sudo mount -a
。发生了相同的错误:... mount_hfs: No such file or directory
fstab
,但是我总是至少使用前四个字段。在您的评论中,我看到您缺少第三个字段(fs_vfstype)。您是否将其省略fstab
?您应该编辑问题,并确切显示您尝试过的内容fstab
以及使用的编辑器。这就是说,没有我的挂载点其他的,则默认/ Volumes
为其none
设定。一旦看到您的编辑和尝试的挂载点,我将进行测试。
mount
命令不能使用UUID
或LABEL
必须使用磁盘标识符,例如/dev/disk0s4
。另外,也许maybeharry指出要使用OS X方法diskutil
。要解决您的更新...但是fstab
可以使用UUID
orLABEL
,只需看手册页中的示例fstab
。在终端类型中fstab
,然后右键单击fstab
并选择打开手册页,然后完整阅读它!:)