A block device is a computer data storage device. It organizes data into fixed sized blocks that are typically 512 or 4096 bytes long. Data is indexed by a logical block address. Block storage devices are widely available, including spinning hard drives or solid-state devices. They may be used directly by applications or may have a filesystem or other data structure layered on top of them.
Questions tagged [block-device]
139 questions
0
votes
0 answers
Why is my block device being read so often?
I created a very simple device mapper device like in the code below. It just prints "Reading test device" whenever a read is performed on the device, and similarly it prints "Writing test device" when a write is performed.
If I now create the…

Jasper
- 302
- 3
- 11
0
votes
0 answers
how to start lvm merge in background using blockdev in C
I am trying to start a merge of a LVM snapshot using the blockdev API in C, similar to the “lvconvert —merge -b vg/lvsnap” OS command
The issue is that the merge starts, but it doesn’t go in background
The code waits for the completion of the merge,…

user413990
- 39
- 5
0
votes
0 answers
linx mmc-utils erase command not working as expect
I have a system that has an eMMC card on it, and I am trying to use the erase functioanlity defined in the eMMC specification (6.6.9 Erase) using the the mmc-utils user space tool.
The implantation correct to me. But when I run the command the erase…

John b
- 1,338
- 8
- 16
0
votes
1 answer
Can't mount mounted block device inside a container: "is not a block device"
I created a container with volume mount to /dev/xvda1:/dev/xvda1 but when I tried to mount it to a folder it doesn't work:
root@ubuntu:/# docker run -v /dev/xvda1:/dev/xvda1 --cap-add=SYS_ADMIN --security-opt apparmor=unconfined --security-opt…

E235
- 11,560
- 24
- 91
- 141
0
votes
0 answers
How to create a mapped device with a specific sector size?
I have implemented my own device mapper target and I am able to create a mapped device with dmsetup create command.
The problem is that the sector size for this device becomes the default 512 bytes, and I would like to change it to 4096 bytes…

Durgod
- 23
- 4
0
votes
1 answer
Need to detect any usb block device with specific partition label
I'm surprised this is proving to be difficult to find.
I need to detect when a USB block device with a specific partition label is added (plugged in) using python3.
Is there a way to use pyudev to provide a list of USB block devices? How can I…

Thomas Loves Tech
- 21
- 2
0
votes
1 answer
How to chage the status of Blockdevice to Active?
I have a couple of block devices in my pod and one of them is InActive. I want the both block devices to be active.
Currently the output looks like this:
>>> kubectl get bd
NAME NODENAME SIZE …

ParthS007
- 2,581
- 1
- 22
- 37
0
votes
0 answers
How to create a file based on the blocks
Recently I'm using nvme-cli to write the data to the block devices, the nvme write and read will allow the user to write to specific blocks. Unfortunately, they don't offer a write or read interface for file-level since maybe the user can just mount…

Tong Xing
- 11
- 1
0
votes
0 answers
How to change the block devices under /dev/block or /dev?
Block devices in different versions of the kernel,some under /dev ,others under /dev/block,how to change them under /dev or /dev/block? eg. /dev/loop0 and /dev/block/loop0.

Yejune Deng
- 13
- 1
0
votes
0 answers
What is the cmd field of the request structure in block layer replaced with?
I was going through the new kernel code and it looks like the cmd field in the request structure (defined in linux/blkdev.h) doesn't exist anymore. Here is what it looked it in earlier versions.
I am using that field to send a specific request…

Basim Sahaf
- 33
- 1
- 7
0
votes
0 answers
Understanding I/O disk accesses from docker container
As we know in docker there exists something like storage-driver (like devicemapper, overlay2 and so on).
There exists some thing that I don't understand:
Container can access to volume or its own filesystem.
How is it possible that docker storage…

dbs9654
- 13
- 3
0
votes
1 answer
qemu doesn't recognize block device file
I have a working QEMU image emulating an ARM vexpress-a9 and I run it like so:
sudo qemu-system-arm -m 512M -M vexpress-a9 -D qemu.log -d unimp -kernel buildroot-2019.02.5/output/images/zImage -dtb…

AjB
- 890
- 13
- 34
0
votes
0 answers
Do block devices (emmc partitions) have end-of-file marker?
I need to compute the sha1sum of an emmc partition and obviously this involves reading the contents of the partition (if at all it is relevant - the partition is ext4-formatted).
I am performing the read operation on /dev/mmcblkp** just like any…

sg1993
- 335
- 2
- 19
0
votes
1 answer
Non-block file systems
I was wandering if there is a filesystem that is non-block based.
Every system I know stores or retrieves chunks of fixed size (the blocks, or clusters).
Is there a filesystem that will allow to write or read a single byte, in the context of…

Jander
- 59
- 6
0
votes
1 answer
Block device - Initialize gendisk structure when not multiple of 512 bytes
I'm currently learning kernel driver programmation using Linux Device Drivers - 3rd.
To define a block device, I have to declare a gendisk structure and to initialize it with relevant informations.
In chapter 16 its written:
sector_t capacity;
The…

Arkaik
- 852
- 2
- 19
- 39