title: Failed to ioctl on specific disks
body: <p>I used /proc/diskstats to get the number of sectors read and wrote. 
  I want to convert this number to bytes so I look for the sector size.
  I used <a href="https://stackoverflow.com/questions/3127119/how-to-find-floppy-cd-sector-size-in-linux">How to find floppy\ CD sector size in Linux?</a> to get the sector size of disks sda, sda1 and sda2 but it fails with the following errors:
  failed ioctl on file /dev/sda with error Invalid argument
  failed ioctl on file /dev/sda1 with error Inappropriate ioctl for device
  and the same for sda2.
  Will appreciate your help.
  Thanks</p>
  
  <pre><code>          struct hd_driveid id;
            string fileName = "/dev/";
            fileName += diskName;
            int fd;
  
            fd = open(fileName.c_str(), O_RDONLY|O_NONBLOCK);
            if (fd &lt; 0) {
                LogError("Cannot open file " &lt;&lt; fileName);
            }
            else
            {
                if (ioctl(fd, HDIO_GET_IDENTITY, &amp;id) &lt; 0) {
                    LogError("failed ioctl on with error " &lt;&lt; strerror(errno));
                } else {
                    currBytesPerSector = id.sector_bytes;
                }
                close(fd);
            }
  </code></pre>