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
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 ...
15
votes
4answers
4k views

Why does one need a loop device at all?

I previously used to create image files using dd, set up a filesystem on them using mkfsand mount them to access them as mounted partitions. Later on, I have seen on the internet that many examples ...
0
votes
0answers
140 views

Broken links in /dev/disk/by-path

I work with a lot of low quality USB flash memory modules - some of them can even hang the USB controller and block all traffic until I remove them. I'm testing these drives using f3 and a custom ...
2
votes
0answers
29 views

Remove spaces from Auto-mount mountpoint

Is it possible to remove spaces from auto-mount mount point label? For example: If insert a thumb drive that has the name "Device Name With Spaces" it should auto-mount to /media/...
2
votes
1answer
425 views

Block device cache v.s. a filesystem

Block devices provide buffering. This means that write() on a block device can return success, before the kernel has written the data to the device. A program can wait for all the buffered writes by ...
3
votes
1answer
664 views

Is a device being a block or character device determined purely by hardware?

From https://unix.stackexchange.com/a/472920/674 A "character device" and "block device" are abstractions, usually used in Unix-style systems in classifying various devices. Is a device being a ...
-2
votes
1answer
113 views

Why is the transfer unit of block devices block not page?

Operating System Concepts says A character-stream device transfers bytes one by one, whereas a block device transfers a block of bytes as a unit. But I heard that the unit of transfer between main ...
0
votes
2answers
378 views

Do “serial ports” or “parallel ports” apply to character devices only, but not to block devices?

From http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, ...
-4
votes
1answer
85 views

Are there implications between block/character device and random/sequential access? [closed]

Operating System Concepts says: Devices vary on many dimensions, as illustrated in Figure 13.7. • Character-stream or block. A character-stream device transfers bytes one by one, whereas a ...
-1
votes
1answer
531 views

Can filesystems be created only on block devices, but not on character devices?

Can filesystems be created only on block devices, but not on character devices? Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)? My guess is ...
0
votes
0answers
31 views

policy justification for requiring that block devices use power-of-two block sizes?

This question applies to all unices, but I'm interested mainly in the Linux kernel -- unless there are unices that don't have this restriction. It seems like allowing non-power-of-two block sizes ...
1
vote
0answers
107 views

findmnt, mountinfo show non-existent partitions

I noticed findmnt -n -o SOURCE --target MOUNT_POINT was returning lines containing block devices that didn't exist on my system: TARGET SOURCE FSTYPE OPTIONS /home/...
2
votes
2answers
660 views

Why can I (or cannot) mount a mounted device again? What is happening?

Why can I (or cannot) mount a mounted device again? What is happening? For example: /tmp/test$ sudo mount /dev/sda5 ./1;echo ${?} 0 /tmp/test$ sudo mount /dev/sda5 ./2;echo ${?} 0 /tmp/test$ sudo ...
1
vote
1answer
108 views

For what purpose does a block device driver use minor numbers?

After reading the chapter about block device drivers in the book "Understanding the Linux Kernel" I am a bit confused about the usage of minor numbers. I have read before about major and minor numbers ...
3
votes
0answers
246 views

How does the Linux kernel decide if a block device gets the read-only flag set by default?

I have a USB stick which (for about 2 months) constantly gets mounted read-only. After a bit of research and testing I found out, that the block devices of the device itself (/dev/sdc) and one of the ...
1
vote
0answers
87 views

How can I xor two block devices together?

I'm looking for a way to create a virtual block device that when accessed returns the XOR of two block devices. I feel like dmsetup would be used here somewhere but I can't find anything related to ...
0
votes
1answer
1k views

Udev Rules Not Running

I'm playing with Udev Rules on OpenSuse Leap, and I'm trying to run a simple and small script once a USB device is plugged into my system. However, my script which I added in my keyword "RUN+=" does ...
0
votes
1answer
138 views

Given a block device file, how can I list all relevant partions?

Given a device file (ex: /dev/sda) how can I get a list of all relevant partitions? Expected input: /dev/sda Expected output: /dev/sda1 /dev/sda2 /dev/sda3 ... I know there are many ways to get ...
1
vote
1answer
2k views

