Documentation
¶
Index ¶
- func IsCapable() bool
- func WithLogger(log *plog.Logger) funcopt.O
- type Sizes
- type T
- func (t T) Activate(ctx context.Context) error
- func (t T) AsBlkID() (string, error)
- func (t T) ContainsUUIDOrName(buff string) bool
- func (t *T) Create(ctx context.Context, level string, devs []string, spares int, layout string, ...) error
- func (t T) Deactivate(ctx context.Context) error
- func (t T) DevOverhead(ctx context.Context, devpath string) (int64, error)
- func (t T) Devices(ctx context.Context) (device.L, error)
- func (t T) DisableAutoActivation() error
- func (t T) Exists(ctx context.Context) (bool, error)
- func (t T) IsActive(ctx context.Context) (bool, string, error)
- func (t T) IsAutoActivated() bool
- func (t T) Remove(ctx context.Context) error
- func (t T) Resync(ctx context.Context) error
- func (t T) SetSize(ctx context.Context, perDev int64) error
- func (t T) Sizes(ctx context.Context) (Sizes, error)
- func (t T) String() string
- func (t T) UUID() string
- func (t T) Wipe(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sizes ¶
type Sizes struct {
// Level is the raid level, to say which array cannot do what.
Level string
// State is what mdadm reports the array is: "clean", "active", and
// what it is missing or busy with when it is either of those and
// something else. An array is grown once it is whole, so this is what
// says whether it is.
State string
// Array is what the array device holds.
Array int64
// UsedDev is what the array uses on each member device. The array
// size divided by it is the number of members the size is made of:
// one for a raid1, n-1 for a raid5, n-2 for a raid6, n/copies for a
// raid10. Measuring it is how the rule of every level and every
// raid10 layout is had without enumerating them.
UsedDev int64
// Chunk is the stripe unit, which a member size has to be a whole
// number of on a striped level.
Chunk int64
}
Sizes are what an array hands out, what it uses on each of the members it hands it out from, and what it is doing while it does.
func (Sizes) IsWhole ¶
IsWhole says the array holds every member it is made of and is doing nothing to the space it already has.
mdadm grows a degraded array without a word, and the space that adds is as unprotected as the array it is added to: a raid5 missing a member grows onto members that have no parity for the new space and no member to rebuild it from. An array rebuilding, resyncing or reshaping is busy with what it holds, and is not asked for more while it is.
type T ¶
type T struct {
// contains filtered or unexported fields
}
func (T) ContainsUUIDOrName ¶
func (T) DevOverhead ¶
DevOverhead is what the array keeps on a member before the data it hands out: its superblock, and the room left for a bitmap to grow into.
It is read from the metadata written when the array was made, so it does not change when a member grows. The gap between what a member holds and what the array uses on it would: a member grown ahead of the array reads as all overhead, and asking for it again compounds every pass.
func (T) DisableAutoActivation ¶
func (T) IsAutoActivated ¶
func (T) SetSize ¶
SetSize sets the bytes the array uses on each of its member devices, which is how it is grown onto members that have grown.
It does not reshape: the members and the level stay as they are.