A data storage device that supports reading/writing data in fixed-size blocks, sectors, or clusters.

learn more… | top users | synonyms

2
votes
2answers
32 views

How to make sure that certain devices always use the same device file?

When mounting a hard drive via UUID and another via device file, how can I make sure, that the first one is always /dev/sdaX and the second /dev/sdbX and not the other way round? Some explanation of ...
2
votes
1answer
28 views

Can I tell whether a block device is in use?

Let's assume this is based on device-mapper. How can I tell if a given block device is already in use? (For example, a PV of a currently in use VG, or a encrypted LUKS device that is currently ...
1
vote
0answers
6 views

How can I tell if a encrypted (LUKS) device is already open?

Is there a way to tell, given a path to a LUKS block device, and not knowing the passphrase, whether the device is already open (decrypted)? What about knowing the path to the decrypted device?
4
votes
1answer
21 views

Get block device parent

Given a block device, how can I get its "parent"? A example would be a LUKS virtual decrypted device (/dev/mapper/decrypted), whose parent would be the encrypted block device (/dev/sdb)
1
vote
1answer
24 views

How to tell if a block device needs cache flushes

I want to know if a particular block device claims to requires cache flushes. From the xfs faq (emphasis mine): Q. Should barriers be enabled with storage which has a persistent write cache? ...
3
votes
0answers
22 views

Read-only block devices on Linux (blocking raw writes)

Is there some way that I can block raw write operations to a block device on Linux just as SIP prevents even root from writing directly to certain disks/partitions on OS X El Capitan? This should be ...
2
votes
1answer
33 views

Perl: General way of finding size of block device

I use -s regularly to find the size of a file. It works cross platform. Is there a similar well tested way of finding the size of a block device? We are not talking the size of a filesystem or the ...
1
vote
1answer
43 views

Why does SHA 256 sum change when writing image to a drive?

I've noticed that if I write an image via dd to a USB drive and then sha256sum that image; the sum changes. Why? It's never identical to that of the ISO. I am running: sha256sum /dev/sdb (on the ...
1
vote
1answer
27 views

ttyACM0 and sdb created from one physical USB device

I have a USB device based around the Nordic Semiconductors nRF51 SoC. Once I plug it into my Ubuntu machine it triggers the creation of both /dev/ttyACM1 and /dev/sdb. So far, I've perceived the /dev/...
3
votes
0answers
91 views

How to read data from optical drive in raw mode 2

I am trying to use the existing Linux driver system to effectively dump the data of CDROMs. As an example, if I pop in a "normal" CDROM disc of software and run the command cat /dev/sr0 then the ...
2
votes
1answer
46 views

Unable to edit the /sys/block/sdX/device/queue_depth file

I'm trying to increase my SSD's queue depth value with the following command: echo 64 > /sys/block/sda/device/queue_depth But I receive the following error: bash: echo: write error: Invalid ...
1
vote
1answer
54 views

linux: Class10 SD card different device and block device size

A have a brand new 16GB class 10 SD card and produce a very strange behavior. After I attached the the card with an USB SD-Card reader, the device appeared as /dev/sdb. I tried to copy a 2GB raw image ...
3
votes
1answer
145 views

How to prevent /sda /sdb changes between boots?

I am going to install Gentoo Linux onto an old hardware, which motherboard is having both IDE and SATA hard drives. I have two IDE and one SATA hard drives connected, and plan to do RAID on them. ...
1
vote
0answers
21 views

Changing readahead value using blockdev command

I am trying to modify read ahead value using blockdev. When I issue this command blockdev --setra xxx /dev/sda - it changes the readahead value of the entire partition in that device, which is fine. ...
1
vote
1answer
25 views

What are the pros and cons of badblock's two non-destructive tests?

I use badblocks to test my 32GB class-10 microSD card that I use to boot my RPi. I already have a functioning file system on it, so I don't want to scan it with the -w option (destructive read-write ...
8
votes
1answer
168 views

Command to generate /dev/disk/-by-path/ name on a system without udev daemon

On most Linux systems udev usually creates symlinks in /dev/disk/by-uuid/ /dev/disk/by-path/ which point to actual device nodes (/dev/sda, /dev/sdb, etc). I don't have udev on my system, and I ...
2
votes
2answers
120 views

No space left on device on CentOS7

My machine which OS is CentOS7 have to backup 50G data into MySQL. But, there is no space left on the device. But there are many spaces on /home. How can I make user that there are enough space for ...
1
vote
0answers
12 views

Files backing loop devices opened without O_EXCL

Loop devices are the primary way (and perhaps the only way) to treat normal files as block devices in Linux. It's strange that backing files aren't protected by O_EXCL flag. Why is that? Why nobody ...
3
votes
1answer
60 views

Why is the block size of a partition smaller than that of the underlying disk?

My understanding is that the block (in the phrase "block size") is like an IO buffer, or minimum IO size for a device. Since partitions are built on top of physical devices, how can they have blocks ...
1
vote
1answer
29 views

How can I access optical drive status information?

I can obtain the status of a connected display with: cat /sys/class/drm/card0-HDMI-A-1/status Is there something analogous for optical drives? I looked around in /sys/ but couldn't find anything that ...
0
votes
0answers
16 views

is `blockdev --flushbufs /dev/mmcblk0p1"` blocking call?

I am using blockdev --flushbufs /dev/mmcblk0p1 in onf the shell script and would like to know if this command doing blocking call or not? I see it from man page that it is ioctl call to the block ...
1
vote
3answers
87 views

How could Linux use 'sda' device file when it hasn't been installed?

I am installing CentOS Linux distribution on a fresh new machine. Just for learning. I am new to Linux. At the partition step, CentOS tells me that it has detected a sda HD in my machine and I should ...
0
votes
0answers
8 views

How “ata_for_each_link” and “ata_for_each_dev” macros works in linux kernel?

I am trying to understanding the SATA device enumeration sequence from the ata_piix.c Host controller driver which resides at /driver/ata/ata_piix.c in linux kernel. During understanding the flow,a ...
0
votes
2answers
59 views

CPU: 13 PID: 15452 Comm: ssd_blk/0 Tainted: G B I E 3.19.0+ #1

I developed a module which works as an emulator for a block device. When I write into the block device, I get this in dmesg and the module crashes. I cannot get any hint about what is going on? [...
1
vote
1answer
57 views

Block device disappears after suspend-resume

After few suspend/resume cycles one of my hdd disappears from the list of devices, here is part of dmesg output that seems to be related to issue: [ 450.005310] sd 5:0:0:0: [sdc] Starting disk [ ...
1
vote
2answers
352 views

What is a block device? [duplicate]

I know many examples of block devices (HDD's, SSD's, files, ...), but I haven't heard a simple definition of it. Especially since files are apparently included in the definition I feel a bit confused.....
1
vote
0answers
28 views

Tar waiting a long time at end of block device

I had some trouble getting Linux installed to a particular netbook and had to restart it from scratch multiple times. Re-typing the same commands to set up networking and bootstrap the install was ...
1
vote
0answers
67 views

Storage device trouble: IO errors but no bad sectors?

I have a lightly used spinning metal drive (internal) with some VMs on it. I'm running into IO errors while running a VM and upon closer examination I have found a virtual disk file that is reporting ...
2
votes
1answer
72 views

Transfer content of LVM block device ensuring consistency - LVM snapshot?

I need to create off-site full backups of an LVM block device. Thinking the old dd over SSH method. To ensure I have a consistent backup, should I create an LVM snapshot first? So new changed blocks ...
3
votes
0answers
79 views

How to cache block devices (for device mapper)?

problem / observed effect It seems that the page cache ignores block devices which are not opened. And worse: Reads from device mapper (DM) devices which use a cached device are not cached at all (...
2
votes
1answer
125 views

Difference between sd0/sda, hd0/hda

From what I understand, hdx is naming convention for IDE (PATA) drive, sdx is for SCSI (SATA) drive. Sometimes I see sd0 and sda, similary hd0/hda. What are their differences ? When would we use ...
4
votes
2answers
91 views

In which thread does block driver issue commands to block device?

I'm currently reading "Understanding The Linux Kernel" book, as I've understood block I/O request order is like this; user space call => vfs call => I/O scheduler call => block device driver call. ...
1
vote
1answer
208 views

dd, cat & openssl: block size & buffer size

Here it says that when using dd through dm-crypt to overwrite a block device, only the default dd block size should be used because dm-crypt's block size is the same (512 bytes), and increasing dd's ...
1
vote
1answer
197 views

How to find the driver (module) associated with SATA device on Linux?

For one of my applications, I have to understand the the SATA device driver flow. As per my understanding, SATA device driver should be there in the Linux kernel tree. I have referred how to find the ...
1
vote
0answers
15 views

Getting mmc_block to display more than 8 partitions

When you format an SD card or a USB drive with the Chromebook Recovery Utility, it creates twelve partitions. It also leaves the rest of the memory unallocated. I want to be able to use this space as ...
4
votes
1answer
192 views

How does cat 'know' the optimum block size to use?

From reading this, it seems that when copying data to a different hard drive, cat automatically uses the optimum block size (or very near it). I wonder how it determines the optimum block size, and ...
4
votes
1answer
29 views

Get label of Linux storage partition device file

Given the partition device file /dev/sdh1, I need to find out the label of this device. dmesg doesn't mention its label while GParted reveals that it is called H2N_SD: I need to build a way to be ...
3
votes
0answers
34 views

Enumerate valid values for mknod

I have access to an embedded device which has a bunch of block/char files under /dev. However, this is not a satisfying description of the hardware, because since the firmware is shared with small ...
1
vote
1answer
39 views

How do I store the data in disk directly in kernel module? [closed]

I capture the TCP packet in function of netif_receive_skb , I want to store the playload of TCP packet. we can't read/write the file in kernel module, so store in disk directly maybe a way? ...
0
votes
1answer
46 views

How do I detect used harddrive space on a block device?

I want to look at a raw block device (as in /dev/sda) and know how much space is being used on the drive. I don't know what type of file system is on the harddrive, nor do I have any way of figuring ...
1
vote
0answers
323 views

CentOS 7 - Forcing a disk to be /dev/sda

I've been wrestling with this problem for awhile now, and I've hit a wall and need help. In my system, I have 1 drive connected to a SATA port, an SSD. CentOS 7 is installed to this disk. Also in ...
1
vote
2answers
183 views

Is UUID really unique? why can we assign multiple UUIDs to single slice of disk

All the web content and its acronym explains it as Uniquely identifier. But when i try to create another device, lets say swap in my case and assign the UUID, i am able to assign many UUIDs to single ...
4
votes
1answer
557 views

How does Linux handle block devices?

Today I learned that FreeBSD removed support for block devices entirely. While reading their rational for the decision I came across this: Block devices are disk devices for which the kernel ...
3
votes
0answers
376 views

How to change block device names, e.g. /dev/sdc to /dev/sdb?

Example of why this might be desired: I connect a block device, which shows up as /dev/sdb, and mount it. Later that device gets removed without being unmounted. The block device is reconnected, but ...
0
votes
0answers
31 views

RHEL7 : Freeing memory allocated for Block IO i.e. bio -> bio_destructor

I want to know HOW memory allocated for BIO gets free specific to RHEL 7. I think, in RHEL 7 , bio->destructor field is removed from the bio structure. So, how exactly the memory will be freed? ...
1
vote
2answers
189 views

How to get disk name that contains a specific partition

If I know that a partition is for example /dev/sda1 how can I get the disk name (/dev/sda in this case) that contains the partition ? The output should be only a path to disk (like /dev/sda). It ...
8
votes
3answers
379 views

Will a usb key have the same name everytime I mount it?

I have a usb key which will be used to save data on it daily, via a bash script. I managed to mount it for a specific user to be able to write folders in it using the command mount /dev/sdc1 /media/...
4
votes
3answers
516 views

Does dd copy everything, including all metadata and all “empty” blocks

Suddenly something was messed up with my partitions, or just one partition. I have a default Ubuntu installation, on a Kingston SSD, with the root file system encrypted with LUKS, (using AES I think). ...
3
votes
1answer
83 views

Is there any way to prevent a bad drive from disappearing from /dev?

I'm trying to recover a partition on a bad drive with ddrescue. I run: $ sudo ddrescue -r -1 -v /dev/sdd3 OUT.img dd_rescue_logfile and it seems to do great for a while, but after about an hour, ...
1
vote
0answers
77 views

List partition type GUID's for all disks from command line?

I need to list the partition type GUID's from the command line. Note: This is not the same as the partition UUID. Basically I'm needing to search for all disks that have the Ceph OSD type GUID: ...