Questions tagged [block-device]

A data storage device that supports reading/writing data in fixed-size blocks, sectors, or clusters.

Filter by
Sorted by
Tagged with
0 votes
1 answer
39 views

Create symbolic links to block devices by partition table UUID

Within /dev/disk, there are the folders by-id, by-label, by-partlabel, by-partuuid, by-path, and by-uuid. Is there a way to make what software responsible for this create a directory called by-ptuuid ...
Melab's user avatar
  • 3,968
6 votes
2 answers
2k views

How does EXT4 handle sudden lack of space in the underlying storage?

Usually, block device drivers report correct size of the device, and it is possible to actually use all the "available" blocks. So, the filesystem knows how much it can write to such device ...
melonfsck's user avatar
0 votes
1 answer
50 views

How are block devices physically addressed in a file system

In this book, the following is mentioned about filesystem addressing: A file system does not need to concern itself with where on the physical media a block should be put, that is the job of the ...
user1234234's user avatar
8 votes
5 answers
1k views

How to programattically determine the device name/basename of the root partition?

Ref: The following question Drive name? What is the correct term for the "sda" part of "/dev/sda"? Given: I have a system, (in this case a Raspberry Pi, but this could be relevant ...
Jim JR Harris's user avatar
1 vote
1 answer
50 views

Get /dev entry for USB on a Mac

I have never used a Mac before and have no idea what I'm doing. I need to run dd on a USB device to copy data off. I plug the device in, and it shows up in system_profiler SPUSBDataType. How do I ...
Nate's user avatar
  • 144
3 votes
1 answer
55 views

Loop partitions disappear on rebind

When I create a 400MB file called /tmp/foo, then call losetup -f /tmp/foo, this creates a loop device /dev/loop15. If I then partition the loopdevice and format it to contain ext4,ntfs, and fat32 ...
mo FEAR's user avatar
  • 182
0 votes
0 answers
37 views

How to make a loopback device appear and behave as a (removable) block device?

If I create a loopback device, I can mount it manually, but it doesn't show up in Plasma "Disks & Devices" as a newly attached Storage Volume (Removable Media), nor does it appear as an ...
mo FEAR's user avatar
  • 182
1 vote
0 answers
30 views

Why doesn't accessing /dev/loopX raw update correctly (in real-time) when contents are modified?

If I create a file, such as /tmp/vdev (400KB in size and formatted to ext4) then map it to /dev/loop18, and then mount the /dev/loop18 to /tmp/mnt, and then create a text file under /tmp/mnt and write ...
mo FEAR's user avatar
  • 182
1 vote
1 answer
55 views

What is the difference between "filesystem readahead" and "readahead"?

From man 8 blockdev: The utility blockdev allows one to call block device ioctls from the command line. My question is about the following options: --getfra Get filesystem readahead in 512-byte ...
Kamil Maciorowski's user avatar
1 vote
1 answer
28 views

Why do /dev/ramX devices have all 0's in /proc/diskstats?

Is there away way to turn on IO accounting for /dev/ramX block devices in Linux? I already tried echo 1 > /sys/block/ram1/queue/iostat but it did not work. Notice that all devices have stats except ...
KJ7LNW's user avatar
  • 435
2 votes
2 answers
431 views

Are there any benefits in setting a HDD's logical sector size to 4Kn?

Modern HDDs all are "Advanced Format" ones, e.g. by default they report a logical/physical sector size of 512/4096. By default, most Linux formatting tools use a block size of 4096 bytes (at ...
ChennyStar's user avatar
  • 1,643
0 votes
1 answer
366 views

/var/lib/snapd/snaps/*.snap: can't open blockdev errors keep coming back despite several tries to remove totally snap

I'm running Ubuntu 23.10 on a I9 cpu + Nvidia Geforce RTX 2080 ti and the driver 545 right now. Everything works great,but not snap. I've tried to remove it as soon as I have installed Ubuntu from ...
Marietto's user avatar
  • 521
0 votes
0 answers
55 views

how to check if the IO was hanging

Are there any method I could use in centos to check if the block device under the IO was hanged? I tried to check the /proc/diskstats, but it is not obvious enough to show if there is an hang there. ...
lei wang's user avatar
1 vote
0 answers
41 views

Can I invalidate the buffer cache of a block device?

I have a system which is a USB gadget. It exposes one of its partitions over USB using functionfs to allow the host to provide update files: set -e CONFIGFS_ROOT=/dev/gadget CONFIGFS_DEV=$...
Toby Speight's user avatar
  • 8,628
0 votes
0 answers
37 views

Searching a 1T block device for a specific byte sequence at a specified offset

I'm performing data recovery after an accident with dd. In the longer term, I'll need to use some recovery tools to try and repair the file system In the meantime, there's an image on the system that ...
user587941's user avatar
0 votes
1 answer
68 views

Question on tuning file system cache in Linux UBIFS on MTD

I am working on an embedded Linux system, where kernel is 5.10.24, and UBIFS on MTD is used. The testing team had a test, which writes a disk file (open, write, close in order), then powers system off....
wangt13's user avatar
  • 396
0 votes
1 answer
30 views

Schedule IO problem via udev by-id

As the title, i'm trying to set the scheduler from boot by inserting the various disks using the udev rules. The problem is that indicating the disk by id (/dev/disk/by-id) in the udev rules (in the ...
vincenzogianfelice's user avatar
0 votes
2 answers
93 views

How can I find the device file for a phone, so that I can mount it on my Linux?

I connect a phone to my Linux laptop using USB. I click File Transfer option in the pop-up window on the phone. In order to mount the phone on my Linux, I have to find the block device on my Linux. I ...
Tim's user avatar
  • 101k
1 vote
0 answers
87 views

How do I write a kernel driver for a custom partition table format?

I have a number of hard disks that use a proprietary partitioning system. The disks don't contain partition tables themselves, but each have a known number of partitions at fixed positions with fixed ...
User's user avatar
  • 111
0 votes
1 answer
246 views

What is the difference between these two blockdev declarations?

In Debian bullseye, I am starting virtual machines using QEMU / KVM by command line (i.e., without virsh or other helpers / wrappers). One of those VMs starts from a block device that is declared as ...
Binarus's user avatar
  • 3,320
1 vote
1 answer
108 views

Partial fsyncs when writing to block device

I'm writing my own data store directly on top of a block device. To ensure durability I want to sync to disk. But here's the thing: I want to sync only part of it. I'm keeping a journal for crash ...
Jille Timmermans's user avatar
0 votes
2 answers
156 views

Problem with block devices for virtual machines

I have two block devices in my host that I am trying to pass to a VM guest. One works perfectly while the other does not. The only difference is one is a logical volume on an internal drive while the ...
StrongBad's user avatar
  • 5,251
1 vote
1 answer
628 views

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 ...
Dachuan Huang's user avatar
1 vote
1 answer
2k views

Can't disconnect nbd device

I made an .qcow2 image and mounted it as described here: https://bytefreaks.net/gnulinux/how-to-mount-a-qcow2-disk-image-that-does-not-contain-an-ubuntu-lvm-installation But I have a problem with the ...
MijatTomić's user avatar
1 vote
2 answers
70 views

zsh completion: complete block devices in /dev

for my script, I need to complete block devices in /dev, so that when I do my_script.sh <TAB> it will complete /dev/ and offer me all disks that are listed in /dev (not in subdirectories). So ...
Martin Vegter's user avatar
0 votes
0 answers
33 views

Conflict with multiple SDcard readers of the same brand connected at the same time

I have some Lexar UHS-II card readers (I believe the model is LRWM05U-7000), and when I connect more than one I realize some operations read/write from/to the wrong reader. Some apps do not even ...
TonyStacker's user avatar
31 votes
11 answers
3k views

How can I protect /dev/sdX against accidental formatting?

I am very often dealing with formatting USB drives, that are registered as /dev/sdX. This includes executing mkfs and fdisk and mount and other commands usually executed as root. However, I fear that ...
KamilCuk's user avatar
  • 860
0 votes
0 answers
38 views

debugfs mi output shows different block count than the number of block references!

I have a file for which the the mi (modify inode) option gives different block count and block references : debugfs: mi <4762313> Mode [0100644] ...
Sam's user avatar
  • 1
1 vote
1 answer
326 views

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's user avatar
  • 960
2 votes
0 answers
54 views

Can systemd be used to dynamically set a system-wide write bandwidth limit for a block device?

I would like to dynamically set a system-wide limit on the write bandwidth for certain block devices. The devices are pluggable and managed by our own service. Currently the service sets/removes the ...
starblue's user avatar
  • 616
2 votes
0 answers
1k views

Why is DM-Integrity so slow compared to BTRFS?

I want to detect silent corruption of block devices similar to how BTRFS does that for files. I'd even like to do that below BTRFS (and disable BTRFS's native checksumming) so that I can tweak more ...
ATLief's user avatar
  • 299
1 vote
1 answer
956 views

What is the impact of different Linux I/O APIs on performance benchmarking of NVMe SSDs? (libaio vs SPDK vs io_uring)

I am benchmarking NVMe SSDs on my Linux server, with the aim to achieve the IOPS, BW and Latency values as mentioned in the product specifications. I'm using FIO as workload generator, and used libaio ...
Jaideep Khare's user avatar
0 votes
1 answer
198 views

iSCSI target implementation is User Space

I want to write my own implementation of iSCSI target where in I want to interrupt read/write calls to block device and serve them from my custom storage implementation. Is there any default library(...
Uday Swami's user avatar
0 votes
1 answer
56 views

Is there any OS-level caching for bare block devices? If so, how do I bypass it?

If I read and write directly to a block device (e.g. /dev/sda1), is there any OS-level caching involved on Linux? If so, how do I bypass it, is opening with O_DIRECT enough? I'm writing a simple ...
JanKanis's user avatar
  • 1,049
1 vote
0 answers
297 views

Is it safe to change read ahead setting on a live server

After going through Elasticsearch's documentation I realised that the recommended read ahead value is 128KiB while I am currently using 256KiB on a live server. It is only indexing data and not ...
Nick Garlis's user avatar
0 votes
0 answers
568 views

How can I order /dev/sdX block devices names by hardware path on Linux?

I know about persistent block device naming, using /dev/disk/by-{id,path,uuid,...} and how it is best practice to use those persistent names in system config (fstab, scripts) instead of /dev/sda for ...
Totor's user avatar
  • 19.9k
1 vote
2 answers
661 views

Can device numbers change after reboot?

I'm building a service that checks for file uniqueness on block devices. File uniqueness on a system appears that it can be guaranteed through the pair (st_dev, st_ino), where st_dev is the device ...
dlq's user avatar
  • 121
1 vote
0 answers
304 views

udev - nr_requests on block device not applying on boot but all other rules run correctly

My Rules KERNEL=="sd*",ACTION=="add|change",ATTRS{model}=="PERC_H755N_Front",\ ATTR{queue/nomerges}="2",\ ATTR{queue/nr_requests}="...
Grant Curell's user avatar
0 votes
2 answers
659 views

How do I find out what is the hard disk for OS in Linux

in our bash scripts , we have many places in the code that need to capture only the disk that related to OS ( operation linux/RHEL system ) we are using Linux versions as 7.2/7.5/7.6/7.9 , and on most ...
yael's user avatar
  • 13.1k
0 votes
1 answer
153 views

ioctl problem with partition

There is a path to the file, I make a write disk cache request via ioctl - ioctl(fd, SG_IO, &ioHdr). printk: sending ioctl 2285 to a partition!? how to find out which block device a partition ...
unite101010's user avatar
0 votes
0 answers
184 views

udev not generating /dev/disk directory in yocto linux build

I have built a yocto linux image for a SAMA5 board. After I booted, udev did not generate the /dev/disk/ directory and related symlinks. I already have udev and systemd in the system. $ udevadm --...
Arun Cheriyan's user avatar
1 vote
1 answer
2k views

On Linux, is it possible to know if disk size was changed without rescanning the disk?

After changing a disk size in VMware (for example increasing it by 10 more GB), the next step is to rescan it in Linux so that kernel identifies this size change. For this we use this command: echo 1&...
yael's user avatar
  • 13.1k
0 votes
1 answer
475 views

is mount option "sync" valid for all filesystems

I want to have an script that automatically mounts all USB drives on insert (granted they have a block/filesystem that is a valid partition). My questiosn is: is sync an option that can be applied to ...
DEKKER's user avatar
  • 906
0 votes
0 answers
364 views

Getting "erase_size" related error when mounting a jffs2 rootfs into a block device

Trying to mount a jffs2 image into a virtual block device, following this guide The steps are as follows, summarized: sudo mknod /tmp/mtdblock0 b 31 0 sudo modprobe mtdblock sudo modprobe mtdram ...
DummyBeginner's user avatar
0 votes
0 answers
637 views

iostat returns disk utilization greater than 100% while profiling a Beaglebone Black board

I need to profile the performance of software running on a BeagleBone Black (BBB). The BBB has an ARM Cortex-A8 up to 1GHz frequency, 512MB RAM, and 4GB eMMC onboard flash storage. You can find more ...
vnzstc's user avatar
  • 1
0 votes
1 answer
173 views

Mount filesystem with DAX enabled on RAM

I am trying to mount a filesystem with DAX feature on RAM. I used this answer to load brd module and get /dev/ram0. Then I tried all 3 filesystems that support DAX: ext2, ext4 and xfs. However, when I ...
Ana Khorguani's user avatar
21 votes
4 answers
4k views

What is `/dev/sda0`? Is it a standard thing?

While trying to understand this other question, I encountered /dev/sda0 being mentioned. I have some experience in Linux and I'm used to this scheme where sda, sdb, … are devices and sda1, sda2, … , ...
Kamil Maciorowski's user avatar
1 vote
1 answer
761 views

Backup created with rsync takes up more space on external drive than on source

I am using rsync to make a backup of Ubuntu running on a Raspberry Pi. I exclude all the usual directories whose contents are only created after boot up anyway. The rsync writes to a backup image that ...
FlexMcMurphy's user avatar
0 votes
2 answers
606 views

USB connection from display detected as storage device

I have an MSI Optix MAG245R 23.8" display. It features USB connections. When I start up my Debian-based machine (BunsenLabs), I get warnings that say: May 4 19:41:51 localname kernel: [ 240....
Kit's user avatar
  • 1,043
1 vote
2 answers
763 views

How to check if a LUKS device is unlocked, without sudo permissions?

Is there any way to check if a LUKS device is unlocked, without having sudo permissions? I'm aware of two questions, but all the answers require sudo. It seems that I've found an indirect way (...
Marcus's user avatar
  • 951

1
2 3 4 5
9