dissect.volume.vinum.config
¶
Module Contents¶
Classes¶
The representation of a Vinum Volume. |
|
The representation of a Vinum Plex. |
|
The representation of a Vinum SD. |
|
bytes(iterable_of_ints) -> bytes |
|
bytes(iterable_of_ints) -> bytes |
|
bytes(iterable_of_ints) -> bytes |
|
bytes(iterable_of_ints) -> bytes |
|
bytes(iterable_of_ints) -> bytes |
|
Vinum configurations. |
Functions¶
Return a single byte bytestring at index |
|
Yield individual tokens from a vinum config line. |
|
Parse the on-disk vinum configuration. |
Attributes¶
- dissect.volume.vinum.config.log¶
- class dissect.volume.vinum.config.Volume¶
The representation of a Vinum Volume.
A Vinum Volume defines a single RAID set. One or more Vinum Plexes can be part of a Volume.
- timestamp: datetime.datetime¶
- state: VolumeState | None = None¶
- class dissect.volume.vinum.config.Plex¶
The representation of a Vinum Plex.
A Vinum Plex can be thought of as one of the individual disks in a mirrored array. One or more Vinum SDs can be part of a Plex. The Plex defines the type of RAID in which these SDs are organized.
- timestamp: datetime.datetime¶
- stripesize: int | None = None¶
- class dissect.volume.vinum.config.SD¶
The representation of a Vinum SD.
A Vinum SD contains information about the actual physical disk and points to the device of this disk.
- timestamp: datetime.datetime¶
- length: int | None = None¶
- driveoffset: int | None = None¶
- plexoffset: int | None = None¶
- exception dissect.volume.vinum.config.ParseError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- class dissect.volume.vinum.config.BytesDefaultEnum¶
Bases:
bytes
,enum.Enum
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
- class dissect.volume.vinum.config.VolumeState¶
Bases:
BytesDefaultEnum
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
- DOWN¶
- UP = b'up'¶
- class dissect.volume.vinum.config.PlexState¶
Bases:
BytesDefaultEnum
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
- DOWN¶
- UP = b'up'¶
- INITIALIZING = b'initializing'¶
- DEGRADED = b'degraded'¶
- GROWABLE = b'growable'¶
- class dissect.volume.vinum.config.PlexOrg¶
Bases:
BytesDefaultEnum
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
- DISORG¶
- CONCAT = b'concat'¶
- STRIPED = b'striped'¶
- RAID5 = b'raid5'¶
- class dissect.volume.vinum.config.SDState¶
Bases:
BytesDefaultEnum
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
- DOWN¶
- UP = b'up'¶
- INITIALIZING = b'initializing'¶
- DEGRADED = b'degraded'¶
- GROWABLE = b'growable'¶
- dissect.volume.vinum.config.get_char(line: bytes, idx: int) bytes ¶
Return a single byte bytestring at index
idx
inline
.If the index is outside of the bounaries of
line
, an empty bytestring will be returned.
- exception dissect.volume.vinum.config.TokenizeError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- dissect.volume.vinum.config.tokenize(line: bytes) iter[bytes] ¶
Yield individual tokens from a vinum config line.
This token parser is constructed to be equivalent to the token parser used in the FreeBSD kernel code. There are a few caveats though:
it expects lines to be pre-splitted on newline and null-byte characters
it does not attempt to parse quoted tokens, as the code in the kernel parser is buggy and will always lead to an error condition (it will mimick the error condition though).
- class dissect.volume.vinum.config.VinumConfigs¶
Bases:
TypedDict
Vinum configurations.
- dissect.volume.vinum.config.RE_CONFIG_EOL¶
- dissect.volume.vinum.config.TOKEN_CONFIG_MAP¶
- dissect.volume.vinum.config.parse_vinum_config(config_time: datetime.datetime, config: bytes) VinumConfigs ¶
Parse the on-disk vinum configuration.
Parsing forgiveness and strictness is implemented in the same way as in the vinum kernel code:
Lines with an unknown configuration
type
(notvolume
,plex
orsd
), are ignored.- Lines that fail to parse due to:
no name present
no value present for a token
unknown token name
a tokenization error
will fail that line and the subsequent lines (rest of the config) to not being parsed.