TruCluster
Showing results for 
Search instead for 
Do you mean 

Defragmenting the index of a directory

Occasional Advisor

Defragmenting the index of a directory

Trucluster V5.1a Patch Kit 6
Is it supported to use migrate to defragment the fragmented index of a directory containing nearly 4m files?
The road of excess leads to the Palace of Wisdom
2 REPLIES
Honored Contributor

Re: Defragmenting the index of a directory


In the understanding that you ar talking about and AdvFS domain with multiple volumes...
the /usr/sbin/migrate moves 'one' file or part of that file from one volume to another
volume in the domain and tries to use contigeous blocks at the destination IF there are enough contigeous blocks available.
Given that a directory itself is also a file
it migth help.

If your domain contains only one volume, then /usr/sbin/defragment is the tool to use. Else if you have a spare disk of equal or larger capacity, you can use an addvol/rmvol combination.

__ Johan

_JB_
Occasional Advisor

Re: Defragmenting the index of a directory

Hi, thanks for the reply. migrate can be used to defragment a file or directory in a domain with one volume- it justs shifts the file/directory to another place on that volume. I cannot use defragment because the domain is very fragmented and it would take a week and make the system unusable in the meantime. I made a mistake in the original posting, the directory contains only about 64K subdirectories, the fileset that it is in contains 4M files. My objective is to try to defragment key areas to improve performance using migrate so for example
# showfile -x /var/spool/imap/default/user

Id Vol PgSz Pages XtntType Segs SegSz I/O Perf File
8.8001 1 16 185 simple ** ** ftx 75% user (index)

extentMap: 1
pageOff pageCnt vol volBlock blockCnt
0 96 1 148645712 1536
96 55 1 281398160 880
151 30 1 148949584 480
181 1 1 146160832 16
182 1 1 90929552 16
183 1 1 209372304 16
184 1 1 179149168 16
extentCnt: 7
# migrate /var/spool/imap/default/user
# showfile -x /var/spool/imap/default/user

Id Vol PgSz Pages XtntType Segs SegSz I/O Perf File
8.8001 1 16 185 simple ** ** ftx 92% user (index)

extentMap: 1
pageOff pageCnt vol volBlock blockCnt
0 135 1 160607872 2160
135 50 1 71711856 800
extentCnt: 2
csdalpha1a#

shows that the said directory can be defragmeneted using migrate. However

# showfile -xi /var/spool/imap/default/user

Id Vol PgSz Pages XtntType Segs SegSz I/O Perf File
3c2c.8001 1 16 171 simple ** ** ftx 7% index (user)

extentMap: 1
pageOff pageCnt vol volBlock blockCnt
0 2 1 93830480 32
...................
170 1 1 263131520 16
extentCnt: 169

shows that the index file is heavily fragmented. Since the index files tag is 3c2c.8001 and 3c2c is 15404 I want to know whether
migrate /var/spool/imap/.tags/15404
is supported.

Regards Tom
The road of excess leads to the Palace of Wisdom
//Add this to "OnDomLoad" event