helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
807 stars 58 forks source link

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

Open grahamperrin opened 3 years ago

grahamperrin commented 3 years ago

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

probonopd commented 3 years ago

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

vermaden commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Thank You.

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

probonopd commented 3 years ago

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

vermaden commented 3 years ago

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 commented 3 years ago

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.

JakoDel commented 3 years ago

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 commented 3 years ago

Ah, good to know, thanks.

probonopd commented 10 months ago

Depends on