A data storage device that supports reading/writing data in fixed-size blocks, sectors, or clusters.
Questions tagged [block-device]
449 questions
62
votes
2 answers
What is a block device?
I know many examples of block devices (HDDs, SSDs, files, ...), but I haven't heard a simple definition of it. Especially since files are apparently included in the definition I feel a bit confused...

lindhe
- 4,236
- 3
- 21
- 35
10
votes
3 answers
Virtual block device
I'm not sure what I should be googling or if FUSE does this (I suspect not). I'd like to create a virtual block device for which all forms of access, for example reads and writes, go directly to my app.
I know I can create a file be used as a block…
user4069
9
votes
3 answers
how to set block size using blockdev command
Anyone can provide me any test case for the below command:
blockdev --setbsz BYTES to set/change the block size.
I have tried like below but no luck.
$ blockdev --setbsz 2048 /dev/sda5
blockdev: 2048: No such file or directory

sameer pradhan
- 223
7
votes
3 answers
what is the etymology of `loop device`
What is the etymology of the term loop device
Description: Wikipedia: loop device

H2ONaCl
- 202
5
votes
1 answer
What tool to visualize linux block devices (partitions, LVM PVs, LVs, mdadm devices…)
I'm looking for a tool that will scan my GUI-less server and create an easy to digest rough overview of all the block devices and their relationship (disk partitions, mdadm devices, LVM PVs & LVs etc) in some rich visual format (html, pdf, svg,…

ndemou
- 2,809
2
votes
1 answer
Is there any tool in Linux to track the amount of read/write requests to a block device in the past hour?
I am conducting a performance experiment for a Linux program that takes input data, processes it, and writes data to a block device
Even though I know how much data the input is (for example, 1GB), I do not know exactly how much data is written to…
2
votes
2 answers
How do I get losetup -a to behave?
# losetup /dev/loop0 /tmp/tmpuUwgbn
# losetup -a
# losetup -f
/dev/loop1
# losetup /dev/loop0
/dev/loop0: [0806]:33654 (/tmp/tmpuUwgbn)
# ls -la /tmp/tmpuUwgbn
-rw------- 1 root root 0 2011-08-24 15:49 /tmp/tmpuUwgbn
# losetup -a
#
Why doesn't…

Lauritz V. Thaulow
- 3,519
1
vote
1 answer
Why is the size of a block device always zero?
Why is the size of /dev/sda always zero?
You have to run commands like:
blockdev --getsize64 /dev/sda
or
cat /sys/class/block/sda/size
to get the size. You cannot use ls.
What is the reason for that?

zomega
- 972
1
vote
0 answers
Why are loop0 and ram1 getting mixed up?
I've been rolling my own "minimal" linux system under WMware based on the 5.15.x kernel. I don't use an initramfs but do include support for the default max 16 ramdrives in the kernel build config. Everything works great. For fun I decided to mount…

Okhariatane
- 111
0
votes
1 answer
At /dev/block directory, what's meaning of file name like 8:0 or 11:0?
There's a bunch of symbolic links in /dev/block directory.
And I figured out that they're pointing block device files in /dev.
I wonder meaning of their names(8:0, 8:1, 11:0, 11:1, ...)

jmiry
- 35
- 1
- 7
0
votes
3 answers
How to tell if a block device is the same as one previously connected?
I have a block device. It is removed from the system and later added again. How can I verify that it is exactly the same device?
The device will always be a mass storage device (which I'm not planning to write to and will only mount read-only).
I…

Owen Pauling
- 203
0
votes
1 answer
block device usage and several mount points
There is some weird thing I don't understand:
I have 2G block.img file with an ext4 filesystem inside. There is a 2G test.txt file in block.img. test.txt consists of letters 'a'.
Then I mount block.img to /mnt/first. And I can see this test.txt…

rush
- 27,403