Questions tagged [block-device]

A block device is a computer data storage device. It organizes data into fixed sized blocks that are typically 512 or 4096 bytes long. Data is indexed by a logical block address. Block storage devices are widely available, including spinning hard drives or solid-state devices. They may be used directly by applications or may have a filesystem or other data structure layered on top of them.

139 questions
78
votes
2 answers

How can I identify the request queue for a linux block device

I am working on this driver that connects the hard disk over the network. There is a bug that if I enable two or more hard disks on the computer, only the first one gets the partitions looked over and identified. The result is, if I have 1 partition…
ndasusers
  • 1,131
  • 2
  • 10
  • 6
16
votes
3 answers

Retrieve correct Amazon attached EBS device from instance metadata endpoint

EDIT and TL;DR: ubuntu@ip-172-31-19-77:~/.aws$ aws ec2 describe-instances | jq . | grep -i device "BlockDeviceMappings": [], "RootDeviceType": "ebs", "RootDeviceName": "/dev/sda1", "DeviceIndex": 0, …
brainstorm
  • 720
  • 7
  • 24
13
votes
4 answers

USB Mass Storrage on File Level

The Challenge: I have an Linux hand-held device, which records data and stores it to the disc. It should exchange these data with a Windows application via USB. When this data is accessible by the user - e.g. via USB-mass-storage - it has to be…
Charly
  • 1,270
  • 19
  • 42
13
votes
2 answers

why is virtio-scsi much slower than virtio-blk in my experiment (over and ceph rbd image)?

Hi I recently did a experiment of virtio-scsi over rbd through qemu target (for its DISCARD/TRIM support), and compared the throughput and iops with that of a virtio-blk over rbd setup on the same machine, using fio in the guest. Turnout the…
Zhaohui Yang
  • 173
  • 1
  • 1
  • 7
13
votes
3 answers

Getting live info from /dev/input

I am unsure if this is the correct place for this question. I am attempting to obtain the axis position values from a joystick /dev/input/js0 on my system. If I run jstest /dev/input/js0 it will give me live feedback on all buttons and axis…
Yamaha32088
  • 4,125
  • 9
  • 46
  • 97
11
votes
3 answers

The bio structure in the Linux kernel

I am reading Linux Kernel Development by Robert Love. I don't understand this paragraph about the bio structure: The basic container for block I/O within the kernel is the bio structure, which is defined in . This structure represents…
Vikram
  • 1,999
  • 3
  • 23
  • 35
10
votes
3 answers

How to revert bcache device to regular device

I have a 20 gb SSD device on my laptop that i decided to try bcache on. It seemed to work, but for some time now, I've been getting an error on boot: error on 0f3bbb55-6839-4ed6-8127-7976a969f726: corrupted btree at bucket 17571, block 483, 61 keys,…
Greg Michalec
  • 849
  • 3
  • 10
  • 17
9
votes
2 answers

devicePolicyManager.lockNow() is not working for Motorola Tablets

public final static void lockDevice() { try { if (devicePolicyManager.isAdminActive(adminComponent)) { devicePolicyManager.lockNow(); } } catch (final Exception…
PC.
  • 6,870
  • 5
  • 36
  • 71
9
votes
2 answers

How do I read/write a block device?

How do I read/write a block device? I heard I read/write like a normal file so I setup a loop device by doing sudo losetup /dev/loop4 ~/file Then I ran the app on the file then the loop device sudo ./a.out file sudo ./a.out /dev/loop4 The file…
user34537
7
votes
2 answers

get device flags by device name

hope you can help me: I'm trying to determine whether the device is removable or not, all i have is device name (/dev/sdc). Actually, I need to determine when the file on removable media or on local disk by full path of this file. I've tryed to…
Makc
  • 297
  • 2
  • 16
7
votes
1 answer

Why is the kernel using the default block driver instead of my driver's code?

I wrote a block driver program which creates a dummy block device (sbd0). I registered all device operations for that block device: (Refer to include/linux/blkdev.h in 2.6.32 kernel source) static struct block_device_operations sbd_ops = { …
gangadhars
  • 2,584
  • 7
  • 41
  • 68
6
votes
1 answer

Ceph CSI (rbd.csi.ceph.com) vs Ceph RBD (kubernetes.io/rbd)

I'm using kubernetes v1.16.10 with a Ceph 13.2.2 Mimic cluster for dynamic volume provisioning through ceph-csi. But then I have found ceph-rbd Ceph RBD…
6
votes
1 answer

Kernel block device

I'm currently trying to implement a (not that ?) simple kernel block device driver. I inspired mainly from the book Linux Device Drivers, 3rd Edition which is not totally up-to-date anymore as it was published in 2005. Anyway the logic is still…
Arkaik
  • 852
  • 2
  • 19
  • 39
6
votes
1 answer

Linux block device driver request ordering - RaW?

I am writing a Linux block device driver that receives requests via a function registered with blk_init_queue(). My hardware device reorders requests and as such to avoid read-after-write conflicts it is required to wait for the completion of…
hlitz
  • 635
  • 6
  • 24
6
votes
2 answers

Cygwin equivalent of Linux /dev/sda, /dev/sdb etc

On Linux, I can access a hard drive as /dev/sdX. This ignores any partition tables, file systems, etc, and just accesses the drive block by block. What is the equivalent in Cygwin? I already searched Google, but could not find anything that…
rsteward
  • 1,146
  • 2
  • 8
  • 9
1
2 3
9 10