mercergeoinfo
mercergeoinfo

Reputation: 409

Not getting UUID from diskutil on OSX

Running Mac OSX 10.7.5 I want to enable NTFS on a USB3 external hard disk and need the UUID to do it (http://ntfsonmac.com) but diskutil is refusing to give me the UUID. I start with:

diskutil info /Volumes/HD-PCTU3/

then from this:

diskutil info disk2s1
   Device Identifier:        disk2s1
   Device Node:              /dev/disk2s1
   Part of Whole:            disk2
   Device / Media Name:      Untitled 1

   Volume Name:              HD-PCTU3
   Escaped with Unicode:     HD-PCTU3

   Mounted:                  Yes
   Mount Point:              /Volumes/HD-PCTU3
   Escaped with Unicode:     /Volumes/HD-PCTU3

   File System Personality:  NTFS
   Type (Bundle):            ntfs
   Name (User Visible):      Windows NT File System (NTFS)

   Partition Type:           Windows_NTFS
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported

   Total Size:               500.1 GB (500107804672 Bytes) (exactly 976773056 512-Byte-Blocks)
   Volume Free Space:        499.9 GB (499896778752 Bytes) (exactly 976360896 512-Byte-Blocks)
   Device Block Size:        512 Bytes

   Read-Only Media:          No
   Read-Only Volume:         Yes
   Ejectable:                Yes

   Whole:                    No
   Internal:                 No

but as can be seen there is no UUID displayed. Any ideas why and/or how to get the UUID?

Upvotes: 14

Views: 35981

Answers (2)

Zimba
Zimba

Reputation: 3683

I'm on Mac OS X 10.6.8 and bought NTFS 4TB Seagate USB3.0 drive. Plugged in, Mac allowed me to read files from it, but not write to it. When I select 'Get Info' for the volume/disk, I see 'You can read only' under 'Sharing & Permissions'.
I copied a large file from Windows 10 to the USB Drive, worked fine. I then downloaded the file to Mac, worked fine, but won't allow me to write anything from Mac to the USB drive, or make any changes to it eg. delete or rename files on the USB drive. My reason for getting this USB drive formatted in NTFS was to copy files from Mac larger than 4GB to Windows for redundant backup, because of 4GB limit in FAT.

One solution I found online was to sudo echo UUID to /etc/fstab When I diskutil info, I don't get UUID. I also see the following extracts:

File System Personality: NTFS Type (Bundle): ntfs Name (User Visible): Windows NT File System (NTFS)

&

Read-Only Media: No Read-Only Volume: Yes Ejectable: Yes

My solution was to download Samsung NTFS for Mac Driver from: https://www.seagate.com/au/en/support/downloads/item/samsung-ntfs-driver-master-dl/

After installation & reboot, I noticed the following changes:

  1. When I select 'Get Info' for the volume/disk, I see 'You can read and write' under 'Sharing & Permissions'.

2. File System Personality: UFSD_NTFS Type (Bundle): ufsd_NTFS Name (User Visible): Windows NT Filesystem

3. Read-Only Media: No Read-Only Volume: No Ejectable: Yes

The readme file (pdf) that comes with the download says NTFS features also work in Mac for the USB drive. Now I can read/write to the disk, and is also visible in Finder. I've tested read & write speeds with a 2GB file, and don't see any difference in performance/speed between the NTFS & HFS+ Journaled volumes.

Finally after 2 days of reading about sudo, hfs.util & diskutil, I can now get back to backing up data from Mac 10.6 to USB NTFS drive.

Upvotes: 0

Anthony Michael Cook
Anthony Michael Cook

Reputation: 1085

The only way I've been able to find involves a somewhat poorly documented feature of the hfs.util.

Run the diskutil command and then copy/remember/save the Device Identifier:

diskutil info /Volumes/my_drive_label | grep "Device Identifier" 

You can use the hfs.util with the Device Identifier (replacing disk2s1 below) from diskutil to (re)generate a UUID for your volume:

/System/Library/Filesystems/hfs.fs/hfs.util -s disk2s1

Keep in mind this won't work for every volume, if the volume is not an HFS drive than it may not work, and other Filesystem/*.fs/*.util commands may not have a -s verb to generate UUIDs.

UPDATE

In Yosemite and after the -s flag has been disabled at the source level. I haven't been able to find a pre-modified version of hfs.util, but you can do it yourself using the information found in this Superuser question, summarized here:

  1. Download the hfs.util source from Apple and extract it to a temporary folder
  2. Download hfs_fsctl.h from Apple and put it in the hfs.util folder
  3. Change line 47 of hfsutil_jnl.c into #include <hfs_fsctl.h>
  4. Change line 80 of hfsutil_main.c into #include <System/uuid/uuid.h>
  5. Change line 81 of hfsutil_main.c into static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; (replacing the include line)
  6. Also add #define HFS_UUID_SUPPORT 1 to hfsutil_main.c

There might still be something missing in the argument parsing section if the above doesn't work, please reference the Superuser question and comment if I've missed something.

Some people have also reported that it may be possible to use Gparted to change the UUID of a drive.

Upvotes: 7

Related Questions