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
2 answers
20 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....
user avatar
  • 973
0 votes
0 answers
32 views

Bluetooth device connect changes block device settings

I am seeing a very strange behavior on my linux system: When I connect or disconnect a Bluetooth device (namely, a DS4 gamepad) to the System, for some reason, /sys/block/sda/device/power/...
user avatar
  • 51
1 vote
2 answers
47 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 (...
user avatar
  • 778
1 vote
0 answers
71 views

Partition detected as in use even after successful unmount?

I'm having a USB disk which I unmount and want to perform some actions on it (i.e. do a file system check). Even though the disk was unmounted the system complains that it's still in used. The OS in ...
user avatar
1 vote
0 answers
22 views

Why are loop0 and ram1 getting mixed up?

I've been rolling my own "minimal" linux system under WMware based on the 5.15.x kernel. I don't use an initramfs but do include support for the default max 16 ramdrives in the kernel build ...
user avatar
0 votes
1 answer
63 views

"stat /etc" size mismatch: 24 blocks, size 8192 instead of 12288

My stat /etc command shows that the number of blocks is 24. I understand that a block here means 512 bytes. So the total size is 24 × 512 which makes it 12288 bytes. But it shows 8192 bytes instead, ...
user avatar
0 votes
1 answer
25 views

Shrink partitionless filesystem

I have data on a disk that I want to encrypt by cloning the full filesystem of that disk (source) to a virtual block device (devicemapper/cryptsetup) based on an additional disk (target) of identical ...
user avatar
  • 1,895
-1 votes
1 answer
55 views

fdisk prints nothing and devices are not mounted

I am quite new to Linux, and I need to mount some devices, using the lsblk command and more. lsblk presents the devices (internal, I don't have external ones) the output is: # lsblk NAME ...
user avatar
  • 1
0 votes
0 answers
20 views

Tool to manage multiple LUKS devices as a group

I'm looking for a program which can manage a whole "group" of drives that have LUKS containers with the same passphrase; unlocking and locking them (ideally also formatting and/or passphrase ...
user avatar
  • 333
3 votes
3 answers
93 views

ls -ls output shows larger number of blocks than the file size

As far as i know the ls command with the "-s" option print the file size in blocks , ls uses the 1024 as block size , but i noticed something weird . For better understanding consider the ...
user avatar
0 votes
1 answer
232 views

What does command do: `badblocks -svn /dev/sda`? does it just report the bad blocks?

This command: badblocks -svn /dev/sda What does it do? Does it just report the bad blocks? Or does it somehow handle the bad blocks so that I don't need to be worried about them? I read the manual by ...
user avatar
  • 1,315
1 vote
1 answer
126 views

How to disconnect/disable MMC SD card

I have non USB MMC/SD reader slot . If a user inserts SD card, I want to be able to disconnect the SD card, or Disable the reader. (in case I detect malicious card). How can I do this? With umount, I ...
user avatar
0 votes
0 answers
17 views

How to block all wireless non-bluetooth devices using udev

How to block all wireless non-bluetooth devices in udev (that require an USB adapter to attach to computer) ? I want to block permanently all wireless HID devices such as wireless mice or keyboard .
user avatar
  • 23
0 votes
1 answer
30 views

How safe it is to list /dev/block for non virtual drives to determine hard disks on the system?

How safe it is to determine hard disks on the system by using the following approach (I am particularly obstinate in avoiding non-kernel utilities/programs): ls -l /sys/block | grep -v "/virtual&...
user avatar
  • 298
0 votes
0 answers
116 views

How to access files in USB in linux

I'm using Ubuntu 20.04, recently (almost a week ago) I upgraded my kernel from 5.11.0 to 5.14.0 and after that I can't access any USB drivers. The system recognises my USBs since when I run lsusb it ...
user avatar
1 vote
1 answer
50 views

how can I dd ONLY last portion of drive that hasn't already been dev/zero'd

I regularly dd a drive to erase them for ZFS resilver, when something goes awry with read/write or checksum error, to put the drive back into service. Frequently, removing the partition table at the ...
user avatar
0 votes
1 answer
51 views

What happens when an SD card gets connected to a Linux computer

I'm still quite confused as to how this works exactly. When we connect an SD card to a computer running a Linux system, this is my understanding (Please feel free to correct on the smallest of details ...
user avatar
1 vote
1 answer
75 views

The `file` command correctly identifies my LUKS device but the kernel doesn't see it

I recently created a LUKS2 device with a native --offset of 4MiB. The file command correctly identifies the device and lists its UUID, but it is neither auto-opened at boot nor visible in /dev/disk/by-...
user avatar
  • 219
3 votes
2 answers
608 views

Does Linux update the size of a block device?

In the light of emmc wearout monitoring I'm wondering about the size as displayed inside a running Linux OS. An emmc chip has an internal manager which keeps track of the usage intensity of all the ...
user avatar
0 votes
1 answer
92 views

Linux gaslighting me by pretending to write to USB

When I boot my Linux and start writing to a USB-backed block device, everything goes fine for the first few times. Afterwards, if I write to it once more, dd reports absurdly huge transfer rates (2.9 ...
user avatar
  • 27
0 votes
0 answers
82 views

Who is causing Device or resource busy when mounting a block device?

I have plugged a HDD with some partitions to a Linux box, but when I try to mount them it fails: [root@il ~]# mount -oro /dev/sdb1 /media/sdb1 fuse: mount failed: Device or resource busy It's not ...
user avatar
  • 1,791
0 votes
0 answers
57 views

Are direct writes to block devices buffered? How do I ensure it's written to disk before removing it?

Say I do something like dd if=file of=/dev/sdc (simplified for illustration), is this buffered? Can I sync it like I would any other filesystem write, or do I need to do something else to make sure ...
user avatar
  • 293
0 votes
1 answer
17 views

Partition not resized despite empty space on device

It seems that the device /dev/sda has plenty of space available root@Vanuatu:~# sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL | grep -v loop NAME FSTYPE SIZE MOUNTPOINT ...
user avatar
  • 2,195
7 votes
3 answers
1k views

How can I tell if a Linux block device is trimmable or not?

fstrim requires the Linux block device to be mounted, and it is not very verbose. blkdiscard could tell, but also that would require a write operation. Can I somehow tell if a block device supports ...
user avatar
  • 8,374
0 votes
0 answers
58 views

/dev/sde install disk is seen as /dev/sda at boot time

I'm SystemImager image deployment software developper. I'm trying to support external disk drivers, but I'm stuck with a silly problem. When I run preinstall scripts (udev has already settled) I fetch ...
user avatar
1 vote
1 answer
35 views

Is it possible to make a device accessible exclusively by certain programs?

I have a device (a video card) that I need only two programs (expressed as paths, e.g. /usr/bin/myprogram) to access. The device has a /dev file (e.g. /dev/mydev1), but I can also use other references ...
user avatar
  • 778
0 votes
0 answers
17 views

Linux doesnt display prompt after using dd command on my custom block device

I have written a Linux block driver for a custom hardware device on my embedded system. The driver works fine but if I run a command (such as dd if=/dev/zero of=/dev/nvme bs=1M count=16), then after ...
user avatar
  • 21
1 vote
1 answer
78 views

Will dd work, if cloning from a healthy image to a disk with bad sectors?

I have a raspberryPI failing to boot from sdcard1. Luckily, I had made its image with dd several months before. I have written that image to another sdcard and it started booting, all is well here. ...
user avatar
0 votes
0 answers
34 views

How to prevent block device like hdisk to mount, using ibudev

It is possible to prevent USB device to be bound using libudev (udev interface in c). Now I want to prevent other devices like block devices to mount using it. Is it possible?? and how to do it?? ...
user avatar
  • 1
2 votes
2 answers
94 views

List what each sd is

On Linux I know that sda, sdb, and sdh are hard drives, but I don't know what is sdc, sdd, sde, sdf and sdg are. Some of them are (I think) empty and some of them, the kernel tries to make them ...
user avatar
  • 83
0 votes
1 answer
56 views

On UNIX OS, for which of the following I/O devices the access is not via a special file of type "character I/O"? [duplicate]

On UNIX OS, for which of the following I/O devices the access is not via a special file of type "character I/O"? Mouse Screen Disk On Key (USB) Printer None of the above This question is ...
user avatar
  • 1
0 votes
0 answers
57 views

Block special file for first session of multisession CD

I have a multisession CD. The first session is CD audio tracks and the second is an SVCD q.v. "CD Extra" and "Blue book". When played on a CD player, the audio tracks are (until ...
user avatar
0 votes
0 answers
33 views

How to edit bytes on a mtdblock / flash memory device in linux

I have a flash drive with the following bytes: root@localhost:/data/# hexdump -C /dev/mtdblock16 00000000 01 57 31 93 e3 16 81 03 32 32 32 FF FF FF FF FF |.W1.....222.....| I want to change the ...
user avatar
  • 190
11 votes
2 answers
1k views

How do I find the first non-zero byte on a block device, with an optional offset?

I'm trying to find the first non-zero byte (starting from an optional offset) on a block device using dd and print its offset, but I am stuck. I didn't mention dd in the title as I figured there might ...
user avatar
1 vote
0 answers
46 views

What is the simplest way to send data to a tape library?

I am looking for the simplest (feasible) way to push data away on a tape library. This is for archiving finalized, immutable datasets that only need to be retrieved in case of a catastrophic failure ...
user avatar
  • 243
0 votes
1 answer
123 views

Partitions and the mounting points

An extract from a book- Linux organizes attached storage as block devices, you can move to the /sys/block/ directory and list its contents. Among the contents will be a directory called sda/. (...
user avatar
2 votes
0 answers
157 views

How to detect changes to disk capacity in linux?

I'm working on a program that needs to monitor changes to the system mounts and the size of disks and partitions. While I found out the changes in mounts can be detected using epoll on /proc/mounts, ...
user avatar
1 vote
0 answers
27 views

How can I backup a mount without a corresponding /dev special file?

Typically, I would just e.g. dd if=/dev/sda | gzip > backup.gz or something similar, but in this embedded device, I have a filesystem /dev/root on /rom type squashfs (ro,relatime) without a ...
user avatar
  • 141
0 votes
0 answers
44 views

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 ...
user avatar
1 vote
0 answers
100 views

How to mount device that appears in /proc/devices but not /dev?

I'm using a bare bones Linux distribution running on a Phytec i.MX6 ULL SoM on the Phytec demo board for this SoM. I need to be able to copy a file from an SD card. I flashed the SoM NAND from an SD ...
user avatar
  • 111
1 vote
0 answers
27 views

Timeout Error while using Command Queue

I am new to command queue mechanism in Linux. I am using the following: Kernel Tree: git clone https://android.googlesource.com/kernel/msm Kernel Ver: 4.9.96 While doing read/write I observe a timeout ...
user avatar
0 votes
1 answer
130 views

blkdiscard hangs on md raid 10 on PCIe SSDs

I have a running Linux 4.19 amd64 system with two PCIe SSDs that I'd like to clear, test, reformat and put in use again. All of the data has already been moved away. I've tried to trim/discard blocks ...
user avatar
  • 331
1 vote
0 answers
82 views

eMMC request timeout error

We have a custom embedded board with a 4GB eMMC chip connected. We see the following error while emmc read/write test on the eMMC device: mmc0: request with tag: 16 flags: 0x2000000002469030 timed out ...
user avatar
1 vote
1 answer
364 views

What is the relationship between the Filesystem and the block devices?

A filesystem is the set of methods and the data structures for keeping track of files on a disk or partition. Without it, data placed in a storage medium would be one large body of data with no way to ...
user avatar
1 vote
0 answers
30 views

Does the Linux Genreic Block Layer prefer Read requests over Write Requests?

Does the Generic Block Layer in the Linux kernel, prioritize read requests over write requests ? That is without taking the I/O scheduler into account.
user avatar
2 votes
2 answers
1k views

How much do 4K sectors improve LUKS2 performance on SSD storage?

According to the cryptsetup(8) man page, the sector size of a LUKS2 volume may be configured with --sector-size: Set sector size for use with disk encryption. It must be power of two and in range 512 ...
user avatar
  • 736
0 votes
1 answer
61 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 ...
user avatar
  • 579
0 votes
1 answer
97 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/...
user avatar
0 votes
1 answer
101 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 ...
user avatar
  • 297
1 vote
2 answers
8k 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 ...
user avatar

1
2 3 4 5
9