{"id":23548,"library":"dissect-volume","title":"Dissect Volume","description":"A Dissect module implementing a parser for different disk volume and partition systems, e.g. LVM2, GPT, and MBR. Part of the Dissect forensic framework. Current version: 3.18, requires Python >=3.10. Release cadence follows Dissect project updates.","status":"active","version":"3.18","language":"python","source_language":"en","source_url":"https://github.com/fox-it/dissect.volume","tags":["forensics","volume","partition","dissect","lvm","gpt","mbr"],"install":[{"cmd":"pip install dissect-volume","lang":"bash","label":"Standard pip install"}],"dependencies":[{"reason":"Used for parsing binary structures","package":"dissect.cstruct","optional":false},{"reason":"Provides logging and utility functions","package":"dissect.cobalt","optional":false}],"imports":[{"note":"Direct import from dissect.volume is the correct public API path.","wrong":"from dissect.volume.volume import VolumeSystem","symbol":"VolumeSystem","correct":"from dissect.volume import VolumeSystem"},{"note":"Module name is 'lvm', not 'lvm2'.","wrong":"from dissect.volume.lvm2 import LVM2","symbol":"LVM2","correct":"from dissect.volume.lvm import LVM2"},{"note":"","wrong":"","symbol":"GPT","correct":"from dissect.volume.gpt import GPT"},{"note":"","wrong":"","symbol":"MBR","correct":"from dissect.volume.mbr import MBR"},{"note":"","wrong":"","symbol":"disk","correct":"from dissect.volume.disk import Disk"}],"quickstart":{"code":"from dissect.volume import VolumeSystem\n\n# Open a disk image file (e.g., raw, qcow2) and parse volume system\nwith open('disk.raw', 'rb') as fh:\n    vs = VolumeSystem(fh)\n    for volume in vs.volumes:\n        print(f'Volume: {volume.name}, type: {volume.type}, size: {volume.size}')","lang":"python","description":"Basic usage: open a disk image and enumerate volumes."},"warnings":[{"fix":"Update imports to the new top-level paths: `from dissect.volume import VolumeSystem`.","message":"dissect.volume 3.x drops support for Python < 3.10. Also, the internal module paths changed: e.g., `dissect.volume.volume.VolumeSystem` is now `dissect.volume.VolumeSystem`. Old imports will break.","severity":"breaking","affected_versions":">=3.0"},{"fix":"Use `LVM2(fh=open('file', 'rb'))` instead of old `LVM2('file')`.","message":"The `LVM2` class constructor signature changed in 3.0; the `lvm2` parameter is replaced by `fh` (file-like object).","severity":"deprecated","affected_versions":">=3.0"},{"fix":"If you have a bytes object, wrap it in `io.BytesIO(data)` before passing to VolumeSystem.","message":"VolumeSystem expects a seekable file-like object. Passing a non-seekable stream (e.g., from a network socket) will fail. Always use a file, BytesIO, or other seekable object.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use `'rb'` mode when opening disk images.","message":"On Windows, file paths need to be opened in binary mode: `open('path', 'rb')` else parsing errors may occur.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install dissect-volume` and ensure you are in the correct Python environment.","cause":"The package dissect-volume is not installed or is installed in a different environment.","error":"ModuleNotFoundError: No module named 'dissect.volume'"},{"fix":"Use `from dissect.volume import VolumeSystem` instead.","cause":"Import path changed in dissect-volume 3.x. Old import `from dissect.volume.volume import VolumeSystem` no longer works.","error":"ImportError: cannot import name 'VolumeSystem' from 'dissect.volume'"},{"fix":"Use `with open('image.raw', 'rb') as fh: vs = VolumeSystem(fh)`.","cause":"VolumeSystem received a file path (string) instead of a file-like object. The library expects a file-like object.","error":"AttributeError: 'NoneType' object has no attribute 'read'"},{"fix":"Verify the disk image is valid and contains a supported partition scheme. You can try specifying the volume type manually: `VolumeSystem(fh, type='gpt')`.","cause":"The provided file does not contain a recognizable volume system signature (e.g., GPT, MBR, LVM).","error":"ValueError: Unable to determine volume system"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}