-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Does this only work on freshly created disks? #2
Comments
Hi. Case sensitivity shouldn't be a problem and any blocksize should be fine as long as it's smaller than a Linux page. That said, the module has only been tested with very simple containers, so I'm not surprised that you are running into problems. What's the issue exactly? Can you mount the disk read-only with my module? Are you getting any output on dmesg? Can you try running my fsck on your disk? That may tell us if it has an unsupported feature. Right now I'm busy trying to implement a couple of features that we need urgently, so it may take me a while to start fixing bugs reported by users. I definitely want the module to be fully functional, but we are not quite there yet. |
Hey @eafer! Thanks for replying so fast! I'll do some tests on a fresh VPS with KVM so I can pinpoint the exact issue. The device I was testing does have a bad superblock because I truncated it in Linux after shrinking it in OS X. However I can still boot off it and mount using apfs-fuse read-only. I cant mount using linux-apfs. I'm going to test apfs-fuse in read only and rsync to a fresh disk and see if it will straight up just boot (KVM OpenCore macOS). I'll also test a non-truncated disk obviously 😀 Will report back soon! |
fdisk -l apfs.raw
# root@docker-ubuntu-c-16-nyc3-01:~# fdisk -l apfs.raw
# GPT PMBR size mismatch (104857599 != 39472135) will be corrected by write.
# Disk apfs.raw: 18.84 GiB, 20209733632 bytes, 39472136 sectors
# 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: dos
# Disk identifier: 0x00000000
# Device Boot Start End Sectors Size Id Type
# apfs.raw1 1 39472135 39472135 18.8G ee GPT git clone https://github.com/linux-apfs/apfsprogs.git
cd apfsprogs/apfsck
make
make install
cd ../mkapfs
make
make install
cd ../../
export PATH="~/bin:${PATH}"
git clone https://github.com/linux-apfs/linux-apfs-rw.git
cd linux-apfs-rw
make
make install
modprobe libcrc32c
insmod apfs.ko
cd ..
mkdir -p ./apfs-mnt
fsck.apfs apfs.raw
# Container superblock: block size is too small. export DEVICE_MODEL=iMacPro1,1
export SERIAL=XXXXXXXXXXXX
export BOARD_SERIAL=XXXXXXXXXXXXXXXXX
export UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
export MAC_ADDRESS=00:03:93:00:00:00
export DISK_TWO="${PWD}/apfs.raw"
chmod 777 "$DISK_TWO"
docker run -it \
--device /dev/kvm \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e RAM=10 \
-p 50923:10022 \
-e GENERATE_SPECIFIC=true \
-e DEVICE_MODEL="${DEVICE_MODEL}" \
-e SERIAL="${SERIAL}" \
-e BOARD_SERIAL="${BOARD_SERIAL}" \
-e UUID="${UUID}" \
-e MAC_ADDRESS="${MAC_ADDRESS}" \
-v "${IMAGE_NAME}":/image \
-e WIDTH=1600 \
-e HEIGHT=900 \
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
-v "${DISK_TWO}:/disktwo" \
-e EXTRA='-device ide-hd,bus=sata.5,drive=DISKTWO -drive id=DISKTWO,if=none,file=/disktwo,format=raw' \
sickcodes/docker-osx:big-sur repaired all disks inside disk utilityInside macOS diskutil list
diskutil unmountDisk /dev/disk4
fsck_apfs -oy /dev/disk4
fsck_apfs -q /dev/disk4
# root@docker-ubuntu-c-16-nyc3-01:~# apfsutil ./apfs.raw
# Found partitions:
# C12A7328-F81F-11D2-4BBA-00A0C93EC93B 78BA58BF-9638-4A49-45AE-E7CCE88F2420 0000000000000028 0000000000064027 0000000000000000 EFI System Partition
# 7C3457EF-0000-11AA-11AA-00306543ECAC DA201F5F-1AB2-4C33-1888-3C20F89518D6 0000000000064028 00000000025A4C07 0000000000000000
# First APFS partition is 1
# Volume 0 BA38ED4B-947E-49C5-82AD-68B1E3A1343D
# ---------------------------------------------
# Role: Data
# Name: Docker-OSX-Raw-Big-Sur - Data (Case-sensitive)
# Capacity Consumed: 1903083520 Bytes
# FileVault: No
# Snapshots:
# Volume 1 E5120E70-309F-4D55-B8E4-F914229FE4EA
# ---------------------------------------------
# Role: Preboot
# Name: Preboot (Case-insensitive)
# Capacity Consumed: 293552128 Bytes
# FileVault: No
# Snapshots:
# Volume 2 476925AC-48F2-4ABB-9E0D-1069DAD79282
# ---------------------------------------------
# Role: Recovery
# Name: Recovery (Case-insensitive)
# Capacity Consumed: 613834752 Bytes
# FileVault: No
# Snapshots:
# Volume 3 A12A3D2B-AA0E-41BD-9F31-C3F4219DE6A7
# ---------------------------------------------
# Role: VM
# Name: VM (Case-insensitive)
# Capacity Consumed: 1069056 Bytes
# FileVault: No
# Snapshots:
# Volume 4 215F1FA9-D084-4F4C-BD36-B265E83F80F0
# ---------------------------------------------
# Role: System
# Name: Docker-OSX-Raw-Big-Sur (Case-insensitive)
# Capacity Consumed: 15050797056 Bytes
# FileVault: No
# Snapshots:
# 640 : 'com.apple.os.update-35C699ADD439C653A3B09EBD8A30FBD366881244EB7C82207A2E135362FCCB7F'
# Volume 5 41683538-A64E-4C49-ABBD-211E0195838D
# ---------------------------------------------
# Role: Update
# Name: Update (Case-insensitive)
# Capacity Consumed: 520192 Bytes
# FileVault: No
# Snapshots:
apfs-fuse apfs.raw ./apfs-mnt
# apfs.raw 19531248 17494892 2036356 90% /root/apfs-mnt
```bash
fdisk -l apfs.raw GPT PMBR size mismatch (104857599 != 39472135) will be corrected by write.
Disk apfs.raw: 18.84 GiB, 20209733632 bytes, 39472136 sectors
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: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
apfs.raw1 1 39472135 39472135 18.8G ee GPT
dmesg:
[14749.141759] squashfs: Unknown parameter 'cknodes'
[14779.760602] APFS (loop6): bad blocksize 0 |
[user@hostname ~]$ fdisk -l /mac_hdd_ng_nonqcow_postreboot.img
Disk /mac_hdd_ng_nonqcow_postreboot.img: 50 GiB, 53687091200 bytes, 104857600 sectors
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: 5C21B10B-9C3E-4AE9-8482-F4C321A8094D
Device Start End Sectors Size Type
/mac_hdd_ng_nonqcow_postreboot.img1 40 409639 409600 200M EFI System
/mac_hdd_ng_nonqcow_postreboot.img2 409640 104857559 104447920 49.8G Apple APFS mkdir /tmp/mnting
sudo mount /mac_hdd_ng_nonqcow_postreboot.img /tmp/mnting
# mount: /tmp/mnting: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
mkdir /tmp/mnting
sudo mount /mac_hdd_ng_nonqcow_postreboot.img /tmp/mnting ; sudo dmesg | tail -n100
|
Works fine on freshly created APFS, having trouble getting an existing Big Sur disk to mount read write however.
I can mount Big Sur using apfs-fuse read-only, can I help or any tips on forcing apfs-fuse to mount read/write using your module?
Or since you mentioned
Any tips on exact dimensions or specific block sizes that would be 100% editable with apfs-apfs-rw?
No Encryption is fine, does disk case sensitivity make a difference?
Or is the actual goal:
rsync -av
or similar to make a disk that OSX will boot that you have manufactured?I will try that today regardless^ also working on documentation
The text was updated successfully, but these errors were encountered: