- <title>28.2.6 Looking at Disk Content</title>
- <para>In Lustre, the inodes on the metadata server contain extended attributes (EAs) that store information about file striping. EAs contain a list of all object IDs and their locations (that is, the OST that stores them). The <literal>lfs</literal> tool can be used to obtain this information for a given file using the <literal>getstripe</literal> subcommand. Use a corresponding <literal>lfs setstripe</literal> command to specify striping attributes for a new file or directory.</para>
- <para>The <literal>lfs getstripe</literal> utility is written in C; it takes a Lustre filename as input and lists all the objects that form a part of this file. To obtain this information for the file <literal>/mnt/lustre/frog</literal> in Lustre file system, run:</para>
- <screen>$ lfs getstripe /mnt/lustre/frog
-$
- obdix objid
- 0 17
- 1 4
-</screen>
- <para>The <literal>debugfs</literal> tool is provided in the <literal>e2fsprogs</literal> package. It can be used for interactive debugging of an <literal>ldiskfs</literal> file system. The <literal>debugfs</literal> tool can either be used to check status or modify information in the file system. In Lustre, all objects that belong to a file are stored in an underlying <literal>ldiskfs</literal> file system on the OSTs. The file system uses the object IDs as the file names. Once the object IDs are known, use the <literal>debugfs</literal> tool to obtain the attributes of all objects from different OSTs.</para>
- <para>A sample run for the <literal>/mnt/lustre/frog</literal> file used in the above example is shown here:</para>
- <screen> $ debugfs -c /tmp/ost1
- debugfs: cd O
- debugfs: cd 0 /* for files in group 0 */
- debugfs: cd d<objid % 32>
- debugfs: stat <objid> /* for getattr on object */
- debugfs: quit
-## Suppose object id is 36, then follow the steps below:
- $ debugfs /tmp/ost1
- debugfs: cd O
- debugfs: cd 0
- debugfs: cd d4 /* objid % 32 */
- debugfs: stat 36 /* for getattr on obj 4*/
- debugfs: dump 36 /tmp/obj.36 /* dump contents of obj 4 */
- debugfs: quit</screen>
+ <title><indexterm><primary>debugging</primary><secondary>disk contents</secondary></indexterm>Looking at Disk Content</title>
+ <para>In a Lustre file system, the inodes on the metadata server contain extended attributes
+ (EAs) that store information about file striping. EAs contain a list of all object IDs and
+ their locations (that is, the OST that stores them). The <literal>lfs</literal> tool can be
+ used to obtain this information for a given file using the <literal>getstripe</literal>
+ subcommand. Use a corresponding <literal>lfs setstripe</literal> command to specify striping
+ attributes for a new file or directory.</para>
+ <para>The <literal>lfs getstripe</literal> command takes a Lustre filename as input and lists
+ all the objects that form a part of this file. To obtain this information for the file
+ <literal>/mnt/testfs/frog</literal> in a Lustre file system, run:</para>
+ <screen>$ lfs getstripe /mnt/testfs/frog
+lmm_stripe_count: 2
+lmm_stripe_size: 1048576
+lmm_pattern: 1
+lmm_layout_gen: 0
+lmm_stripe_offset: 2
+ obdidx objid objid group
+ 2 818855 0xc7ea7 0
+ 0 873123 0xd52a3 0
+ </screen>
+ <para>The <literal>debugfs</literal> tool is provided in the
+ <literal>e2fsprogs</literal> package. It can be used for interactive
+ debugging of an <literal>ldiskfs</literal> file system. The
+ <literal>debugfs</literal> tool can either be used to check status or
+ modify information in the file system. In a Lustre file system, all
+ objects that belong to a file are stored in an underlying
+ <literal>ldiskfs</literal> file system on the OSTs. The file system
+ uses the object IDs as the file names. Once the object IDs are known,
+ use the <literal>debugfs</literal> tool to obtain the attributes of
+ all objects from different OSTs.</para>
+ <para>A sample run for the <literal>/mnt/testfs/frog</literal> file used
+ in the above example is shown here:</para>
+ <screen>$ debugfs -c -R "stat O/0/d$((818855 % 32))/818855" /dev/vgmyth/lvmythost2
+
+debugfs 1.41.90.wc3 (28-May-2011)
+/dev/vgmyth/lvmythost2: catastrophic mode - not reading inode or group bitmaps
+Inode: 227649 Type: regular Mode: 0666 Flags: 0x80000
+Generation: 1375019198 Version: 0x0000002f:0000728f
+User: 1000 Group: 1000 Size: 2800
+File ACL: 0 Directory ACL: 0
+Links: 1 Blockcount: 8
+Fragment: Address: 0 Number: 0 Size: 0
+ ctime: 0x4e177fe5:00000000 -- Fri Jul 8 16:08:37 2011
+ atime: 0x4d2e2397:00000000 -- Wed Jan 12 14:56:39 2011
+ mtime: 0x4e177fe5:00000000 -- Fri Jul 8 16:08:37 2011
+crtime: 0x4c3b5820:a364117c -- Mon Jul 12 12:00:00 2010
+Size of extra inode fields: 28
+Extended attributes stored in inode body:
+ fid = "08 80 24 00 00 00 00 00 28 8a e7 fc 00 00 00 00 a7 7e 0c 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 " (32)
+ fid: objid=818855 seq=0 parent=[0x248008:0xfce78a28:0x0] stripe=0
+EXTENTS:
+(0):63331288
+ </screen>