USB drive not detected

I had an USB on a headless raspberry pi running debian, but after rebooting without unmounting (there were programs running on the mounted folder), I couldn't use the USB anymore. The following is the ...
2
votes
0answers
100 views

Find all blocks on device not used by the filesystem

How can I list all blocks on a device that are currently not being used by the filesystem? The filesystem in question is a btrfs RAID1 with two LUKS encrypted harddrives an Arch Linux. I have tried ...
1
vote
0answers
200 views

du command shows larger size than nand erase block size in ubifs. How to check the exact size in ubifs?

I use UBIFS for rootfs. I would like to check the size of each direcotries in /. When I checked with du command, it shows larger than mtd size. Would you tell me the way how can I check the correct ...
1
vote
1answer
262 views

Does changing storage block size destroy the data?

I couldn't find any explicit references to this: if I change the block size on a device, will existing data be destroyed? Please note that this is a different question from "is there a risk of losing ...
1
vote
1answer
78 views

How do you use SSHFS to work on drives in /dev/

My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive. The problem is, I am struggling to perform tasks such as formatting disks and ...
4
votes
1answer
5k views

persistent device naming for NVMe storage devices

The Linux kernel's simple naming for a storage device (e.g. /dev/sda, /dev/sdb) can change randomly across boots. Is that true for NVMe storage devices too? These have names such as /dev/nvme0n1p1 and ...
4
votes
0answers
406 views

Stress testing storage media — file vs block?

While looking for ways to stress an SDcard, I've noticed there are two ways one can approach this. One is to stress it by reading/writing blocks directly to the device file. For example: sudo ...
0
votes
0answers
201 views

find all block devices (hdds and ssds) using sysfs

Cant figure how to enumerate all physical disks, like hdds, ssds, NVMes and maybe flashdrives connected to machine and filter out all these loop devices, ram disks, cdrom and floppies. I've checked ...
0
votes
3answers
45 views

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

Programmatically identify block device of filesystem [closed]

The following code was tested on RedHat 7 using df verison 8.2 and lsblk version 2.23.2. This is important as the lsblk utility has signficantly more output options than the RedHat 6 version (2.17.2) ...
0
votes
1answer
489 views

Define udev rule for disk by id or uuid?

I want to define a udev rule for a particular block device (or partition). I currently do it by defining a 91-my-custom-rules.rules configuration file as follows: computer:/etc/udev/rules.d # cat 91-...
1
vote
1answer
80 views

How can I tell my kernel not to place external drives before internal ones?

I have some internal drivers, which typically take the names /dev/sda ... /dev/sdc. However, if I plug in an external HDD and reboot, this gets reordered, with the external drive taking up /dev/sdb ...
0
votes
0answers
595 views

/dev/sr0 (live DVD) turns into /dev/sr1 when inserting periphials

On a live Linux session, inserting a keyboard or mouse via USB onto the computer causes /dev/sr0 to be remapped as /dev/sr1, which makes the live system unable to access the DVD. sudo rename /dev/sr1 ...
0
votes
1answer
277 views

iscsi target screwup - remapping targets and block devices

We've been running a CentOS 7 server successfully for a couple months with two iSCSI targets, all set up using targetcli. These are mounted from a Windows 7 box using the MS iSCSI Initiator. Worked ...
0
votes
1answer
63 views

linux + how to change disks name to other names

we have disk devices as ( on redhat machine version 7.2 ) sdb sdc sdd sde we want to change the names to vxb vxc vxd vxe is it possible expected results from lsblk output we need to see vxb ...
1
vote
1answer
29 views

Is it possible to hide mdadm source devices?

If I set up mdadm and I get a /dev/md* device, is it possible to hide from plain sight the underlying source devices that make up the array? I wouldn't want to accidentally write to /dev/sd* that is ...
1
vote
3answers
798 views

Displaying physical block devices

