Cannot repair or mount external macOS HDD backup on linux

I have an external HDD for file storage that its EFI partition got messed with, not sure why this prevents any of the other partitions to be mounted but here I am.

# fdisk -l

Disk /dev/sdc: 931.48 GiB, 1000170586112 bytes, 1953458176 sectors
Disk model: Elements 25A2   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D8747DC9-9813-4D69-A5C7-6E5B90AEABDF

Device      Start        End    Sectors   Size Type
/dev/sdc1      40     409639     409600   200M Microsoft basic data
/dev/sdc2  409640 1953195991 1952786352 931.2G Apple HFS/HFS+
# mke2fs -n /dev/sdc1
mke2fs 1.47.0 (5-Feb-2023)
The file /dev/sdc1 does not exist and no size was specified.

Also when I try to delete sdc1 and recreate an EFI with Yast, it fails. Needless to say all mounting options fail.

I don't want to mess with sdc2 since that's where my backup resides, so I'm at loss on how to extract this data or repair the disk. Any help would be greatly appreciated!

sdc1 was made for booting a OS.
If you want to use it for Linux data then you must change its type to Linux.
You can do it in fdisk

Hi @TrixTrix ...

Kindly let us know your overall target / goal:

  • If you only care about the Mac backup data on /dev/sdc2, leave everything as is.

  • If you want /dev/sdc1 for Linux, delete, re-create, and format it as Linux—but only touch /dev/sdc1, not /dev/sdc2.

What are you actually trying to do?

Hello guys! @Neo @MadeInGermany thanks for the help!

Yes, I want to save /dev/sdc2 with the Mac backup data. But I'm unable to mount it either on MacOS or Linux. Almost as if the EFI partition had something needed for the drive to be mounted.

In other words: I want to mount sdc2 in order to copy it to another disk

When I try to delete and re-create /dev/sdc1 I get an error saying that changes cannot be made since / is not mounted.
I'm using YaST because I don't want to mess up with the Mac backup partition, and already get errors when accessing YaST partitioner:

The partitioner does not see sdc2 I guess it's because it's a HFS+ filesystem, but I do have the fs available. Also sdc1 shows as Linux because I've already tried deleting and re-creating it unsuccessfully:

When I try to delete and re-create sdc1:

The role EFI looks wrong to me.
Try role Data.
Or role Raw, and afterwards run a mkfs on it.

Anything I try I get this:

Not sure if there's any CLI program I can use such as gparted or gptfdisk to achieve this with more options, like forcing.

My experience with macOS Time Machine backups is that you cannot easily mount or access them on other machines. These backups are typically encrypted by default and have strict access controls, making access difficult even on a Mac other than the one that created the backup.

It’s not surprising you can’t mount a Time Machine backup, especially using a GUI. Unless you have the password and use specialized tools, decrypting or mounting these backups is rarely possible, and compatibility outside of macOS is extremely limited.

Hello again @Neo ! sdc2 is not a time machine backup, it's a plain HFS+ partition containing files.
I have two hypotheses:

  • The disk is too full so it fails
  • Removing the EFI partition caused the disk to not be read properly

I'm honestly at loss and I'm beginning to think it's a mechanical failure. I'm unsure why YaST errors on sdc1 but then sees it. And why fdisk -l can see all partitions but I cannot work on them.

I wonder if there's a tool to fully clone an HDD to another drive and from there I can try to tinker more aggressively.

PS: I also tried to rescue the disk from MacOS both on APFS and HFS+ machines, and none works, HFS+ machine can see the disk and all partitions but times out on trying to recover/repair, APFS does nothing.
So I was hoping Linux could give me some more power to the rescue process.

Hi @TrixTrix

Did you try checking and/or repairing the disk with something like fdisk, not mounting the disk?

I can understand you being nervous about tinkering with a disk holding a system backup. If you have an available simple FTP server with enough disk space (although this utility compresses the image for you), search for "ghosting for Unix" otherwise known as "g4u" which is free and allows you to boot bare metal (from CD/DVD/USB) and then FTP a disk image (sector-by-sector) to a FTP server. Then, if your tinkering screws up you can boot g4u again and 'restore' the whole disk back from the FTP server.

