Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
6 replies Latest Post - ‏2012-11-14T00:54:40Z by dlmcnabb
wladyslaw17
wladyslaw17
12 Posts
ACCEPTED ANSWER

Pinned topic how to map a block on disk to inode having one referenced?

‏2012-11-12T22:44:04Z |
As in subject - I can't find a way of acheiving that. For example:

Inode 5472346 snap 0 offset 0 N=1 83:5673917568

It says that block 83:5673917568 is held by inode 5472346, this output was produced by tsdbfs gpfs inode 5472346. How can I query that opposite direction, i.e. what inode/dir/whatever block 83:5673917568 references? I understand that it will be expensive operation, but expensive one is much better than none.

And also similar case - how can I check whether gpfs considers block 83:5673917568 as being allocated or unallocated to anything?

The reason for all of that, following major power outage, I was left with some files pointing to blocks gpfs considers unallocated and/or blocks allocated twice and I'm trying to find a way to check block allocation for these files.
Updated on 2012-11-14T00:54:40Z at 2012-11-14T00:54:40Z by dlmcnabb
  • SystemAdmin
    SystemAdmin
    2092 Posts
    ACCEPTED ANSWER

    Re: how to map a block on disk to inode having one referenced?

    ‏2012-11-13T05:42:06Z  in response to wladyslaw17
    You can use mmfileid command to do reverse. This is what part of description of mmfileid command in GPFS Problem Deternmination Guide:

    The mmfileid command

    Use the mmfileid command to determine which files are located on areas of a disk that are damaged or
    considered to be suspect.
    Attention: Use this command only when directed by the IBM Support Center.
    Before running mmfileid, you must run a disk analysis utility and obtain the disk sector numbers that
    are suspect or known to be damaged. These sectors are input to the mmfileid command.

    Please consult GPFS Problem Determination Guide for detailed usage information of mmfileid command.
    • wladyslaw17
      wladyslaw17
      12 Posts
      ACCEPTED ANSWER

      Re: how to map a block on disk to inode having one referenced?

      ‏2012-11-13T15:51:30Z  in response to SystemAdmin
      Kywang,

      mmfileid does work for me, but it does first address only. For example I've got a file:

      :14:30279354368
      :12:30279350272
      :15:30279352320

      I do: mmfileid gpfs -F myfile

      And I get only :14:30279354368 reported and all remaining ones not reported. Is it expected? Manual says that it can do multiple ones, up to 255 I think. My file references 20k blocks, single mmfileid pass takes two hours. I can do 80 passes, but definitely not 20k passes 2h each.

      Also - will it report multiple (i.e. buggy) assignments of disk block or will it report first occurence only? I can't find this information anywhere. I'm also still missing a way of figuring out whether gpfs considers given block allocated or not - mmfileid will report reference to a block, but I doubt it checks for these blocks being considered as unallocated.
      • SystemAdmin
        SystemAdmin
        2092 Posts
        ACCEPTED ANSWER

        Re: how to map a block on disk to inode having one referenced?

        ‏2012-11-13T19:13:58Z  in response to wladyslaw17
        The mmfileid command, as indicated in the documentation, should be used under the IBM Support Center supervision - it is unclear, from your description, whether there is a problem with the tool or a problem with the input file. The mmfileid command does not give information whether a given sector (disk address) is allocated or free.

        You could also use mmfsck -n to collect inconsistencies in the file system - please consult mmfsck man page for the options. Again, it is better to engage the IBM support if in doubt.
      • dlmcnabb
        dlmcnabb
        1012 Posts
        ACCEPTED ANSWER

        Re: how to map a block on disk to inode having one referenced?

        ‏2012-11-13T21:32:02Z  in response to wladyslaw17
        mmfileid will only report one line per inode number. So if multiple of the disk addresses belong to the same file, you will only get the inode number once reporting whichever location it found first.

        I do not understand what you are trying to do with what information. Please explain more.
        • wladyslaw17
          wladyslaw17
          12 Posts
          ACCEPTED ANSWER

          Re: how to map a block on disk to inode having one referenced?

          ‏2012-11-13T23:57:37Z  in response to dlmcnabb
          I've got files becoming scrambled silently and I'm trying to figure out why. In this particular case I've got a file having 20k blocks referenced which got corrupted lately but can be read with no errors and I'm trying to verify that none of these blocks are either assigned more than once (i.e. referenced by more than one inode) or marked as unallocated, as this is the only reasonable explanation I can come up with. From my current understanding mmfileid is no good for that then.
          • dlmcnabb
            dlmcnabb
            1012 Posts
            ACCEPTED ANSWER

            Re: how to map a block on disk to inode having one referenced?

            ‏2012-11-14T00:54:40Z  in response to wladyslaw17
            If a block is assigned to two files, then both inodes will be reported in the output.

            But you are correct, with many blocks you will not be able to determine this from mmfileid.

            If you are suspicious of a cross linked file, then copy the file, leave the old copy in an out-of-the way place and don't delete it.

            Only offline mmfsck will do the right thing.