ISO icon indicating copy to clipboard operation
ISO copied to clipboard

Offer some support for APFS (Apple File System) mounts

Open grahamperrin opened this issue 4 years ago • 11 comments

Ported

libyal/libfsapfs

https://www.freshports.org/devel/libfsapfs

https://github.com/libyal/libfsapfs#readme

  • Status: experimental
  • Licence: LGPLv3+

More

Via https://github.com/topics/apfs …

sgan81/apfs-fuse

https://github.com/sgan81/apfs-fuse#readme

  • via https://github.com/Catboy96/apfs-mounter#readme

linux-apfs/linux-apfs-oot

https://github.com/linux-apfs/linux-apfs-oot#readme

jordibr/APFS-Module

https://github.com/jordibr/APFS-Module#readme

grahamperrin avatar Mar 05 '21 06:03 grahamperrin

Possibly it would be worth suggesting this to @vermaden for https://github.com/vermaden/automount?

probonopd avatar Mar 05 '21 07:03 probonopd

I do not have access to Apple hardware so I am not able to create APFS device for tests but ... can someone just format 4GB or 8GB USB pendrive using APFS, then create its image with dd(8) and sent it to me?

This way I can move that image to my USB pendrive and make the tests and add APFS to automount.

... or its possible to create APFS with the tools mentioned on FreeBSD?

Regards.

vermaden avatar Mar 05 '21 13:03 vermaden

Thanks @vermaden, excellent. As I refuse to run any OS X later than 10.9 which does not use APFS, I cannot make an APFS dd gzip, but maybe one of our users interested in apfs compatibility can do that.

Thank you very much.

probonopd avatar Mar 05 '21 16:03 probonopd

I do not have access to Apple hardware so I am not able to create APFS device for tests but ... can someone just format 4GB or 8GB USB pendrive using APFS, then create its image with dd(8) and sent it to me?

This way I can move that image to my USB pendrive and make the tests and add APFS to automount.

... or its possible to create APFS with the tools mentioned on FreeBSD?

Regards.

Made one :) https://www.icloud.com/iclouddrive/03Retv6uQWWJheJ4omTBSlGtw#apfsusb

twlswan avatar Mar 11 '21 17:03 twlswan

Thank You.

Will try to get into it this weekend or earlier :)

vermaden avatar Mar 11 '21 17:03 vermaden

https://github.com/sgan81/apfs-fuse/pull/139 by @johnothwolo is adding FreeBSD support to apfs-fuse.

probonopd avatar Apr 02 '21 10:04 probonopd

Not sure if that helps but ...

% mdconfig -l -v  
md0     vnode    3856M  /data/download/apfsusb.img      

% file -s /dev/md0
/dev/md0: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 1, 7897087 sectors, extended partition table (last)

% file -s /dev/md0p1 
/dev/md0p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "BSD  4.4", sectors/track 32, heads 16, sectors 409600 (volumes > 32 MB), FAT (32 bit), sectors/FAT 3151, serial number 0x67e317ed, label: "EFI        "

% file -s /dev/md0p2
/dev/md0p2: Apple File System (APFS), blocksize 4096

% doas /usr/local/bin/fsapfsinfo /dev/md0            
fsapfsinfo 20201107

Unable to open: /dev/md0.
libfsapfs_container_superblock_read_data: invalid object type: 0x00000000.
libfsapfs_container_superblock_read_file_io_handle: unable to read container superblock data.
libfsapfs_internal_container_open_read: unable to read container superblock at offset: 0 (0x00000000).
libfsapfs_container_open_file_io_handle: unable to read from file IO handle.
info_handle_open_input: unable to open input container.

% doas /usr/local/bin/fsapfsinfo /dev/md0p2
fsapfsinfo 20201107

Unable to open: /dev/md0p2.
libcfile_file_read_buffer_with_error_code: unable to read from file with error: Invalid argument
libcfile_file_read_buffer: unable to read from file.
libbfio_file_read_buffer: unable to read from file: /dev/md0p2.
libbfio_file_range_io_handle_read_buffer: unable to read from file IO handle.
libbfio_handle_read_buffer: unable to read from handle.
libfsapfs_object_read_file_io_handle: unable to read object data.
libfsapfs_internal_container_open_read: unable to read object at offset: 4096 (0x00001000).
libfsapfs_container_open_file_io_handle: unable to read from file IO handle.
info_handle_open_input: unable to open input container.

% doas /usr/local/bin/fsapfsmount /dev/md0 /mnt/tmp 
fsapfsmount 20201107

Unable to open source container
libfsapfs_container_superblock_read_data: invalid object type: 0x00000000.
libfsapfs_container_superblock_read_file_io_handle: unable to read container superblock data.
libfsapfs_internal_container_open_read: unable to read container superblock at offset: 0 (0x00000000).
libfsapfs_container_open_file_io_handle: unable to read from file IO handle.
mount_handle_open: unable to open container.

% doas /usr/local/bin/fsapfsmount /dev/md0p2 /mnt/tmp
fsapfsmount 20201107

Unable to open source container
libcfile_file_read_buffer_with_error_code: unable to read from file with error: Invalid argument
libcfile_file_read_buffer: unable to read from file.
libbfio_file_read_buffer: unable to read from file: /dev/md0p2.
libbfio_file_range_io_handle_read_buffer: unable to read from file IO handle.
libbfio_handle_read_buffer: unable to read from handle.
libfsapfs_object_read_file_io_handle: unable to read object data.
libfsapfs_internal_container_open_read: unable to read object at offset: 4096 (0x00001000).
libfsapfs_container_open_file_io_handle: unable to read from file IO handle.
mount_handle_open: unable to open container.

vermaden avatar Apr 02 '21 14:04 vermaden

Although I am not sure I imagine that the dmg was made by the Mac's Disk Utility which usually does not produce "raw" images (like dd would) of a disk but also puts a partition table and possibly additional partitions into the image. md0p2 does look like it is recognized as APFS by file -s, so it is probably what should be mounted. I don't know why doas /usr/local/bin/fsapfsmount /dev/md0p2 /mnt/tmp fails but possibly it would be worthwhile to try https://github.com/sgan81/apfs-fuse/pull/139 on it.

probonopd avatar Apr 02 '21 15:04 probonopd

Although I am not sure I imagine that the dmg was made by the Mac's Disk Utility which usually does not produce "raw" images (like dd would) of a disk but also puts a partition table and possibly additional partitions into the image. md0p2 does look like it is recognized as APFS by file -s, so it is probably what should be mounted. I don't know why doas /usr/local/bin/fsapfsmount /dev/md0p2 /mnt/tmp fails but possibly it would be worthwhile to try sgan81/apfs-fuse#139 on it.

I did use dd though

twlswan avatar Apr 03 '21 09:04 twlswan

Ah, good to know, thanks.

probonopd avatar Apr 03 '21 09:04 probonopd

Depends on

  • https://github.com/vermaden/automount/issues/51

probonopd avatar Oct 28 '23 17:10 probonopd