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
3answers
81 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
93 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
228 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 ...
0
votes
1answer
126 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, ...
7
votes
1answer
489 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
1k 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
53 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
68 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 ...
7
votes
1answer
159 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; ...
0
votes
0answers
67 views

Linux bdev filesystem

In Linux kernel 2.6, bdev (special) filesystem is used to keep track of block_device vs major/minor mapping - block_device.bd_inode points to an inode in the bdev filesystem. The bd_inode field is ...
3
votes
0answers
47 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
115 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
98 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 ...
0
votes
0answers
37 views

sg_xcopy to copy LBA of one device to another device

Hello I am trying to send an XCOPY request to copy LBA 0x1008 of my device. [root@dqaj222 ~]# sg_xcopy count=0x1008 if=/dev/sds of=/dev/sdu verbose=2 id_usage=disable --on_dst=/dev/sdu sg_xcopy: on-...
0
votes
0answers
14 views

Inconsistent number of blocks reported by different commands

I tried two methods to get the number of blocks of partitions. The results are similar but not exactly the same. Why does this happen?
1
vote
0answers
60 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/...
2
votes
0answers
24 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 ...
0
votes
1answer
28 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
vote
1answer
32 views

How does an operating system deal with different types of storage devices [closed]

In Linux, it seems like the operating system knows what kind of storage device it is connected to. Eg. I see /dev/sda for SSD device and /dev/mmcblk for SD card. I was wondering how the operating ...
2
votes
0answers
477 views

Can't mount block device to directory

Checked for existing devices sdb 8:16 0 5.5T 0 disk /mnt/grid/0 sdc 8:32 0 5.5T 0 disk /mnt/grid/1 sdd 8:48 0 5.5T 0 disk /mnt/grid/2 sde ...
0
votes
1answer
286 views

At /dev/block directory, what's meaning of file name like 8:0 or 11:0? [duplicate]

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, ...)
2
votes
3answers
813 views

Why is lsblk showing the old FSTYPE and LABEL of a device that was formatted?

I formatted an external hard drive (sdc) to ntfs using parted, creating one primary partition (sdc1). Before formatting the device SystemRescueCd was installed on the external hard drive using the ...
1
vote
1answer
236 views

Getting sector number from inode or address_space mapping

In am trying to understand how to calculate a sector number from an inode in the ext4 filesystem. Therefore, I am reading ext4_mpage_readpages function. About the function: During a read request, if ...
3
votes
2answers
170 views

lsblk column “RAND” aka “adds randomness” - what does it mean?

Running lsblk (an excellent command for getting info about the disk configuration from within scripts and OS-agnostic high-level languages) on Fedora 29 like so: $ lsblk --output NAME,FSTYPE,ROTA,...
2
votes
1answer
633 views

Short and long uuids under /dev/disk/by-uuid

There are several hard disk partitions on my system (Linux josDeb 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux). It is working with: bejo@josDeb:~$ ls -l /dev/disk/by-uuid ...
2
votes
2answers
204 views

How to tell without knowing the mount point that a device UUID is mounted?

System: Linux Mint 19.1 Cinnamon 64-bit, based on Ubuntu 18.04 LTS. I would like to know if it is possible to get the following information: Is this UUID (of a block device) mounted or not? (without ...
0
votes
0answers
22 views

How do I do to detect both the disk (/dev/sd{x}) device and its sibling tty (/dev/ttyACM{y}) device when a composite USB ACM_MS device is inserted?

Suppose you have multiple embedded devices that enumerates as Composite ACM/Mass Storage devices (/dev/ttyACM0 <--> /dev/sdb, /dev/ttyACM1 <--> /dev/sdc, ...) when they get plugged to the ...
1
vote
1answer
98 views

lsblk lists a device, then says “not a device”

I'm seeing somewhat odd behaviour: % lsblk | grep sdb sdb 8:16 1 114.6G 0 disk └─sdb1 8:17 1 114.6G 0 part /run/media/...
0
votes
1answer
827 views

DRBD comes up after reboot with Connected Diskless/Diskless

After an unattented power loss, facing a major issue, every reboot the DBRB comes up with Connected Diskless/Diskless status. main problems: dump-md response: Found meta data is "unclean" ...
0
votes
2answers
248 views

How to find the names of partitions of a given block device?

Given a block device (e.g, /dev/sda), how to determine the names of its partitions (if any) in a script (i.e. without user interaction)?
2
votes
2answers
203 views

Given a block device, how to detect if names of partitions must contain “p”?

I want to automatically partition a block device with sfdisk. This might be an SD card, a hard disk, SATA or NVME device. Initially I thought that sfdisk requires these names and thus I was looking ...
5
votes
1answer
510 views

Can ext4 filesystem withstand a bad sector (unreadable)?

If a hdd bad sector happens in the metadata for /home/user/me on an ext4 fs would that mean data loss for all subdirectories? Background: I know that many users are satisfied with the ext4 ...
1
vote
1answer
69 views

Can “parchive” be used for block devices?

As explained on wikipedia and Arch linux wiki "Parchive"s can be used to generate additional data for a file, that can be used in verification and even to some degree for repair/recovery of said file ...
2
votes
2answers
1k views

What do device type numbers mean?

file /dev/* prints the description of a bunch of files as "block special (M/N)" and "character special (M/N)", where M and N are numbers. For example: $ file /dev/null /dev/null: character special (1/...
0
votes
0answers
529 views

How to control order of disk devices during Ubuntu Linux installation?

I have an automated installation script (preseed file) for Ubuntu 18.04 which automatically partitions /dev/sda and /dev/sdb. I run this by booting from a USB drive, in "legacy BIOS" mode (so MBR is ...
1
vote
1answer
129 views

Is a block_device mapping a physical disk or a partition of the disk? [closed]

In the ULK(Understanding Linux Kernel) book, the author says each block device has its own driver. The question is, does the block device here represent a physical disk or just a partition of the disk?...
2
votes
0answers
19 views

Find the size of all relevant caches when doing I/O

So, I'm looking at the stats from iostat, which updates every few seconds, and I see that I/O to device happens in bulks, say, around 40M/s, once every half a minute or so. I'm debugging an ...
5
votes
1answer
1k views

What is good block size for file cache on Linux?

The device block size is usually 512 bytes while the filesystem block size is often 4096 bytes. Why are they different? Why are 512B and 4KB good choices for device and filesystem block sizes? What ...
0
votes
1answer
80 views

how to understand the dmesg

we have redhat machine version 7.2 and each machine have disks as sdb sdc sdd sde sdf in the dmesg report we get the following [873080.996700] Buffer I/O error on device sdf, logical block ...
3
votes
1answer
634 views

Adding Events to Udev Event Queue

One of my udev rules runs a script on removal of USB storage devices. This script performs some general cleanup and removes the mount point directory for the storage device. The issue is that I want ...
5
votes
0answers
106 views

Why does one kernel work, but the other doesn't, when they are identical to the byte? [closed]

I have a couple of scripts, that build Linux live CDs for me. I have a couple of kernels, that I built myself to use for these. Having built one such Live CD a couple of weeks back with a kernel, ...
1
vote
0answers
35 views

What are the contents in /sys/block when ubuntu is a virtual machine?

I am very confused to how /dev/dm-1 was being used as a swapspace by my Ubuntu guest Virtualbox VM. gparted doesn't show these drives. What is going on here? How does the same drive dm-1 have ...
0
votes
1answer
31 views

Can I redirect block storage devices to each other?

Obviously what I'm about to describe is better handled by rsync or cp, but... Say I have two drives on my computer. Could I make one a perfect image of the other with the following command? Would ...
0
votes
1answer
328 views

Creating Persistant Symbolic Link -Linux

I have a cloud server, where a block device (/dev/xvdb1 with filesystem ext3) is attached . I want to create a persistent symlink (/dev/test_link) which should always target to (/dev/xvdb1) using ...
2
votes
1answer
4k views

Permanently mounting loop device

I created a file touch /datastore/virtual/pseudoblock created a loop device with it sudo losetup /dev/loop0 /datastore/virtual/pseudoblock (although I got a warning about its size) and then ...
1
vote
1answer
119 views

Using command (dd if=/dev/mmcblk0p1 | sha1sum) while running from initramfs

I have an opensource airgapped raspberry pi project seen at the following link: www.privatekeyvault.com I have provided a method for installing LUKS full disk encryption seen at the following: https:/...
0
votes
2answers
1k views

How do I access an SD card via command line in Chrome OS?

I'm trying to use the command line in terminal to unzip a massive .zip archive on my SD card. My understanding is that normally, I would locate the SD card in /dev/, mount the card, and then I should ...
2
votes
2answers
62 views

Does output redirection to a block device overwrite bytes or whole blocks?

A comment on another question made me wonder: Assuming I redirect the output from a command to a block device, and the length of that output is less than the block size of the block device: % ...
0
votes
0answers
112 views

How can I get parent, children, siblings of a block device in Linux?

I need an algorithm, that can determine the possible children, parents and siblings for any given block device (virtual or physical). In the past I have solved that problem for multipath devices and ...
1
vote
0answers
65 views

Distributed Block Device Cache for Linux

Is there an open source software available for Linux that implements a new block device based on an underlying block device (DRBD or shared SAN) and a distributed memory cache ? What I'm looking for ...

1 2 3 4 5 7