X Tutup
The Wayback Machine - https://web.archive.org/web/20210621144306/https://github.com/PabloLec/recoverpy/issues/8
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

MacOS compatibility #8

Open
PabloLec opened this issue Jun 21, 2021 · 0 comments
Open

MacOS compatibility #8

PabloLec opened this issue Jun 21, 2021 · 0 comments

Comments

@PabloLec
Copy link
Owner

@PabloLec PabloLec commented Jun 21, 2021

Currently, RecoverPy only works with Linux systems.
This is due to the different tools it uses under the hood but theoretically it could be adapted to work on MacOS.

grep, dd and even progress are compatible with MacOS, so no change needed here.
But lsblk is not so here is the first difference.

Additions needed I can think of right now are:

  • Detect if OS is Linux or MacOS (done).

  • Probably use diskutil list as a replacement for lsblk.
    Adding -plist outputs, I think, all the informations needed. And it can be parsed with native plistlib.
    So a function using diskutil needs to be added with a list of list as an output like so:

    [['NAME(e.g: disk0s2)', 'TYPE(disk/part)', 'FILESYSTEM(e.g: APFS)', MOUNTPOINT(if mounted)'], ... ]
    

    Although output format can be changed, modifications should also be made to linux lsblk function.

  • Handle MacOS specific pitfalls. By that I mean disk/partitions types and filesystems that are not present with Linux but which should be handled differently here (e.g: loopback, temp parts, non compatible with grep, etc.).

  • And finally, another MacOS pitfall which is permission. sudo only will not do the trick here. It seems like the user needs to grant "full disk access" to the Terminal though the GUI system settings beforehand. We could, maybe, find some hacky solution but otherwise, the Operation not permitted exception should be handled. And the sooner the better, preferably before initiating grep search.

I started working on it, there is not a lot to do.
But as I'm not too familiar with MacOS and testing on a VM, I'm quite sure I'll miss things I should consider and it will end up being flawed.

So, if you're a MacOS user, familiar with Python, diskutil or essentially have some notions in MacOS partition management, I would greatly welcome your help 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
X Tutup