This is all I get, not sure if there's a "repair" option in fdisk, can you point me in the right direction? Man page says not much about repairing. Thanks!

# fdisk -l /dev/sdc
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Disk /dev/sdc: 931.48 GiB, 1000170586112 bytes, 1953458176 sectors
Disk model: Elements 25A2   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D8747DC9-9813-4D69-A5C7-6E5B90AEABDF

Device      Start        End    Sectors   Size Type
/dev/sdc1      40     409639     409600   200M Microsoft basic data
/dev/sdc2  409640 1953195991 1952786352 931.2G Apple HFS/HFS+

Fantastic idea, thank you! I will look into it during the weekend. I had to put a halt due to health issues but I'm feeling better. Definitely will right away, thanks!

Maybe this is what I'm looking for and what you're referencing? lmk (sorry, forum does not let me post links)

Weird part is that fdisk does see the sdc1 and sdc2 partitions, but ls does not:

 ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jun 11 00:06 /dev/sda
brw-rw---- 1 root disk 8,  1 Jun 11 00:06 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jun 11 00:06 /dev/sda2
brw-rw---- 1 root disk 8,  3 Jun 11 00:06 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jun 11 00:06 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jun 11 00:06 /dev/sdb1
brw-rw---- 1 root disk 8, 18 Jun 11 00:06 /dev/sdb2
brw-rw---- 1 root disk 8, 19 Jun 11 00:06 /dev/sdb3
brw-rw---- 1 root disk 8, 20 Jun 11 00:06 /dev/sdb4
brw-rw---- 1 root disk 8, 21 Jun 11 00:06 /dev/sdb5
brw-rw---- 1 root disk 8, 22 Jun 11 00:06 /dev/sdb6
brw-rw---- 1 root disk 8, 32 Jun 13 22:06 /dev/sdc

If I could only get a hold of sdc2 in some way, I think I would have a starting point.

Weird part is that fdisk does see the sdc1 and sdc2 partitions, but ls does not:

 ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jun 11 00:06 /dev/sda
brw-rw---- 1 root disk 8,  1 Jun 11 00:06 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jun 11 00:06 /dev/sda2
brw-rw---- 1 root disk 8,  3 Jun 11 00:06 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jun 11 00:06 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jun 11 00:06 /dev/sdb1
brw-rw---- 1 root disk 8, 18 Jun 11 00:06 /dev/sdb2
brw-rw---- 1 root disk 8, 19 Jun 11 00:06 /dev/sdb3
brw-rw---- 1 root disk 8, 20 Jun 11 00:06 /dev/sdb4
brw-rw---- 1 root disk 8, 21 Jun 11 00:06 /dev/sdb5
brw-rw---- 1 root disk 8, 22 Jun 11 00:06 /dev/sdb6
brw-rw---- 1 root disk 8, 32 Jun 13 22:06 /dev/sdc

If I could only get a hold of sdc2 in some way, I think I would have a starting point.

parted also fails at reading:

# parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) list                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resizepart NUMBER END                    resize partition NUMBER
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) print                                                            
Error: Input/output error during read on /dev/sdc
Retry/Ignore/Cancel?                  

Firstly, 'ls' lists the contents of the current directory only, whereas 'fdisk' is a disk inspection/partitioner so I'm not surprised that 'fdisk' might see more than 'ls'.

Secondly, and more importantly, your listing shows no partition device nodes, e.g. /dev/sdc1, /dev/sdc2, ..... for whole disk /dev/sdc. It looks like something/someone has deleted those device nodes thereby giving you trouble mounting them. Not being an OSX expert I cannot tell you whether there is a utility to recreate them. Many O/S's have a utility, e.g. 'devfsadm' in Solaris, which will inpect the disk and recreate the device nodes for you.

Perhaps an OSX guru will chime in here.

A quick search seems to be telling me that a utility 'devfsadm' does exist on OSX, but I cannot advise you how to use it.

If fdisk is not mistaken then you should (re-)write the current disk label, so the gpt will be restored, then run partprobe or reboot. The OS (especially udev) will recognize its partitions (and recreate the device nodes).

Thank you @hicksd8 for your input~~!

/dev/sdc2 is what I'm interested in. It's a partition with a bunch of directories with text/media files and tarfiles. It is not a system partition or anything like that, just files.