sgan81 / apfs-fuse

FUSE driver for APFS (Apple File System)
GNU General Public License v2.0
1.74k stars 164 forks source link

error: Need to specify two devices for a fusion drive. #126

Closed chiemekailo closed 3 years ago

chiemekailo commented 4 years ago

My system is an iMac. It has a fusion drive made out of a 1tb hard disk + 2tb ssd. The boot sector is damaged (due to power failure) and so I cannot boot into the macOS (Majove). I installed Ubuntu on a flash drive and used it to start up the computer (running the Ubuntu OS from an external flash drive). I have followed the tutorial here, but when I eventually run the command ~/apfs-fuse/build/apfs-fuse -o allow_other /dev/sda2 /media/$USERNAME/macos, I get the following error:

Need to specify two devices for a fusion drive.
Unable to load container.

What can I do to remedy this situation.?

sgan81 commented 4 years ago

As it says, you need to specify both devices for mounting, since it's a fusion drive. Specify the SSD as normal device and the HD using the -f option.

gideao commented 4 years ago

Hi, Simon! First of all I really appreciate your work. It is a formidable tool to bridge Linux ans macOS.

I got the same error as the fellow above. I also had a iMac that don't boot after a power failure during a security update. In my case I removed the hard driver from a iMac then I try use my laptop running Ubuntu 18.04 to access the hard driver files.

I my case a used Fuse 2, which was available in my system, instead of Fuse 3 during the compilation. I tried the command bellow but got the error.

sudo apfs-fuse -o allow_other /dev/sdb2 /mnt

I really don’t understand error Need to specify two devices for a fusion drive. I only want to mount a partition from the hard driver removed from the iMac. Maybe the file system was damaged in some way that make it unrecognizable by the apfs-fuse.

I’m open to help to solve this problem or any alternatives tools to access the files. Just ask If you want any details.

sgan81 commented 4 years ago

You should see two devices under linux that belong to the fusion drive, since it consists of a SSD and a HD. However I don't own a fusion drive, so I can't tell for sure. As I said, you mount using apfs-fuse ... -f /dev/hd /dev/ssd /path/to/mountpoint/

But why don't you just boot into internet recovery and try to access the files from there? Push Cmd-Alt-R at startup, then your Mac will download a recovery macOS and boot from that. It will boot into the recovery environment, where you can copy the files via the terminal.

gideao commented 4 years ago

You should see two devices under linux that belong to the fusion drive, since it consists of a SSD and a HD. However I don't own a fusion drive, so I can't tell for sure. As I said, you mount using apfs-fuse ... -f /dev/hd /dev/ssd /path/to/mountpoint/

But why don't you just boot into internet recovery and try to access the files from there? Push Cmd-Alt-R at startup, then your Mac will download a recovery macOS and boot from that. It will boot into the recovery environment, where you can copy the files via the terminal.

I tried your suggestion. I got a working Mac Book and after more instigation I believe that the filesystem is corrupted. Thanks @sgan81 for your suggestion.

Tythiras commented 3 years ago

Sorry for reviving the thread. I wanted to know if anyone found a solution to the issue or any results from scanning the disk for corrupted bytes? I'm having a disk producing the same error after the power got removed while the mac was starting up.

AndrewL2018 commented 3 years ago

Does this also work for mounting a fusion drive that appears to have an hfsplus file system as the virtual disk?

fabmusik01 commented 2 years ago

Hi, I had the same problem than original post and my knowledge is very limited with Linux Here is how I managed to mount my imac folders : (sorry for my english, I'm french :-) )

As sgan81 said you need to use his code : -f /dev/hd /dev/ssd /path/to/mountpoint/ Here is how I did it in details :

First I was stuck just after this code (from the tutorial in original post) : sudo mkdir -p /media/ubuntu/macos

where "macos" is the folder name of the mounted iMac folder at the end and "ubuntu" your USB boot key name.

Then, in the tutorial, you have to paste this code : sudo ./apfs-fuse -o allow_other /dev/sda2 /media/ubuntu/macos

Didn't work for me : sudo: ./apfs-fuse : commande introuvable(means "don't find the command" in french) So I used : which apfs-fuse to locate the command. It was in "/usr/local/bin/apfs-fuse"

Then back to our problem : sudo /usr/local/bin/apfs-fuse -o allow_other /dev/sda2 /media/ubuntu/macos Reply : Need to specify two devices for a fusion drive. Unable to load container. Thanks to sgan81 we're close to the end :-). First you have to identify your hard drives. Open the "finder" of Ubuntu, click on "Other places" (in french it's "Autres emplacements"). You can see the imac disks :

SSD Volume 24 GB /dev/SomeLettersAndNumbers (for me "nvme0n1p2") Volume 1000 GB /dev/sda2

Then you paste the code with the correct names of your hard drives : ubuntu@ubuntu:~/apfs-fuse$ sudo /usr/local/bin/apfs-fuse -o allow_other -f /dev/sda2 /dev/nvme0n1p2 /media/ubuntu/macos

On your desktop appears the SSD icon, named macos. Open it, go to the "Root" folder, "Users" and back up the files you want