-
Notifications
You must be signed in to change notification settings - Fork 54
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
Improve driveletter selection for windows disks #498
Conversation
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.
Unrelated to the changes, but a small improvement on the type check for NTFS filesystems.
# "fake" ntfs filesystem is mounted. | ||
# The precedence for drives is first the drive letter drives (e.g. c:), | ||
# second the "normally" named drives (e.g. sysvol) and finally the anonymous | ||
# drives (e.g. /$fs/fs0). | ||
mount_items = (item for item in target.fs.mounts.items() if hasattr(item[1], "ntfs")) |
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.
mount_items = (item for item in target.fs.mounts.items() if hasattr(item[1], "ntfs")) | |
mount_items = (item for item in target.fs.mounts.items() if item[1].__type__ == "ntfs") |
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 will break dir and tar filesystems with a fake ntfs part though.
If the mft plugin walks the actual NtfsFilesystem (which checks on __type__ == "ntfs"
). The paths generated from this will get an anonymous fs mountpoint (e.g. $fs$\fs0
), but these paths are not reachable through things like target-shell, as the directory structures etc are not available, just the mft.
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.
Pff right, forgot about that and thought we'd already fixed that.
Can you maybe add a note about |
3d9e6c0
to
15fecd0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #498 +/- ##
==========================================
+ Coverage 74.77% 74.79% +0.01%
==========================================
Files 269 269
Lines 22073 22085 +12
==========================================
+ Hits 16506 16518 +12
Misses 5567 5567
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
15fecd0
to
78130f3
Compare
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.
I meant moreso in the docstring of those plugins. This comment is also nice, but it'd also nice to see an explanation of where those $fs$
paths are coming from if you're looking up the documentation for those plugins.
78130f3
to
79061db
Compare
As of c97c344 filesystems are always mounted. In the case of "fake" NTFS filesystems, as used by e.g. the dir and tar loaders, this means such a filesystem can be present under up to three different mount points, e.g.: sysvol, C: and $fs$\fs0 When a plugin does not use the root filesystem but the bare ntfs filesystem to parse ntfs specific properties, e.g. the mft plugin, it extends paths with a "driveletter" (read: mountpoint) to construct a path that is reachable from the root filesystem. The old setup always returned the last mount point a drive was mounted under. The new setup changes this to return the first mount point present in the following order: 1. the first mount point with a letter and colon, e.g. C:, 2. the first mount point not starting with $fs$, e.g. sysvol, 3. the first mount point starting with $fs$, e.g. $fs$\fs0.
79061db
to
4e03ed0
Compare
As of c97c344 filesystems are always mounted. In the case of "fake" NTFS filesystems, as used by e.g. the dir and tar loaders, this means such a filesystem can be present under up to three different mount points, e.g.: sysvol, C: and $fs$\fs0 When a plugin does not use the root filesystem but the bare ntfs filesystem to parse ntfs specific properties, e.g. the mft plugin, it extends paths with a "driveletter" (read: mountpoint) to construct a path that is reachable from the root filesystem. The old setup always returned the last mount point a drive was mounted under. The new setup changes this to return the first mount point present in the following order: 1. the first mount point with a letter and colon, e.g. C:, 2. the first mount point not starting with $fs$, e.g. sysvol, 3. the first mount point starting with $fs$, e.g. $fs$\fs0.
As of c97c344 filesystems are always mounted. In the case of "fake" NTFS filesystems, as used by e.g. the dir and tar loaders, this means such a filesystem can be present under up to three different mount points, e.g.: sysvol, C: and $fs$\fs0 When a plugin does not use the root filesystem but the bare ntfs filesystem to parse ntfs specific properties, e.g. the mft plugin, it extends paths with a "driveletter" (read: mountpoint) to construct a path that is reachable from the root filesystem. The old setup always returned the last mount point a drive was mounted under. The new setup changes this to return the first mount point present in the following order: 1. the first mount point with a letter and colon, e.g. C:, 2. the first mount point not starting with $fs$, e.g. sysvol, 3. the first mount point starting with $fs$, e.g. $fs$\fs0.
As of c97c344 filesystems are always mounted. In the case of "fake" NTFS filesystems, as used by e.g. the dir and tar loaders, this means such a filesystem can be present under up to three different mount points, e.g.: sysvol, C: and$fs$ \fs0
When a plugin does not use the root filesystem but the bare ntfs filesystem to parse ntfs specific properties, e.g. the mft plugin, it extends paths with a "driveletter" (read: mountpoint) to construct a path that is reachable from the root filesystem.
The old setup always returned the last mount point a drive was mounted under. The new setup changes this to return the first mount point present in the following order: