Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 safecopy fails to access /dev/raw devices

default
closed-fixed
Eric Price
2
2009-07-30
2009-07-17
Eric Price
No

safecopy reading from /dev/raw devices fails, even if the blocksize is set correctly to a multiple of the sector boundary.

The reason is that for read() to work on a raw device, the buffer memory must be aligned to a multiple of the sector size, otherwise read() will return -1, EINVAL.

Solution:
1. Always align buffer pointer address to multiple of blocksize
2. Using /dev/raw is deprecated, look into implementing O_DIRECT in next safecopy version

This is supposed to get fixed in safecopy 1.5, release date unknown.

side-bugs: debug output does not state cause of read error when reporting read errors (safecopy --debug=255) - might be fixed, too.

Discussion

  • Eric Price
    Eric Price
    2009-07-30

    • status: open --> closed-fixed
     
  • Eric Price
    Eric Price
    2009-07-30

    fixed with release of safecopy-1.5