I need to list all block devices installed in my system. There is a command named lsblk to show all block devices. [kni@hist ttyid:0 pią kwi 13 17:56:26 ~]$ lsblk NAME MAJ:MIN RM ...
2
votes
2answers
924 views

SD reader - how to force UHS-I?

I have an HP EliteBook 8460p, equipped with JMicron card reader: rolf@deb:/sys$ sudo lshw |grep JMicron -B 3 -A 8 *-firewire description: FireWire (IEEE 1394) ...
0
votes
1answer
423 views

why is it necessary to differentiate between character and block devices? [duplicate]

I have been trying to read the source code for linux. I started watching a Youtube video which mentioned that character and block devices are different. It didn't say much about why it matters because ...
0
votes
2answers
502 views

Using dm-cache for transparent ongoing backup

Is there any chance to use dm-cache for ongoing SSD backup? I want to have very fast and cheap eventually consistent failure resistant partition. Use case: We have regular ssd (1Gb) (cache) + hdd (...
0
votes
1answer
102 views

Have an SSD and HDD as the same filesystem and overflow from one to the other?

Is it possible in Linux (specifically OpenSUSE) to have an SSD and a HDD set up in such a way that they appear as a single filesystem, yet data is always written to the SSD until full, and then "...
21
votes
3answers
3k views

What happens if you delete a device file?

I roughly know about the files located under /dev. I know there are two types (character/block), accessing these files communicates with a driver in the kernel. I want to know what happens if I ...
0
votes
1answer
118 views

Emulate nfs as sdcard : mount --bind <olddir> <mountpoint>

Can I mount with --bind and change with -t vfat ? It's not working. So can I mount an nfs as a blockdevice, then mount it to something else ?
0
votes
1answer
306 views

sector size won't change with fdisk

am trying to change the sector size from 512 to 2048 of my swap partition. # fdisk -b 2048 /dev/mapper/fedora-swap and then I try to write to it gives me the following message. The partition ...
0
votes
1answer
134 views

Use /dev/ramX as their corresponding special devices?

With ls -l, I found a series of devices like ram0, ram1 etc. I looked at the output closely and (for example) brw------- 1 root root 1, 3 Jan 6 11:34 /dev/ram3 crw-rw-rw- 1 root root 1, 3 Jul 15 ...
2
votes
2answers
109 views

How to locate one or more underlying disks when you know only a directory?

Assume that I have some device mounted to /backups. I'm copying selected files from the system to backup and I would like to reduce the amount of noise the device is making. I know that I can can use ...
0
votes
1answer
212 views

Can one force multipath?

Imagine I have a number of block devices, that I know are the same device but who have different identificators (it may be a device cut and clued with dmsetup, exported multiple times through iSCSI, ...
4
votes
0answers
103 views

What identifier is used by multipath to determine the same block devices?

In my application I want to multipath different devices, both local and iSCSI or FC exported. However, I fail to google the documentation that would clearly explain the mechanism of decision that ...
0
votes
1answer
95 views

How to resolve /dev/disk/by-* to device in a shell script?

In a (Bash) shell script I do wish to resolve a partition label — f.e. /dev/disk/by-label/X — to the corresponding device (partition)number: /dev/sdX1. How can I resolve a /dev/disk/by to ...
4
votes
2answers
8k views

How to create device files manually use mknod?

Linux 2.6.26.5 embedded. I need manually mount the root file system from busybox shell (initramfs). Because this Linux kernel not use devtmpfs, I have to create the basic device nodes manually, use ...
5
votes
3answers
7k views

List all connected devices in OpenBSD

How do I list all connected (including unmounted) devices on OpenBSD? I'm looking for something similar to lsblk for Linux or camcontrol devlist for FreeBSD: # List devices on FreeBSD $ ...
1
vote
2answers
237 views

Disconnected block device remains in /dev/, sync commands unkillable

I'm running Linux Mint 18/2 with 4.10.0-38-lowlatency kernel and KDE5 desktop. I'm testing lots of USB flash memory with a custom bash script and f3 and I had a strange situation today. One drive ...

1 2 3 4 5 7