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
1answer
32 views

Do almost all ext4 filesystems have 4KiB blocks?

Many sources, such as https://www.commandlinux.com/man-page/man8/mkfs.ext4.8.html read: ...block-size is heuristically determined by the filesystem size... What is this heuristic? In which source ...
0
votes
1answer
12 views

Common Features among Multiple RAMDisks Created Using modprobe brd

I wanted to create a 60GB RAMDisk to check the read and write performance of it. Using the command modprobe brd rd_size=62914560, 16x 60GB RAMDisks have been created: /dev/ram0, /dev/ram1, ..., /dev/...
0
votes
1answer
7 views

How to specify the right device names when using Ignition for installing Flatcar Linux?

I am currently using Container Linux for my home server and I want to upgrade to Flatcar Linux. To do this I plan to use Ignition and configure RAID 1 for the root filesystem. I have two disks ...
0
votes
2answers
36 views

mount + mount: special device /dev/sdX does not exist

we have rhel server version 7.5 and from lsblk we can see only the following disks , and all disks are with ext4 filesystem lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda ...
0
votes
2answers
34 views

Multiple Threads Cannot Access the Same RAMdisk Created by modprobe

I have created RAMdisks of 60GB using modprove brd rd_size=62914560 on CentOS 7.5. Checking the results, fdisk -l /dev/ram* shows 16 ram block devices of 60GB size (/dev/ram0, /dev/ram1, ..., /dev/...
0
votes
1answer
13 views

get pids/locks for lvm - source for opencount on dmsetup info

# dmsetup info Name: ubuntu--vg-root State: ACTIVE Read Ahead: 256 <---- cat /sys/dev/block/253:0/bdi/read_ahead_kb gives 128 not 256 Tables present: LIVE Open ...
0
votes
0answers
51 views

blkid doesn't doesn't print the device name on CentOS

I am running a container with CentOS: docker run -it centos bash I first check for its Label or UUID: [root@3271c071fe0a /]# cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-5.3.0-1032-aws root=LABEL=...
0
votes
1answer
29 views

Determine if a given path is on a removable device, even if encrypted, via bash script

/path/to/directory/ is a path that points within an encrypted volume, to an arbitrary depth. In a bash script I need to determine if the block device related to this path is a removable device. I'm ...
0
votes
2answers
25 views

How do I get the linux kernel to track io stats to a block device I create in a loadable module?

I've been looking and looking and everybody explains the /proc/diskstats file, but nobody seems to explain where that data comes from. I found this comment: Just remember that /proc/diskstats is ...
0
votes
0answers
8 views

NVRAM block device driver through SPI

I have NVRAM device FM25CL64B-G on a board (flash memory device). The board use cpu OSD3358-512M-BSM. The device is controlled by SPI. The OS is Debian GNU/Linux 9. I write to the device through SPI ...
1
vote
0answers
76 views

Can't run fsck or format device - device is in use

today I crashed my boot partition. While is normally no problem due backups, I can't write to the partition anymore. root@hades ~ # touch /boot/a touch: cannot touch '/boot/a': Structure needs ...
0
votes
0answers
22 views

Are /dev/i2c-1 and /dev/mem colliding?

I write a program which should handle a motion sensor and an ultrasonic sensor at the same time. I'm using a Jetson Nano with 40 GPIO-pins. The first one uses I2C interface and thus accesses /dev/i2c-...
0
votes
0answers
13 views

Test case for Deadline IO Scheduler

I am trying to measure the impact of Deadline IO scheduler on the performance of Block IO. My setup includes: Kernel Version: 4.4.154 Storage device: eMMC 64GB Distribution: VERSION="18.04.4 LTS ...
0
votes
0answers
22 views

Check if Block Device Has Been Used Since Last Factory Reset

How do I check if a block device has any useful data on it? Is this even possible to determine programmatically? I care about SD cards specifically, though I'm sure the same or similar rules could ...
2
votes
0answers
20 views

Suspend devmapper target when underlying device removed

If you create a table with dmsetup and the underlying device gets forced removed, the target will begin to throw I/O errors. Is there any way to specify that the target should suspend itself if any of ...
3
votes
1answer
31 views

Can we know which logical blocks are in used without understanding the filesystem running on top?

From this FAQ: Why Clonezilla can NOT restore an image which is saved from a large drive to a smaller drive? Any workaround? It's not easy to implement such a feature, since Clonezilla now is a ...
0
votes
0answers
21 views

Can Postgres data_directory be Moved to Block Storage on OpenBSD?

Trying to figure out if we can switch Operating System from Linux (Ubuntu) to OpenBSD. Moving the Postgres data_directory to the Block Storage works flawlessly on Ubuntu/Debian e.g: https://www....
0
votes
1answer
37 views

How do I discover the remaining space on disk image FAT32 partition?

Given the current Debian installer hd-media boot image files, how do I find out how much free space is remaining within the contained FAT32-formatted partition? Here's what I have so far: $ curl -...
1
vote
0answers
22 views

OpenStack machine mounting first volume as /dev/vdc

I have a virtual machine in an internal OpenStack environment. Today, it started misbehaving when a volume is removed and re-attached. In the following, the first two are correct, but the third is not:...
0
votes
0answers
26 views

How to set Lower Limit for Throttling mechanism in blkio-controller?

Prior to Linux Kernel v 4.12, Block Throttling mechanism included throttling the Read/Write speed at a LIMIT_HIGH value. This value could be set by /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device /...
5
votes
2answers
482 views

Creating RAID arrays on files instead of block devices

Is it possible to create a RAID array on files for testing purposes? Suppose I want to create a level-1 RAID and I don't have for example 10 block devices to do that but instead I want to simulate ...
1
vote
1answer
19 views

What is the most efficient way to search a block device for valid (filesystem) superblocks?

I have a block device that contains some valid filesystem (including the main and backup superblocks) at some unknown offset with some unknown block size. In my case I happen to know that it's an ext4 ...
3
votes
0answers
80 views

Why does 'tail -c 10K' cause it to read an entire 16GB flash drive?

To view the last 10K of a 128GB internal SSD I used: sudo tail -c 10K /dev/sda | xxd This worked as expected and immediately output the data. However when I try to view the last 10K of a 16GB USB ...
1
vote
0answers
250 views

How dangerous is “Free blocks count wrong”?

I ran fsck in read-only mode and got some errors like this : Free blocks count wrong (5597728, counted=5231480). Fix? no As stated here : Free Block Checks Free blocks are stored in the cylinder ...
4
votes
1answer
289 views

Do Linux filesystems inform the block device when blocks are no longer required?

Traditionally storage devices (hard drives) were assumed to have no mechanism to "delete" data beyond simply overwriting it. I can see a few theoretical scenarios where it would be useful for block ...
0
votes
1answer
44 views

Use disk like tape

We are building a data archiving system where we want to have the option to store redundant copies of data on different storage types: tape/disk/cloud, and also with the option of using different ...
0
votes
1answer
46 views

How does docker prevent root from reading from block device?

I'm trying to understand Linux container security. I have a docker container running with a root shell in it. The container does not have block devices visible in /dev, but I can create them with ...
0
votes
0answers
21 views

Search for a hex pattern throughout a volume

The inode table of my USB device was removed (/dev/sda). I am hoping to recover a file that contained a unique string which in hex format is: "6d 61 79 32 30 32 30" Is it possible to search ...
0
votes
1answer
36 views

Each file on my external SSD occupies at least 1MB, no matter how small. How can I change this?

I have a Sandisk USB SSD connected to a server (I don't know the exact model and I can't find it from lsusb -v). Whenever I create a file of nonzero size, it occupies 1M space according to du. $ echo ...
0
votes
2answers
42 views

Allow normal users writing to intermittent block devices

I currently do a lot of copying disk images to and from hard disks. They are normally connected via USB. Normally block devices cannot be written to by normal users, so I do everything as root. I am ...
0
votes
1answer
23 views

Mount virtual disk device and access to it without being root

I am trying to create a virtual disk to share data with a VirtualBox VM not connected to the Internet. I proceed like follows qemu-img create -f qcow2 hdd.img 2G sudo modprobe nbd max_part=16 sudo ...
2
votes
1answer
104 views

How well do concurrent writes scale with io_uring?

Background: I'm very intrigued by the potential performance gains of io_uring, but I don't have enough familiarity with C, the Linux kernel, or the inner workings of block devices to implement ...
0
votes
2answers
2k views

fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/md0

I have a raid5 which is inaccessible after unexpeted power outage. Details: # cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] md0 : active ...
1
vote
1answer
13 views

Skipping device labels when not unmounting correctly

I noticed that when I mount a usb-drive (for example from /dev/sdb) and then unplug it without unmounting it before, the next time I plug I in, it registers as /dev/sdc without anything else connected....
1
vote
1answer
158 views

What do the Block Device Capability flags mean?

Linux block devices in sysfs have a capability file, partly documented here. Well, one is documented. Looking in genhd.h as it suggests, there are others. Is there any documentation on them, or does ...
0
votes
3answers
412 views

Mount a block device as a regular file

Preamble Suppose I have an encrypted partition of 1TB on machine A containing the home directories of a dozen users, let's call this partition sda2. I want to backup that partition on a remote ...
1
vote
1answer
180 views

Calculate disk Byte size exclusively from /sys/block/

If we want to get the byte size of a block device or one of its partitions without calling any binary, and in a way that will always work, is it correct to do: /sys/block/sda/sda1/size or /sys/block/...
1
vote
0answers
984 views

Nvme not showing up in /dev on Ubuntu 19.04 (5.0.0-13)

I have an Ubuntu 19.04 on a machine with an nvme drive. However, the drive is not found in /dev/nvme*. cat /proc/devices shows that nvme is loaded as a character device and not a block device and ...
2
votes
1answer
305 views

Convert existing LVM LV to bcache backing device

How do I convert an existing LVM LV to a bcache backing device? The official tool for converting an existing device to bcache is blocks, but it hasn't been updated since December 2014. At a minimum, ...
8
votes
1answer
1k views

Passing a block device to Qemu

Passing a block device to Qemu 3.0.1 like this works but yields a deprecation warning: -blockdev file,node-name=f1,filename=/dev/loop0 \ -blockdev raw,node-name=q1,file=f1 \ -device virtio-blk,drive=...
15
votes
2answers
2k views

Create virtual block device which writes to /dev/null

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 ...
0
votes
1answer
141 views

How can I derive block device information using the output of lsusb

I am building a script that will let the user select a USB disk as a backup target. The idea is to create a partition spanning the entire device. lsusb gives the vendor ID and name, which I intend to ...
1
vote
2answers
143 views

Linux page cache consistency

I have a couple of general questions regarding the Linux page cache. As I understand, there are (at least) three methods a block on a block device can be related to a block buffer in page cache: by ...
8
votes
2answers
618 views

Has 'sync' been proved to be necessary when writing to a block device with 'dd'?

Every time I've written a file to an empty raw block device, e.g. # dd if=image.iso of=/dev/sdb status=progress I've never used any type of sync (i.e. sync; conv=fsync; conv=fdatasync; oflag=sync; ...
3
votes
0answers
61 views

How to prevent udev from adding fd0 to /proc/partitions?

I'm updating udev to eudev, the issue I am having is now fd0 shows in /proc/partitions which causes hang delays by things that process items from that file. I would imagine it's some "rule" but I ...
0
votes
1answer
355 views

sar + why sar not displayed the real disks under DEV section

we have Linux machine with 2 disks - sda and sdb ( sda is the OS ) lsblk -d -e 11,1 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 150G 0 disk sdb 8:16 ...
1
vote
1answer
347 views

Understanding iostat block measurements

I am trying to understand how data is written to the disk. I'm writing data with dd using various block sizes, but it looks like the disk is always getting hit with the same size blocks, according to ...
1
vote
0answers
97 views

Sharing a block device as a file through CIFS

Is it possible to share a block device through CIFS on Linux? If yes, how? I.e. I have two computers, Linux on box A, and Windows on box B. I have a hard disk connected to box A, it's name is /dev/...
3
votes
0answers
43 views

How does a block device driver handle IO errors

When a block device gets a request to read a range of sectors, and one of those sectors has a read failure, how does the driver signal to the kernel that a partial read is available, and that the ...
1
vote
1answer
46 views

Sort block devices by most recently connected?

How can I block devices by the most recent added ones? No option in lsblk seems to have that functionality.

1
2 3 4 5
8