Steadybit logoResilience Hub
Try SteadybitGitHub icon
Steadybit logoResilience Hub

Fill Disk

Attack

Attack

Writes data to the disk.
Install now

Fill Disk

Writes data to the disk.
Attack

Attack

Targets:

Hosts

Install now

Fill Disk

Attack

Attack

Writes data to the disk.
Install now

Fill Disk

Writes data to the disk.
Attack

Attack

Targets:

Hosts

Install now
Go back to list

Introduction

Fill the host's disk with random data for a given duration.

Prerequisites

If you are not using our container images for the extension, you must install the tools df and fallocate (for 'at once' mode) and dd (for 'over time' mode) to use the attack.

Use Cases

  • Test your system's behavior when there is no free space left on the disk
  • Validate how much free disk space is needed to run your system reliably

Parameters

ParameterDescriptionDefault
DurationHow long should the disk be filled?30s
ModeDecide how to specify the amount to fill the disk:
overall percentage of filled disk space in percent,
Megabytes to write,
Megabytes to leave free on disk
overall percentage of filled disk space in percent (PERCENT)
SizeDepending on the mode, specify the percentage of filled disk space or the number of Megabytes to be written or left free.80
PathPath where the file should be written/tmp
MethodShould the disk be filled all at once (using fallocate) or gradually over time (using dd)?at once (AT_ONCE)
Block SizeOnly applicable for method over time (dd): The block size when writing the file. If the block size is larger than the size value, the attack uses the size value as the block size.5

Frequently Asked Questions (FAQs)

Q: What is the difference between the available modes?

A: The disk fill attack differentiates between two modes (at once and over time). Read further to understand the difference and which is the best choice for you.

Mode 'at once' The mode is perfect if you want to check how your system behaves when the disk is almost full, and you don't need to simulate a gradual decrease in free space. However, if you want to write more than 100% of the disk space, the gradual approach (see below) might be a better fit as it works more reliably. The mode uses the fallocate Linux command, which allocates the disk space without writing actual data and, thus, results in the disk filling up very fast.

Mode 'over time' The over-time approach is perfect when you want to simulate a more realistic case of a gradually filling disk or need to fill the disk more than available space. The mode uses the dd command, which writes actual data (zeros) to the disk and is thus slower than the at-once approach (see above).

Q: How is the number of free megabytes on disk calculated?

A: The attack uses the following formula to ensure that the specified megabytes are left free on the device (defined by the size parameter):

diskSpace.Available - size * 1024

Where

  • diskSpace is the output of df -kP <filepath>
  • size is the amount of megabytes to leave free on disk

Q: How is the percentage of filled disk space calculated?

A: The attack uses the following formula to calculate how many kilobytes need to be written based on the configured percentage (defined by the size parameter):

diskSpace.Capacity * size / 100 - diskSpace.Used

Where

  • diskSpace is the output of df -kP <filepath>
  • size is the configured percentage of the disk space to be writen

Q: How can I check whether the disk is full?

A: Use the command df -h to check if the disk is full.

Q: Why is my disk not filled up to the specified value/percentage even though the attack was executed without errors?

A: The attack calculates the amount to write only once at the beginning of the attack using the formulas mentioned above. If other processes cause the used disk space or overall capacity to vary while running the attack, you may have a higher or lower filled disk percentage. Also, the 'over time' approach works more reliably if you need to write more to the disk than available space.

Statistics
-Stars
Tags
Host
Kubernetes
Homepage
hub.steadybit.com/extension/com.steadybit.extension_host
License
MIT
MaintainerSteadybit
Install now

More Host Actions

See all
Block DNS

Blocks access to DNS servers

Attack

Attack

Hosts

Start Using Steadybit Today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Steadybit logoResilience Hub
Try Steadybit
© 2024 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon