#111 blkid error handling


if you run blid on a bad disk it first issues a request
for 32 sectors to sector 0, then 31 to sector 1, then
30 to sector 2, etc. After that, it tries to read
sector 32, following the same pattern.

This means with a bad disk in your system you will have
several hundred i/o error messages each time blkid runs.

If blkid gets an error on a read, it should skip the
drive and move on to the next.


  • Theodore Ts'o

    Theodore Ts'o - 2005-05-06

    Logged In: YES

    The 32 requests starting at 0, 31 to sector 1, 30 for sector
    2, etc., sounds like something that the kernel is doing, not
    blkid. Can you tell me what version of e2fsprogs you were
    using and give me an strace running "blkid /dev/hdXXX" on
    the bad disk. I've run blkid on a good disk (not having a
    bad one) under strace, and it does about a dozen reads of 1k
    (2 sectors) and one read of 4k (8 sectors), at various
    offsets. The blkid code doesn't have any retry logic in it
    at all. So i'm not sure what you're seeing, which is why it
    would be useful for you to run blkid under strace and send
    me the output.

  • Theodore Ts'o

    Theodore Ts'o - 2005-05-07
    • assigned_to: nobody --> tytso
  • Theodore Ts'o

    Theodore Ts'o - 2005-06-20
    • status: open --> closed-works-for-me
  • Henne Vogelsang

    Henne Vogelsang - 2005-08-12

    strace output of blkid /dev/XXX

  • Henne Vogelsang

    Henne Vogelsang - 2005-08-12

    Logged In: YES

    sorry for the long delay. i finally found a bad disk here.
    strace and syslog output attached

  • Henne Vogelsang

    Henne Vogelsang - 2005-08-12
    • status: closed-works-for-me --> open-works-for-me
  • Henne Vogelsang

    Henne Vogelsang - 2005-08-12

    gzipped syslog output of blkid /dev/XXX

  • Theodore Ts'o

    Theodore Ts'o - 2008-01-01

    Logged In: YES
    Originator: NO

    Most of what you describe is just the kernel's retry algorithm. You are right though that the blkid probing code should abort trying to recognize a device when it starts getting read errors, instead of trying to probe all possible filesystem types.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks