2007-06-14 13:22:02

by Tejas Sumant

[permalink] [raw]
Subject: Couple of queries related to htree directory

Hi All,

Any idea, how to search a directory on given ext3 file system, which
is having htree structure?
Also is there any way to create a htree indexed directory explicitly?
using some command or tool?

Thanks
--
Tejas Sumant


2007-06-14 18:46:55

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Couple of queries related to htree directory

On Thu, Jun 14, 2007 at 06:52:01PM +0530, Tejas Sumant wrote:
>
> Any idea, how to search a directory on given ext3 file system, which
> is having htree structure?

The same way you search any other Linux/Unix system. I.e., using
opendir()/readir() from a C program, or /bin/ls from a shell program,
etc. It's completely transparent.

> Also is there any way to create a htree indexed directory explicitly?
> using some command or tool?

Once the dir_index feature is enabled, for all new directories and all
directories which are only take one disk block grow to bigger than one
disk block, they automatically get indexed. (There's no point
indexing a single directory block since that's equivalent to a single
leaf block.)

To convert existing directories, you need to unmount the filesystem
and use the command:

e2fsck -fD /dev/hdXX

This really should be added to an FAQ on ext4.wiki.kernel.org....

- Ted

2007-06-15 11:00:02

by Tejas Sumant

[permalink] [raw]
Subject: Re: Couple of queries related to htree directory

Hi Theodore,

My file system has dir_index feature.
When I created new directory larger than blocksize and run htree
command of debugfs on it, I received message that the directory is not
in htree format.

Any idea why this happened?

Thanks

On 6/15/07, Theodore Tso <[email protected]> wrote:
> On Thu, Jun 14, 2007 at 06:52:01PM +0530, Tejas Sumant wrote:
> >
> > Any idea, how to search a directory on given ext3 file system, which
> > is having htree structure?
>
> The same way you search any other Linux/Unix system. I.e., using
> opendir()/readir() from a C program, or /bin/ls from a shell program,
> etc. It's completely transparent.
>
> > Also is there any way to create a htree indexed directory explicitly?
> > using some command or tool?
>
> Once the dir_index feature is enabled, for all new directories and all
> directories which are only take one disk block grow to bigger than one
> disk block, they automatically get indexed. (There's no point
> indexing a single directory block since that's equivalent to a single
> leaf block.)
>
> To convert existing directories, you need to unmount the filesystem
> and use the command:
>
> e2fsck -fD /dev/hdXX
>
> This really should be added to an FAQ on ext4.wiki.kernel.org....
>
> - Ted
>


--
Tejas Sumant

2007-06-15 16:32:55

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Couple of queries related to htree directory

On Fri, Jun 15, 2007 at 04:30:02PM +0530, Tejas Sumant wrote:
> Hi Theodore,
>
> My file system has dir_index feature.
> When I created new directory larger than blocksize and run htree
> command of debugfs on it, I received message that the directory is not
> in htree format.

Can you run the debugfs stat command on the directory and send me the
output?

Thanks,

- Ted

2007-06-18 02:15:38

by Tejas Sumant

[permalink] [raw]
Subject: Re: Couple of queries related to htree directory

Ok. I will try lsattr. I willl let you know outcome.

Thanks


On 6/15/07, Theodore Tso <[email protected]> wrote:
> On Fri, Jun 15, 2007 at 04:30:02PM +0530, Tejas Sumant wrote:
> > Hi Theodore,
> >
> > My file system has dir_index feature.
> > When I created new directory larger than blocksize and run htree
> > command of debugfs on it, I received message that the directory is not
> > in htree format.
>
> Can you run the debugfs stat command on the directory and send me the
> output?
>
> Thanks,
>
> - Ted
>


--
Tejas Sumant

2007-06-18 09:13:01

by Tejas Sumant

[permalink] [raw]
Subject: Re: Couple of queries related to htree directory

Yes the lsattr found a directory with htree structure for me.

Thanks a lot!!!

On 6/18/07, Tejas Sumant <[email protected]> wrote:
> Ok. I will try lsattr. I willl let you know outcome.
>
> Thanks
>
>
> On 6/15/07, Theodore Tso <[email protected]> wrote:
> > On Fri, Jun 15, 2007 at 04:30:02PM +0530, Tejas Sumant wrote:
> > > Hi Theodore,
> > >
> > > My file system has dir_index feature.
> > > When I created new directory larger than blocksize and run htree
> > > command of debugfs on it, I received message that the directory is not
> > > in htree format.
> >
> > Can you run the debugfs stat command on the directory and send me the
> > output?
> >
> > Thanks,
> >
> > - Ted
> >
>
>
> --
> Tejas Sumant
>


--
Tejas Sumant