<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
        {mso-style-priority:1;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi
Goncalo,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Here&#8217;re
some guidelines to rectify your issue:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><b><u><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Identify
cluster node and application associated with orphan_dir<o:p></o:p></span></u></b></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><a name=top><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Run the following
command(s) on each cluster node to identify which node, application or user
(holders) are associated with orphan_dir entries.<o:p></o:p></span></a></p>

<p class=MsoNormal><code><span style='font-size:10.0pt'># find /proc -name fd
-exec ls -l {} \; | grep deleted</span></code><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
<code>&nbsp;or</code><br>
<code># lsof&nbsp;| grep -i deleted</code></span><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Arial","sans-serif"'><br>
</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Next,
review the output of the above command(s) noting any that relate to the OCFS2
filesystem in question.<br>
At this point, you should be able to determine the holding process id (pid)</span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal><a name=aref4></a><b><u><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>Releasing disk space associated with OCFS2
orphan directories</span></u></b><span style='font-size:10.0pt;font-family:
"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>The above step allows you to identify the pid
associated with orphaned files.<br>
If the holding process(es) can still be gracefully interacted with via their
user interface, and you are certain that the process is safe to stop without
adverse effect upon your environment, then shutdown the process(es) in
question. Once the process(es) close their open file descriptors, orphaned
files will be deleted and the associated disk space made available.<br>
<br>
If the process(es) in question cannot be interacted with via their user
interface, or if you are certain the processes are no longer required, then
kill the associated process(es) i.e. `kill &lt;pid&gt;`. If any process(es) are
no longer communicable (i.e. zombie) or cannot be successfully killed, a forced
unmount of the OCFS2 volume in question and/or reboot of the associated cluster
node may be necessary in order to recover the disk space associated with
orphaned files.<o:p></o:p></span></p>

<p class=MsoNoSpacing><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Let
us know how it goes!<o:p></o:p></span></p>

<p class=MsoNoSpacing><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNoSpacing><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Best
regards,<o:p></o:p></span></p>

<p class=MsoNoSpacing><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Karim
Alkhayer<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> ocfs2-users-bounces@oss.oracle.com
[mailto:ocfs2-users-bounces@oss.oracle.com] <b>On Behalf Of </b>Gonçalo Borges<br>
<b>Sent:</b> Monday, July 27, 2009 4:35 PM<br>
<b>To:</b> ocfs2-users@oss.oracle.com<br>
<b>Subject:</b> [Ocfs2-users] How to clean orphan metadata?<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hi All...<br>
<br>
1) I have recently deleted a big 100GB file from an OCFS2 partition. The
problem is that a &quot;df&quot; command still shows that partition with 142 GB
of used spaced when it should report ~42Gb of used space (look to <b>/site06)</b>:<br>
<br>
[root@core23 ~]# df -h<br>
Filesystem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Size&nbsp; Used Avail Use% Mounted on<br>
/dev/sda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
87G&nbsp; 2.4G&nbsp;&nbsp; 80G&nbsp;&nbsp; 3% /<br>
tmpfs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
512M&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 512M&nbsp;&nbsp; 0% /dev/shm<br>
none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
512M&nbsp; 104K&nbsp; 512M&nbsp;&nbsp; 1% /var/lib/xenstored<br>
/dev/mapper/iscsi04-lun1p1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
851G&nbsp;&nbsp; 63G&nbsp; 788G&nbsp;&nbsp; 8% /site04<br>
/dev/mapper/iscsi05-lun1p1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
851G&nbsp;&nbsp; 65G&nbsp; 787G&nbsp;&nbsp; 8% /site05<br>
/dev/mapper/iscsi06-lun2p1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
884G&nbsp; 100G&nbsp; 785G&nbsp; 12% /apoio06<br>
/dev/mapper/iscsi06-lun1p1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>851G&nbsp; 142G&nbsp; 709G&nbsp; 17% /site06<br>
<br>
<br>
</b>2) Running &quot;debugfs.ocfs2 /dev/mapper/iscsi06-lun1p1&quot;, I found
the following relevant file:<br>
<br>
debugfs: ls -l //orphan_dir:0001<br>
&nbsp;&nbsp;&nbsp;
13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
drwxr-xr-x&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3896 27-Jul-2009
09:55 .<br>
&nbsp;&nbsp;&nbsp;
6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
drwxr-xr-x&nbsp; 18&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096&nbsp; 9-Jul-2009
12:24 ..<br>
&nbsp;&nbsp;&nbsp; 524781&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-rw-r--r--&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp;&nbsp; 104857600000 24-Jul-2009 16:35 00000000000801ed<br>
<br>
<br>
3) I need to clean this metadata information, but I can not run
&quot;fsck.ocfs2 -f&quot; because this is a production filesystem being
accessed by 12 clients. To run &quot;fsck.ocfs2 -f&quot; I would have to
unmount the partition from all the clients, and this is not a solution at the
time. The software I'm currently using is:<br>
<br>
[root@core09 log]# cat /etc/redhat-release <br>
Scientific Linux SL release 5.3 (Boron)<br>
<br>
[root@core09 log]# uname -a<br>
Linux core09.ncg.ingrid.pt 2.6.18-128.1.16.el5xen #1 SMP Tue Jun 30 07:06:24
EDT 2009 x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
[root@core09 log]# rpm -qa | grep ocfs2<br>
ocfs2-2.6.18-128.1.16.el5xen-1.4.2-1.el5<br>
ocfs2-tools-1.4.2-1.el5<br>
ocfs2console-1.4.2-1.el5<br>
<br>
<br>
Is there a workaround for this?<br>
Cheers<br>
Goncalo<o:p></o:p></p>

</div>

</body>

</html>