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
4
votes
2answers
699 views

What tool to visualize linux block devices (partitions, LVM PVs, LVs, mdadm devices…)

I'm looking for a tool that will scan my GUI-less server and create an easy to digest rough overview of all the block devices and their relationship (disk partitions, mdadm devices, LVM PVs & LVs ...
5
votes
2answers
728 views

what are /dev/sdxx nodes?

This image from TLDP is pretty awesome. It shows that before giving user space actual read, write, open access to the filesystem the blocks get mapped onto the virtual filesystem. and Wikipedia says ...
2
votes
1answer
107 views

What might cause a block device to somehow be smaller than its partitions?

I'm trying to wipe an IOSafe external drive, and I'm running into a major problem. When I run dd to wipe the full disk (/dev/sdb) it errors out at the 1.8 GB mark (it's a 2 TB disk), saying no space ...
1
vote
0answers
133 views

How can I rename the device files for my multi-memory card reader?

I have a card reader in my computer that can read six different types of memory cards. It's connected to an internal USB port, and it shows up in lsusb as "Bus 002 Device 013: ID 058f:6364 Alcor Micro ...
0
votes
2answers
491 views

How can I run 2 dd in parallel writing on the same device

I am looking for a way to put zeros and burn myiso.iso in parallel. The command dd if=/dev/zero of=/dev/sdb && (sleep 1; dd if=myiso.iso of=/dev/sdb) should be ok since the speed at which ...
2
votes
1answer
50 views

Can I list my usb content without mounting it?

I am wondering if there was a way to list files on a device without mounting it (i.e la output )
12
votes
2answers
7k views

How to get block device name from partition device name?

I'm looking for a portable way to obtain parent block device name (e.g. /dev/sda) given the partition device name (e.g. /dev/sda1). I know I could just drop the last character, but that wouldn't work ...
1
vote
0answers
145 views

What is the terminology for raw writes to block devices?

I've been looking for solutions for Linux that can disable/deny attempts to write directly to block devices—preferably only certain ones like the boot disk (as with Apple's SIP)—while still permitting ...
2
votes
0answers
721 views

How to investigate why a block device, though visible in lsusb, is not in lsblk? [closed]

I have several devices (which are essentially block type devices) that are connected via USB. Its USB mass storage devices. I can list the devices via lsusb but they do not show up in lsblk or ...
1
vote
1answer
81 views

Batch creating partition then partition node; access failing

So I've got an program that takes a device, partitions it and then creates the device node for the partition. The problem is, that the kernel does not pick up the device until some kind of rescan is ...
1
vote
1answer
607 views

How to make filesystem at given byte offset

I have a 3TB disk with btrfs which starts at the beginning of disk (i.e. /dev/sdx instead of /dev/sdx1). Meanwhile, I have decided I want to fully encrypt the disk (with luks), but I have no spare ...
3
votes
2answers
800 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 ...
3
votes
1answer
180 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 ...
2
votes
2answers
4k 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
508 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)
3
votes
1answer
1k 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? ...
2
votes
0answers
427 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
213 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 ...
2
votes
1answer
1k 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
360 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
741 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 ...
4
votes
1answer
3k 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
404 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
2answers
7k 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
1answer
556 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. ...
3
votes
1answer
1k 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 ...
6
votes
1answer
4k 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 ...
4
votes
5answers
13k 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
58 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
578 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
351 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 ...
1
vote
3answers
1k views

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

I am installing CentOS Linux distribution. At the partition step, CentOS tells me that it has detected a sda HD in my machine and I should create partitions and assign mount points for this disk. ...
0
votes
2answers
3k 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
313 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 [ ...
28
votes
2answers
46k 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
91 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 ...
9
votes
4answers
15k views

Where is my /tmp mounted?

$ df /tmp Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 480589544 42607368 413546516 10% / $ ls /dev/root ls: cannot access /dev/root: No such file or directory I ...
1
vote
0answers
605 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
1k 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 ...
4
votes
0answers
383 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
1k 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
561 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
1k 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 ...
2
votes
2answers
9k 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
36 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 ...
7
votes
1answer
1k 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 ...
5
votes
1answer
620 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
67 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
162 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? ...
1
vote
1answer
96 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 2 3 4 5 7