0

After 1 day of googling and try&error I give up and ask for help.

Long story short: I cloned internal HDD of my iMac (Mid 2011) to external SDD with dd command. Now I have two identical discs connected to my Mac. SDD is connected through Thunderbold. Choosing SDD from startup manager as the boot drive has no effect and iMac continuous to boot from the slow internal HDD. I guess the problem is caused by the identical UUIDs of both drives. Before editing /etc/fstab to prevent the internal HDD from mounting I need to change the UUID. How can I do that? Moreover I am confused by the fact that each partition has a volume UUID and a partition UUID - which one has to be changed? both? or only one of them?

Full story: I want to use an external SSD connected to my iMac through Thunderbold as my primary boot drive. Further I want to deactivate the internal HDD drive without opening my iMac. I cloned the internal HDD with dd command while I booted into the iMac from Ubuntu 18.04 live USB stick. When I try to use tune2fs to change UUID I get different errors depending on which partition I touch.

sbd1 sudo tune2fs -U random /dev/sdb1 tune2fs 1.44.1 (24-Mar-2018) tune2fs: Bad magic number in super-block while trying to open /dev/sdb1 /dev/sdb1 contains a vfat file system labelled 'EFI'

sdb2 sudo tune2fs -U random /dev/sdb2 tune2fs 1.44.1 (24-Mar-2018) tune2fs: Bad magic number in super-block while trying to open /dev/sdb2 /dev/sdb2 contains a hfsplus file system labelled 'Macintosh HD'

sdb3 sudo tune2fs -U random /dev/sdb3 tune2fs 1.44.1 (24-Mar-2018) tune2fs: Bad magic number in super-block while trying to open /dev/sdb3 /dev/sdb3 contains a hfsplus file system labelled 'Recovery HD'

sbd4 sudo tune2fs -U random /dev/sdb4 tune2fs 1.44.1 (24-Mar-2018) tune2fs: Bad magic number in super-block while trying to open /dev/sdb4 /dev/sdb4 contains a ntfs file system labelled 'BOOTCAMP'

UPDATE: I took the risk and tried gdisk to change UUIDs of the partitions on the external SSD. I used x and f options of gdisk to randomize the SSD's disk&partition UUIDs. Checking the result back on OSX using diskutil info disk1s1, ...disk1s2 etc. it seems that this has changed each Partition UUID of all partitions. But the Volume UUID of all 4 partitions remained unchanged. (The Data did not get lost btw.). But I still have the issue that my iMac does not boot from the external SSD. :(

  • I assume changing UUID without loss of data - (it this is possible at all) because cloning the internal 1TB HDD takes me more than three hours :( – Wlad Aug 26 '18 at 17:15
  • tune2fs is only for ext2/3/4 filesystems, nor ntfs, hfs or fat. – Ipor Sircer Aug 26 '18 at 17:18
  • oh damn, so what do I need in my case? – Wlad Aug 26 '18 at 17:25
  • I also tried hfs.util from OSX ... sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.util -s /dev/disk4 as described here without success – Wlad Aug 26 '18 at 17:28
  • Another optionn I saw was gdisk like in this example. But I am afraid to try it because of possible data loss. – Wlad Aug 26 '18 at 17:32
1

I managed to change UUID of the most important partition with hfs.util and now I am finally able to boot from my external SSD. It was the partition which holds the Mac OS (El Capitan). If you cloned your internal HDD with dd like me it probably is named Macintosh HD

You need to find out the IDENTIFIER of the partition which you want to change UUID of. Try diskutil list command and get something like this:

>diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 699.3 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 4: Microsoft Basic Data BOOTCAMP 300.0 GB disk0s4 /dev/disk1 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk1 1: EFI EFI 209.7 MB disk1s1 2: Apple_HFS MacOSX 699.3 GB disk1s2 3: Apple_Boot Recovery HD 650.0 MB disk1s3 4: Microsoft Basic Data BOOTCAMP 300.0 GB disk1s4

In my case it's disk1s2 with NAME MacOSX (I have renamed it from default during my experiments to mitigate confusion).

Before trying to change UUID you have to unmount this partition or the whole drive

unmount partition

>diskutil unmount force /dev/disk1s2

or the whole drive

diskutil unmountDisk disk1 Unmount of all volumes on disk0 was successful

Finally change UUID with hfs.util and remount the disk/partition. The -s option will generate and set a random UUID.

>sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.fs/hfs.util -s disk1s2

diskutil mountDisk disk1 or diskutil mount disk1s2

Use disutil info disk1s2 and diskutil info disk0s2 to compare Volume UUID of internal external drive's partitions.

To boot from external SSD restart your Mac and while it restarts hold down the alt key on your keyboard (also called OPTIONS key) until you hear the boot sound. Choose your external drive (orange icon!).

With df command in terminal you can check whether your external drive is the boot drive

>df
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk1s2 1365908480 651731032 713665448 48% 81530377 89208181 48% / devfs 379 379 0 100% 657 0 100% /dev map -hosts 0 0 0 100% 0 0 100% /net map auto_home 0 0 0 100% 0 0 100% /home /dev/disk1s4 585932792 83152520 502780272 15% 284666 251392190 0% /Volumes/BOOTCAMP 1 /dev/disk0s2 1365908480 644697952 721210528 48% 80587242 90151316 47% /Volumes/Macintosh HD /dev/disk0s4 585932792 83152520 502780272 15% 284666 251392190 0% /Volumes/BOOTCAMP

As you can see now /dev/disk1s2 is mounted to / which means it is my boot or root drive.

From here u might be interested in how to spin down the internal HDD or how to prevent it from mounting at boot at all.

spin down: https://superuser.com/questions/251969/disable-or-sleep-secondary-hard-drive-in-macbook

do not mount on boot: https://discussions.apple.com/thread/3686350

0

The makers of Carbon Copy Cloner provide a simple (Mac) tool to change volume uuids (one at a time). The download link is on this page.

I used it several times and had no problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.