Questions tagged [block-device]

Block devices are a specific type of Unix device node, typically representing storage devices such as hard drives, CD-ROMs, etc.

Block devices are a specific type of Unix device node which the operating system reads from and/or writes to in blocks of data -- typically a multiple of 512 bytes.

Some common block devices are hard drives and CD-ROM systems.

Traditionally block devices have been cached by the operating system. As this caching can lead to undesirable behavior a "raw" block device is typically also provided.

73 questions
4
votes
0 answers

AWS: Can't mount my restored volume (EBS snapshot)

I restored an EBS volume from AWS Backup and attached it to a new EC2 instance. When I lsblk I can see it under the name /dev/nvme1n1. More specifically the output of lsblk is: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 …
HelloWorld
  • 137
  • 4
3
votes
1 answer

How to retain blockdev changes after server restart?

I am setting block device read ahead buffer size like so: blockdev --setra 8192 /dev/sda As suggested here. The problem is after restart it goes back to 256 (default). I need it to retain the value i set it to. How can i do this? I'm on Ubuntu…
Michael Rogers
  • 60
  • 1
  • 3
  • 16
3
votes
1 answer

Documented size of Linux kernel partition sector size in bytes

My primary question is to authoritatively see if the block size used in sector counts: /sys/block///size is in fact 512 B, or if this can vary. I thought this would be fairly easy to find an answer to, but for example…
Lizardx
  • 210
  • 1
  • 9
3
votes
1 answer

Making NFS behave like a block device

We're currently working on a virtualization setup, and because of features like being able to grow volumes on our filers rather than having to go through the process resizing block devices etc. we'd like to use NFS volumes for everything,…
Nick Bruun
  • 63
  • 1
  • 4
3
votes
1 answer

Create variable sized RAM-backed file systems (Ext4 and Btrfs)

For benchmarking purposes I need to format and mount variable sized ram-backed block devices with Ext4 and Btrfs. Unfortunately the only solution I have come across uses ramdisks which seem to be inflexible (they are all the same size). The only…
Noah Watkins
  • 133
  • 7
3
votes
2 answers

Force block device (NBD) to bypass the buffer cache

I'd like to know if there is a way to force a block device to bypass the linux buffer cache (ie direct IO) and pass the requests directly to the underlying layer. I know one can open a file using O_DIRECT flag to achieve this, but my program is not…
Mansour
  • 499
  • 2
  • 7
  • 14
3
votes
3 answers

Filesystem for a shared block device for a linux

Is there such a thing? I don't care about performance, I just need to be able to have access to the same block device from two computers. The block device does not have anything fancy (like reservations), so it's pure read/write device without…
George Shuklin
  • 296
  • 2
  • 11
2
votes
1 answer

In CentOS 7, is there a way to specify which block devices should be tuned with the scheduler (or ELEVATOR)?

In CentOS 6, there was /etc/tune-profiles/my-server/ktune.sysconfig with this text(I'm referring to the comments that explain what the code is doing): # This is the I/O scheduler ktune will use. This will *not* override anything # explicitly set on…
Levi Uzodike
  • 125
  • 6
2
votes
2 answers

Why is dmsetup failing when I try to create a snapshot?

I would like to create a COW device for an existing block device using dmsetup. The block device is: # blockdev --getsz /dev/loop0 3534848 I am trying to use a 256M ramdisk as the backing store: # blockdev --getsz /dev/zram1 524288 I am using the…
larsks
  • 43,623
  • 14
  • 121
  • 180
2
votes
2 answers

Understanding stat, du and ls -l output on my nfs mount

ls -l f.txt -rwxrwxr-x 1 abc abc 1161 Sep 1 02:02 f.txt stat f.txt File: `f.txt' Size: 1161 Blocks: 34 IO Block: 524288 regular file Device: 38h/56d Inode: 6448956669 Links: 1 Access: (0775/-rwxrwxr-x) Uid: ( 1024/ carle) …
Ankur Agarwal
  • 457
  • 1
  • 6
  • 15
2
votes
1 answer

How to know if some data already exists on a device disk?

The simple way to check if disk include filesystem is to do: mount /grid/sdb /mnt and if sdb or other /dev/sdx have file-system then mount will be succeeded, if not. Probably file system exists! But this is an ugly way to check that. What the…
shalom
  • 461
  • 13
  • 29
2
votes
2 answers

How to query DRBD device size?

To write Ansible script to setup DRBD device and file systems, I face the following issue: # blockdev --report /dev/drbd0 RO RA SSZ BSZ StartSec Size Device blockdev: cannot open /dev/drbd0: Wrong medium type I would have…
Yves Martin
  • 879
  • 3
  • 8
  • 21
2
votes
2 answers

How to tell mdadm to use a partition as/instead of a block-device?

I have four 500GB disks which were set up as a Linux Software-RAID 5 volume during the Debian install (next to the system drive which is a SSD). One of the drives (sda) went bad and now I am trying to replace it and I'm experiencing some…
Cpt.Bloodner
  • 68
  • 1
  • 6
2
votes
0 answers

Partition block size different from device's and stacked LVM volumes ones

I have a pair of HP ML350 G6 servers with LSI MegaRAID 9266-4i+CacheVault driving Supermicro CSE836E16 enclosures via SAS bracket, filled with WD RE 3TB SATA drives. On these are configured a RAID10 array with one big virtual/logical drive with…
silopolis
  • 460
  • 3
  • 7
2
votes
1 answer

Linux device names: What other non-standard storage device names are there apart from /dev/cciss

This is a question about Linux storage device names on RHEL5 and RHEL6 Most storage devices are accessible using device names /dev/sda, /dev/sdb, etc. By storage device I mean a device that could be partitioned, formatted and mounted as regular…
Sam Elstob
  • 365
  • 1
  • 3
  • 7