Thursday, May 21, 2020

Writing to dev null using the dev null block device driver

# modprobe null_blk
# ls -l /dev/null
null    nullb0

# ls -l /dev/nullb0
brw-rw---- 1 root disk 251, 0 May 21 07:30 /dev/nullb0

# dd if=/dev/zero of=/dev/nullb0 count=1024 bs=1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.460911 s, 2.3 GB/s

# dd if=/dev/zero of=/dev/nullb0 count=1024 bs=1M conv=fsync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.524639 s, 2.0 GB/s

# dd if=/dev/urandom of=/dev/nullb0 count=1024 bs=1M conv=fsync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 17.4459 s, 61.5 MB/s


Resource
https://www.kernel.org/doc/Documentation/block/null_blk.txt
https://www.kernel.org/doc/html/latest/block/null_blk.html
https://zonedstorage.io/linux/nullblk/

No comments:

Post a Comment