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.
Code:
E.x. ioctl(devfile, BLKGETSIZE, &blksize) returns blksize=226
but
dd if=/dev/hdb6 of=hdb6.img shows that it was written 225 blocks!!!
does anybody know why it's designed in that way? or is it a bug?
I use RHEL and kernel 2.4
Thanks!