Create virtual block device which writes to /dev/null

John Smith

I want to test some physical links in a setup. The software tooling that I can use to test this require a block device to read/write from/to. The block devices I have available can't saturate the physical link so I can't fully test it.

I know I can setup a virtual block device which is backed by a file. So my idea was to somehow setup a virtual block device to /dev/null but the problem is of course that I can't read from it. Is there a way I could setup a virtual block device that writes to /dev/null but just returns always zero when read?

Thank you for any help!

sourcejedi

https://wiki.gentoo.org/wiki/Device-mapper#Zero

See Documentation/device-mapper/zero.txt for usage. This target has no target-specific parameters.

The "zero" target create that functions similarly to /dev/zero: All reads return binary zero, and all writes are discarded. Normally used in tests [...]

This creates a 1GB (1953125-sector) zero target:

root# dmsetup create 1gb-zero --table '0 1953125 zero'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to create virtual device?

How do I create virtual ALSA device from which I can record everything that is played?

gstreamer create virtual device on OSX

Unable to create Android Virtual Device

Create a Pixel 4 Virtual Device

Unable to create Genymotion Virtual Device

Create virtual device in .asoundrc file

How to create a virtual MIDI device

How to Create Virtual Block Devices

How to create Hotspot in Android Virtual Device?

AVD Manager - Cannot Create Android Virtual Device

How to create an Android virtual device of a deprecated version

How to create virtual block devices from file?

Create block device link to target /dev/mapper

Create a web page which asks for some input and writes it to a file

How create a virtual io device in Linux that proxies data to real device?

Create a write-cache loop device for a much larger block device

Why IP address for Linux Bridge which is layer 2 virtual device?

How to know which is the real drive behind the mapped block device?

Is Block device aware of the actual user/process which initiates read/write?

Unaligned writes on block devices

Unable to create ARM virtual device on "Qt creator for Android".

How to create Android Virtual Device with command line and avdmanager?

Can't create Virtual Device on Android Studio on Mac

Failing to create Striped Backup with SQL VDI (Virtual Device Interface)

How to create a virtual audio device and stream audio input with it

Unable to create new android virtual device manager (AVD)

Android Device Monitor - Failed to create the java virtual machine

Unable to create Android Virtual Device in Android Studio 2.2 in Ubuntu