mfshdd.cfg
The file that says which directories a Chunkserver stores chunks in, and how much space it may use there. One line is one entry. Lines starting with # are comments.
[PREFIX]PATH [SPACE OPTIONS]
Prefixes
A path may start with one or more of these characters.
| Prefix | Meaning |
|---|---|
* | This hard drive is 'marked for removal' and all data will be replicated to other hard drives (usually on other chunkservers). |
< | All data from this hard drive should be moved to other local hard drives. |
> | All data from other local hard drives should be moved to this hard drive. |
~ | Significant change of total blocks count will not mark this drive as damaged (designed mostly for use with compressed filesystems). |
If there are both '<' and '>' drives defined, then data will be moved only between these drives.
Path
PATH is the obligatory part, it's a regular filesystem path to a mount point or directory, where chunkserver should keep the chunk files.
Space options
A space option can be:
- a positive space limit, indicating a space limit definition (i.e. only this amount of space on the indicated path should be used for chunk storage)
- a negative space limit (starting with minus sign), indicating a reserved space definition (i.e. at least this amount of space should always be left free on the indicated path)
- an equals '=' sign, optionally followed by a space limit indicator
Space limit can be either a defined amount of space (format: [0-9]*(.[0-9]*)?([kMGTPE]|[KMGTPE]i)?B?) or a percent of total device size. An equals sign indicates, that a disk is "shared" with another process (either another chunk server process or an unrelated process) and the amount of space used on the disk is not necessarily indicative of the amount of space used by chunks. Additionally, an indicator of a space limit can be defined. Percent says how many percent of the available disk space should be considered as available for the chunkserver. Size says how much exact space should be considered as available for the chunkserver. If the percent or space are negative, then we define the unavailable amount of space instead. For a more detailed description of space limits and how total and available space are calculated when a space limit is used refer to mfshdd.cfg(5) man page.
Space a Chunkserver reports
Available space depends on the space option used on the path. total_hdd is the size of the device without the blocks the filesystem keeps for root. avail_hdd is the free space a non-root user can use. calc_size is the space the chunks on this path take. With a space option, reported total space is the reported available space plus calc_size. With no space option, reported total space is total_hdd. Where the formula names HDD_LEAVE_SPACE_DEFAULT, the Chunkserver subtracts the space it keeps free on every drive. The option sets that space in mfschunkserver.cfg and is 256MiB unless you change it.
| Space option | Reported available space |
|---|---|
| No space option | avail_hdd - HDD_LEAVE_SPACE_DEFAULT (or zero if the reserve is larger) |
| Constant reserved space (negative space limit -X) | total_hdd - X - calc_size (or zero if X + calc_size > total_hdd) |
| Percent of reserved space (negative space limit -X%) | total_hdd - total_hdd*X/100 - calc_size (or zero if total_hdd*X/100 + calc_size > total_hdd) |
| Constant space limit (positive space limit X) | X - calc_size (or zero if calc_size > X) |
| Percent space limit (positive space limit X%) | total_hdd*X/100 - calc_size (or zero if calc_size > total_hdd*X/100) |
| Shared space indicator (= sign) | avail_hdd - HDD_LEAVE_SPACE_DEFAULT (or zero if the reserve is larger) |
| Shared space indicator and space indicator (=X) | X (or avail_hdd if avail_hdd < X) |
| Shared space indicator and percent indicator (=X%) | avail_hdd*X/100 |
| Shared space indicator and negative space indicator (=-X) | avail_hdd - X (or 0, if X>avail_hdd) |
| Shared space indicator and negative percent indicator (=-X%) | avail_hdd - avail_hdd*X/100 |
Examples
| Entry | Meaning |
|---|---|
/mnt/hdd | Use hard drive '/mnt/hdd' with default options. |
*/mnt/hdd | Use hard drive '/mnt/hdd', but replicate all data from it. |
/mnt/hdd -5GiB | Use hard drive '/mnt/hdd', but try to leave 5GiB free on it. |
/mnt/hdd -10% | Use hard drive '/mnt/hdd', but try to leave 10% space free on it. |
/mnt/hdd 1.5TiB | Use hard drive '/mnt/hdd', but use only 1.5TiB on it. |
/mnt/hdd 60% | Use hard drive '/mnt/hdd', but use only 60% of its total space. |
/mnt/hdd = | Use hard drive '/mnt/hdd', but treat it as a 'shared' drive. |
/mnt/hdd =60% | Use hard drive '/mnt/hdd', but treat it as a 'shared' drive, consider 60% of total avail space on the device as this drive's avail space. |
/mnt/hdd =50GiB | Use hard drive '/mnt/hdd', but treat it as a 'shared' drive, always assume that this drive has at most 50GiB available space. |
/mnt/hdd =-20% | Use hard drive '/mnt/hdd', but treat it as a 'shared' drive, consider 20% of total avail space on the device as not really available. |
/mnt/hdd =-50GiB | Use hard drive '/mnt/hdd', but treat it as a 'shared' drive, assume the total avail space on the device is smaller by 50GiB. |
>/mnt/hdd | Use hard drive '/mnt/hdd', but fill it up using data from other drives. |
</mnt/hdd | Use hard drive '/mnt/hdd', but move all data to other hard drives. |
~/mnt/hdd | Use hard drive '/mnt/hdd', but ignore significant change of hard drive total size (e.g. compressed file systems). |