-
Notifications
You must be signed in to change notification settings - Fork 79
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
macOS - '/System/Volumes/Data' DiskDevice path remapping #162
Conversation
Fixes #158 On macOS APFS disk all users' data is mounted in '/System/Volumes/Data' but fused transparently using firmlinks and presented as part of the root filesystem. It requires remapping Data volume path for this DiskDevice to '/' in order for fclones correctly recognise device deduplicated files are on. Ref: https://www.swiftforensics.com/2019/10/macos-1015-volumes-firmlink-magic.html https://eclecticlight.co/2020/01/23/catalina-boot-volumes/
Not sure what is wrong with my format.... |
Formatting fixed. |
src/device.rs
Outdated
if cfg!(target_os = "macos") { | ||
if String::from_utf8_lossy(d.file_system()) == "apfs" | ||
&& d.mount_point().to_string_lossy() == "/System/Volumes/Data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition can be flattened and slightly simplified:
if cfg!(target_os = "macos")
&& d.file_system() == b"apfs"
&& d.mount_point().to_str() == Some("/System/Volumes/Data") {
result.mount_points.push((Path::from("/"), index));
} else {
result
.mount_points
.push((Path::from(d.mount_point()), index));
}
and remove the repetition of the else clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. I have not written any code for long... and also not used github as you can see by small mess I created. But things are coming back quickly.
Doing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good. Just remove the repetition in the code and I'll merge.
Done and all grenn |
Fixes #158
On macOS APFS disk all users' data is mounted in '/System/Volumes/Data' but fused transparently using firmlinks and presented as part of the root filesystem. It requires remapping Data volume path for this DiskDevice to '/' in order for fclones correctly recognise device deduplicated files are on.
Ref:
https://www.swiftforensics.com/2019/10/macos-1015-volumes-firmlink-magic.html
https://eclecticlight.co/2020/01/23/catalina-boot-volumes/