Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer some support for APFS (Apple File System) mounts #170

Open
grahamperrin opened this issue Mar 5, 2021 · 11 comments
Open

Offer some support for APFS (Apple File System) mounts #170

grahamperrin opened this issue Mar 5, 2021 · 11 comments
Labels
enhancement New feature or request

Comments

@grahamperrin
Copy link
Contributor

grahamperrin commented Mar 5, 2021

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

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 grahamperrin changed the title Offer some support for APFS (Apple File System) Offer some support for APFS (Apple File System) mounts Mar 5, 2021
@probonopd probonopd added the enhancement New feature or request label Mar 5, 2021
@probonopd
Copy link
Member

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

@vermaden
Copy link

vermaden commented Mar 5, 2021

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.

@probonopd
Copy link
Member

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.

@JakoDel
Copy link

JakoDel commented Mar 11, 2021

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

@vermaden
Copy link

Thank You.

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

@probonopd
Copy link
Member

sgan81/apfs-fuse#139 by @johnothwolo is adding FreeBSD support to apfs-fuse.

@vermaden
Copy link

vermaden commented Apr 2, 2021

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.

@probonopd
Copy link
Member

probonopd commented Apr 2, 2021

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.

@JakoDel
Copy link

JakoDel commented Apr 3, 2021

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

@probonopd
Copy link
Member

Ah, good to know, thanks.

@probonopd
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants