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

learn more… | top users | synonyms

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)
6
votes
4answers
12k views

Prevent a USB external hard drive from sleeping

Does anyone know if there is an elegant way to tell an external usb drive not to spin down after a period of inactivity? I've seen cron based solutions that write a file every minute, but nothing ...
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 ...
72
votes
8answers
65k views

How to know if a disk is an SSD or an HDD

I want to know whether a disk is a solid-state drive or hard disk. lshw is not installed. I do yum install lshw and it says there is no package named lshw. I do not know which version of http://pkgs....
4
votes
2answers
7k views

Mount an ISO virtually using /dev/sr0 device

I'm doing a study about how CD-ROM can be mounted virtually and all I could find out was mounting using loop devices. mount -o loop disk1.iso /mount-point This is fairly easy. I understand that /...
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/...
30
votes
2answers
33k views

What are character special and block special files in a unix system?

How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively?
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
53 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
143 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 ...
7
votes
1answer
163 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
115 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
58 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
28 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 ...
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
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 ...
1
vote
1answer
56 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 [ ...
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 ...
38
votes
4answers
11k views

How can I mount a block device from one computer to another via the network as a block device?

Is it possible to export a block device such as a DVD or CDROM and make it so that it's mountable on another computer as a block device? NOTE: I'm not interested in doing this using NFS or Samba, I ...
1
vote
2answers
344 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 ...
13
votes
5answers
35k views

Mapping between logical and physical block device names

I cannot figure out the mapping between different logical and physical block device names. The output of "cat /proc/diskstats" is : 104 0 cciss/c0d0 ... 104 1 cciss/c0d0p1 ... 104 2 cciss/...
19
votes
4answers
7k views

How to tell Linux Kernel > 3.0 to completely ignore a failing disk?

I am asking this question here in the hope that some Linux-kernel guru can have an answer. This question has been asked on AskUbuntu and on SuperUser without answers: thinking better, it is really ...
4
votes
4answers
11k views

List all devices connected, FreeBSD

What's the FreeBSD variant of Linux's lsblk and blkid? I want something that provides the same sort of information as lsblk does in the example below: NAME MAJ:MIN RM SIZE RO TYPE ...
1
vote
0answers
65 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 (...
1
vote
1answer
193 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 ...
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. ...
6
votes
6answers
5k views

Comparison of raw block devices

Is there a utility (or some shell magic) that allows me to compare two block devices? Details: I have one large (0.5 TB) RAID device that I've backed up to a slightly larger SATA device using dd. ...
1
vote
1answer
206 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
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
190 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 ...
8
votes
4answers
4k views

Mounting multiple img files as single loop device

Is there a way to take a disk img file that is broken up into parts and mount it as a single loop device?
0
votes
2answers
690 views

How to benchmark memory in an embedded linux device?

Is there a generic utility to benchmark external memory device (eMMC, DDR) throughput on an embedded device (e.g. raspberry pi)? memtester, bonnie, bonnie++, memtest, dd? I've been running into ...
4
votes
5answers
5k views

From df device name to physical drive name (vendor / type)

Seeing the device name by df, is it somehow possible to resolve it to the physical drive name such as vendor / type. /dev/sda3 915.4G 34.9G 880.0G 4% /share/HDA_DATA /dev/sdd3 ...
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 ...
2
votes
2answers
684 views

KVM linux guest, 2nd HDD, LVM partition or whole disk

I've got a RAID 10 arrays on a couple of KVM host machines. The RAID 10 array is one big VG. I usually create a small LV for guest disk image storage then the rest of the VG I carve out as LVs to add ...
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 ...