Why Linux returns the device size for 1 block more when it could be read??
location: linuxquestions.com - date: January 29, 2004
The problem I observed on RedHat Linux is that ioctl() returns the device size for 1 block more then it could be read in a reality.
How to get block device add/remove notification in kernel space ?
location: linuxquestions.com - date: November 26, 2012
I had a block device driver working fine on Ubuntu 10.04 ( kernel version 2.6.32) . It used to hook into uevent_ops to get the device add/remove notification in init_module.
my_uevent_ops = kset->uevent_ops;
kset->uevent_ops = my_uevent_ops_callback;
Now I want to port that driver to Ubuntu 12.04 (kernel 3.2.0-32-generic-pae) ,but the kset->uevent_ops is made constant, so it can't hook into it.
Is their any way to get add/remove event notifications of block devices in my device driver?
Also can I use notifier chain for block devices ?
Thanks in advance.
C: Get raw size of Linux block device
location: linuxquestions.com - date: October 16, 2010
How do you go about getting the raw size of a block device under Linux from within a C program? And I mean the raw size of the block device itself, not a file system that may or may not be installed on it. And I'd like to be able to get the raw size of any block device, from hard drives (e.g., /dev/sda) to LVM partitions (/dev/mapper/vg0-home) to loop devices to anything else that is a Linux block device.
Get size of block device Linux/Windows
location: linuxexchange.com - date: November 27, 2012
I have a task to get size of block devices, it must be cross-platform application (Linux/Windows) so I use Qt, can I get file size of block devices usin Qt standard classes such as QFile and QFileInfo? My sketch program doesn't work correct:
int main(int argc, char *argv)
QCoreApplication a(argc, argv);
std::cout<<"Cant read /dev/sda5";
It shows "/dev/sda5 isReadable" and size equals zero, can you help me with this problem?
command to get block size in Ubuntu?
location: ubuntuforums.com - date: March 1, 2010
In a book, I read tha cmchk command is used to get the disk block size. But in Ubuntu, it is not allowed as command is not available.Can some body tell me what is its equivalent in Ubuntu.
block device read size
location: linuxquestions.com - date: October 17, 2008
If I mmap a file, will the kernel load it in page-sized blocks when a part is used, or will it be based on something defined by the device or file system?
Here is why I ask. I'm starting an experiment with b-trees stored in files and I'm going to base its geometry on the size of block that will be loaded into memory for a single read operation. In other words: I want to know if when I go to location p in the map, will p's page be loaded (i.e. getpagesize,) or will I have to have some sort of external information to know how much is loaded?
I'd like to wrap everything in a series of C++ classes and I'd like to know if I can calculate the b-tree's geometry with getpagesize or if I need to require a block size be given. Thanks!
how to know if linux need all compiled in block device?
location: linuxquestions.com - date: April 10, 2013
I have a compaq presario cq60-300eo and I'm compiling my own linux kernel. dmesg give
problem with installing linux gentoo with a "root block device"
location: linuxquestions.com - date: January 31, 2007
linux gentoo won't find "The root block device"
here is a quote:
Can't get Virtualbox to recognize Truecrypt mounted block device
location: ubuntuforums.com - date: January 11, 2010
I am trying to access my external hard drive through Ubuntu which is running as a guest OS using Virtualbox running on Windows XP as host.
Windows XP only recognizes this external drive as an unformatted block device because I used Truecrypt to encrypt and format the entire block device with the Ext3 filesystem.
I use Truecrypt (from within XP host) to mount the block device to drive letter L:\ Obviously, I can't browse the device because XP thinks it's unformatted and can't see the Ext3 filesystem.
In the Virtualbox Options for Shared Folders, I set up the machine name and the path to this Truecrypt mounted volume. I also set up a USB device filter, which it recognizes and lists as Western Digital External HDD . However, when I boot into the Ubuntu guest, it's not listed as a mounted block device, with or without Truecrypt mounting it from within XP.
When I run the command:
sudo mount -t vboxsf -o uid=[username] [share name] [mount point]
I get this er
Ultra slow write speed with custom linux "stacking" block device driver
location: linuxquestions.com - date: August 31, 2011
I'm developing a simple "stacking" linux block device driver. In it's simplest form, this driver will only pass all requests to the "target" device by changing the bi_bdev on the bio.
The driver uses the "make_request" to process incoming requests as opposed with having a standard request queue set up.
The problem is that write performance using this setup makes it unusable; performance is about 10% of the target device. Read performance seem mostly unaffected.
In concept, this is pretty much the same as the MD or DM drivers in linux, but with a "noop" personality; all requests are simply passed to one single target device, always. Of course MD/DM don't suffer from the write performance problem I'm describing, so I want to find out what I'm doing wrong.
Here's the simplest driver I could write that exposes the problem:
It's been tested against 2.6.38. To try it, make sure you defin
Page: 1 2 3 4 5 6 7 8 9 10