Questions tagged [block-device]
30 questions
19
votes
1 answer
USB detected but not found in /dev
I have a Parabola Linux (based on Arch Linux) installation with Kernel 4.9.6.
When I insert a USB external hard disk I can see it in lsusb as
Bus 002 Device 055: ID 0411:01de BUFFALO INC. (formerly MelCo., Inc.) External Hard Drive HD-PCTU3…
gmask
- 191
17
votes
2 answers
How to check if an attached SSD device is SATA or PCIe on Linux?
I have a machine with both SATA and PCIe SSDs attached. Is there a set of Linux commands (on Ubuntu or CentOS) that I can use to check if a given SSD is SATA or PCIe?
Safdar Iqbal
- 173
8
votes
1 answer
Why are there two mechanisms to remove/hide disks in Linux?
I'm using Linux from external drive. I don't want it to see primary disk with Windows at all. In the past I have been doing that by writing 1 to /sys/block/devices/sd*/device/delete (writing from memory).
But with other laptop, which has NVMe disk,…
Robert G
- 183
7
votes
2 answers
Scan image file or disk for pattern and return its location
Say I have a block device or an image file. And say I also have a sequence of bytes or a string or some search pattern. How can I get the positions of the occurrences of such a pattern or string? Are there any tools for that?
Melab
- 1,219
4
votes
1 answer
How to read tmpfs as a block device in linux?
A typical linux machine mounts a tmpfs to store temporary files:
$ df
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 953M 702M 203M 78% /
tmpfs 1.5G 111M 1.5G 0% /tmp
...
On a live machine, how…
Duke Nukem
- 1,255
- 2
- 10
- 21
4
votes
1 answer
How to auto-mount loop-devices with partitions
I am testing some filesystem driver code and would like to do so outside of the kernel. The simplest and safest method for doing this is from userspace. So, I have created a file of some length
dd if=/dev/zero of=testfs bs=10M count=50
Then I…
sherrellbc
- 839
- 5
- 17
- 31
2
votes
1 answer
Block and char device over network on linux
It there a generic way to share a block or character device over network?
All related questions solved with specific answer like: if you want to share disk between host, use NFS, SMB, iSCSI, or AoE. If you want to share TV tuner or WebCam, stream…
Dankó Dávid
- 2,009
2
votes
1 answer
Why does lsblk report partition as "null" from within a docker container?
The following lsblk command returns "null" for several fields when called from within my archlinux container. On my natively running system the lsblk command returns values for all fields as expected.
lsblk --json -b -o+partn,partuuid,parttype,uuid…
Raven
- 209
2
votes
1 answer
How to make a swappable in-memory block device in Linux without tmpfs?
One can make a ramdisk in Linux by modprobe brd rd_nr=1 rd_size=$SizeInKB (creates uncompressed /dev/ram0) or by modprobe zram && echo $SizeInBytes >| /sys/block/zram0/disksize (creates compressed /dev/zram0).
These types of ramdisk are both unable…
Juergen
- 666
2
votes
1 answer
How to achieve full speed with AWS EBS volume
I'm testing EBS volumes, trying to figure out how to achieve the advertised speed. Amazon says io1 volumes can do 1000MBps or 64,000 IOPS at 16K. I'm not seeing any higher than 600MBps. This is an m5n.2xlarge instance (with Nitro card) with a…
Elliott B
- 1,347
- 5
- 17
- 44
2
votes
2 answers
`e2fsck -n` + how to know if need to run e2fsck in order to fix corrupted blocks?
We want to check the filesystem on the disks as /deb/sdc ... /dev/sdg on each Red Hat Linux machine.
The target is to find what are the disks that require e2fsck ( as e2fsck -y /dev/sdb etc.)
According to man page
-n
Open the filesystem…
King David
- 1,001
1
vote
1 answer
How can I access a block device file as a regular file with defined size in Linux?
I need to transfer all the data from an external hard drive through the internet, including its partition table, boot sector - everything -, but I don't have space anywhere to copy that entire hard drive into an image file to do that.
Plus, the…
user2934303
- 261
1
vote
0 answers
btt in blktrace tool does not report any data in android
I have collected trace data in file parse.bin with blktrace in android.
Then I use btt to parse the cellocted data as below:
/ssd/blktrace/btt/btt -i parse.bin
But it does not report any data. The report is as below:
==================== All…
Jun
- 11
1
vote
2 answers
What's the minimum number of lba I can trim (sg_unmap) from a device?
I run this command:
sg_unmap -v -l 0 -n 1 DEVICE
and it doesn't fail but it also doesn't do anything.
when I increase it to n=8 then it's trimming 8 lbas
why it's working like that? I couldn't figure it out from the help file.
Is there a relation…
Lio
- 11
1
vote
0 answers
Why BlockDeviceMapping does not create UUID?
In Linux machines, block devices have UUID
Below is the CloudFormation template:
"BlockDeviceMappings": [
{
"DeviceName" : "/dev/sdf",
"Ebs" : {
"VolumeSize" : "20",
…
overexchange
- 147