<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Freeing disk space in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546935#M875211</link>
    <description>/var (as you've probably seen is a very crucial filesystem for every user on the system (including root) and usually needs to be segmented to prevent mistakes in one subsystem from taking the entire filesystem down.&lt;BR /&gt;&lt;BR /&gt;For a print job, I take the approach that these are not as important as loss of email, loss of system logging, and other application crashes which will occur wehn /var fills...so I would either:&lt;BR /&gt;&lt;BR /&gt;lpcancel XXX&lt;BR /&gt;&lt;BR /&gt;(and that removes the print job)&lt;BR /&gt;&lt;BR /&gt;or cp the two files (in case someone wants to print it later) to some other filesystem like /tmp (note: 2 files, the data file AND the control file).&lt;BR /&gt;&lt;BR /&gt;But to keep /var under control, consider adding a 4 Gbyte disk (they are really cheap) and creating mountpoints for:&lt;BR /&gt;&lt;BR /&gt;/var/tmp&lt;BR /&gt;/var/spool&lt;BR /&gt;/var/mail&lt;BR /&gt;/var/adm&lt;BR /&gt;/var/adm/sw&lt;BR /&gt;&lt;BR /&gt;Then go into single user mode (need to have /var unmounted) and temporarily mount each of the new lvols so you can move the files and directories from /var to their appropriate locations on the new disk.&lt;BR /&gt;&lt;BR /&gt;Then umount the temp locations, edit fstab and verify that a mount command for each new mountpoint works OK.  Naturally, you would want to do a back before any of this.&lt;BR /&gt;&lt;BR /&gt;Now, if spooling fills, mail runs and logs are OK and applications run OK, etc.  Same thing for email filling /var/mail...</description>
    <pubDate>Fri, 29 Jun 2001 21:54:04 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2001-06-29T21:54:04Z</dc:date>
    <item>
      <title>Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546925#M875201</link>
      <description>Is there a better way to free up disk space?&lt;BR /&gt;I had a user create a very large print job by mistake.  150MG and it filled /var/spool to 100%.&lt;BR /&gt;When I rm'd it it took about 15 minutes before bdv /var/spool showed it gone and no one could print untill then.&lt;BR /&gt;On a non HP system we had the same problem and it neveer did ,in 30 minuets, clear so we rebooted the server to clean it up.&lt;BR /&gt;&lt;BR /&gt;I'm thinking &amp;gt;the.file.name may zero it and release the space but havn't had the opertunity to try it.&lt;BR /&gt;&lt;BR /&gt;Any ideas?</description>
      <pubDate>Fri, 29 Jun 2001 13:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546925#M875201</guid>
      <dc:creator>Larry Basford</dc:creator>
      <dc:date>2001-06-29T13:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546926#M875202</link>
      <description>Hi Larry,&lt;BR /&gt;&lt;BR /&gt;No, not really but you need to understand what rm (or more accurately unlink() at the system level does). It decrements the link count to a file (inode). When that count falls to zero&lt;BR /&gt;the directory entry is removed. When no processes have the file open, the file is then removed. In your case, because the file was printing, an lp process had the file open and thus it could not be removed from the filesystem eventhough the directory had been removed.  Had you stopped the lp process then the space would have 'come back' very quickly.&lt;BR /&gt;&lt;BR /&gt;Hope this clears things up, Clay</description>
      <pubDate>Fri, 29 Jun 2001 14:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546926#M875202</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-29T14:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546927#M875203</link>
      <description>I actually did a mv on the file to /tmp to keep it.  The file moved OK  but space didn't come free.&lt;BR /&gt;&lt;BR /&gt;You say if I lpshut then rm it should free the space ?</description>
      <pubDate>Fri, 29 Jun 2001 14:05:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546927#M875203</guid>
      <dc:creator>Larry Basford</dc:creator>
      <dc:date>2001-06-29T14:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546928#M875204</link>
      <description>If you do an lpshut and then rm the file, the file should be removed and the space should become available.  That is assuming that lp is the only process that has the file open.  If the user still has the file open, then you will still have the problem until the user closes the file.  If you want to check who has a file open, lsof is a good utiltiy to use.&lt;BR /&gt;&lt;BR /&gt;Even with a move (which is essentially a cp and then a rm) the file won't be removed until the file is closed by whatever has it open.</description>
      <pubDate>Fri, 29 Jun 2001 14:24:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546928#M875204</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-06-29T14:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546929#M875205</link>
      <description>Larry,&lt;BR /&gt;&lt;BR /&gt;a quicker way to handle for any file that doesn't "release" it's space after being removed is to do an fuser on the file.  This will give you the pid(s) of the file that has the file open, you can then ps on those pids and decide whether to kill them, restart something (such as lp), etc...&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Jun 2001 18:53:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546929#M875205</guid>
      <dc:creator>Charles McCary</dc:creator>
      <dc:date>2001-06-29T18:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546930#M875206</link>
      <description>Thanks all who  responded.&lt;BR /&gt;But if I do an mv   which is a cp and a rm&lt;BR /&gt;and the file is on a different filesystem &lt;BR /&gt;and no longer ls's in the old location&lt;BR /&gt;bdf on /var/spool is still at 100%&lt;BR /&gt;and the spooler is not running.&lt;BR /&gt;What do I run fuser on ?&lt;BR /&gt;Or lsof what ?&lt;BR /&gt;If someone has the file open why did the file name go away.</description>
      <pubDate>Fri, 29 Jun 2001 19:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546930#M875206</guid>
      <dc:creator>Larry Basford</dc:creator>
      <dc:date>2001-06-29T19:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546931#M875207</link>
      <description>Hey - just touch the file name in the original directory, then do an fuser on the filename, I think this will work.&lt;BR /&gt;&lt;BR /&gt;If that doesn't work, do an fuser * from within the original dir.</description>
      <pubDate>Fri, 29 Jun 2001 19:16:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546931#M875207</guid>
      <dc:creator>Charles McCary</dc:creator>
      <dc:date>2001-06-29T19:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546932#M875208</link>
      <description>Hi Larry,&lt;BR /&gt;&lt;BR /&gt;You packed a lot of questions in. You will note that I did not say do an lpshut in my original response because that may not be enough. If any spooler program or filter had the original file open in /var/spool then that would hold the space until the file is closed.&lt;BR /&gt;Not all lp related files and especially 'homegrown' filters respond to an lpshut command. &lt;BR /&gt;&lt;BR /&gt;I would need to experiment with lsof to see what it does in the case that a file has been unlinked but is help open by some process. &lt;BR /&gt;&lt;BR /&gt;A very common routine in a C program is to do this to create a temporary file:&lt;BR /&gt;&lt;BR /&gt;fdes = open("myfile",O_RDWR | O_CREAT,0600);&lt;BR /&gt;unlink("myfile");&lt;BR /&gt;&lt;BR /&gt;This has the effect of open and creating "myfile" and then removing "myfile". It's really still there but there is no directory entry. This program can read and write to this non-existant file to its heart's content but the rest of the system knows nothing about it except that filesystem space is used. Only when a close(fdes) is done is the space returned. The very same thing occurred in your case. The mv did nothing to free up space in /var until the process closed the file.&lt;BR /&gt;&lt;BR /&gt;Hope this clears it up a bit, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Jun 2001 19:25:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546932#M875208</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-29T19:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546933#M875209</link>
      <description>Hi Larry,&lt;BR /&gt;&lt;BR /&gt;I took about 2 minutes and created a real version of the program with a two minute sleep.&lt;BR /&gt;&lt;BR /&gt;In the case of an open unlinked file lsof does indicate the file but rather than the filename it displays the filesystem device. e.g. /dev/vg00/lvol6. &lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Fri, 29 Jun 2001 19:44:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546933#M875209</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-29T19:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546934#M875210</link>
      <description>BTW, if you want to free the space while one or more procs still have the file open, just redirect nothing to it like so:&lt;BR /&gt;&amp;gt; /var/spool/bad_file&lt;BR /&gt;&lt;BR /&gt;Redirecting a cat of /dev/null does the same thing if you just like more typing:&lt;BR /&gt;cat /dev/null &amp;gt; /var/spool/bad_file&lt;BR /&gt;&lt;BR /&gt;Of course, the original file contents will be lost, but in what are you interested at crunch time -- the file contents or the disk space?</description>
      <pubDate>Fri, 29 Jun 2001 20:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546934#M875210</guid>
      <dc:creator>Jim Turner</dc:creator>
      <dc:date>2001-06-29T20:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing disk space</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546935#M875211</link>
      <description>/var (as you've probably seen is a very crucial filesystem for every user on the system (including root) and usually needs to be segmented to prevent mistakes in one subsystem from taking the entire filesystem down.&lt;BR /&gt;&lt;BR /&gt;For a print job, I take the approach that these are not as important as loss of email, loss of system logging, and other application crashes which will occur wehn /var fills...so I would either:&lt;BR /&gt;&lt;BR /&gt;lpcancel XXX&lt;BR /&gt;&lt;BR /&gt;(and that removes the print job)&lt;BR /&gt;&lt;BR /&gt;or cp the two files (in case someone wants to print it later) to some other filesystem like /tmp (note: 2 files, the data file AND the control file).&lt;BR /&gt;&lt;BR /&gt;But to keep /var under control, consider adding a 4 Gbyte disk (they are really cheap) and creating mountpoints for:&lt;BR /&gt;&lt;BR /&gt;/var/tmp&lt;BR /&gt;/var/spool&lt;BR /&gt;/var/mail&lt;BR /&gt;/var/adm&lt;BR /&gt;/var/adm/sw&lt;BR /&gt;&lt;BR /&gt;Then go into single user mode (need to have /var unmounted) and temporarily mount each of the new lvols so you can move the files and directories from /var to their appropriate locations on the new disk.&lt;BR /&gt;&lt;BR /&gt;Then umount the temp locations, edit fstab and verify that a mount command for each new mountpoint works OK.  Naturally, you would want to do a back before any of this.&lt;BR /&gt;&lt;BR /&gt;Now, if spooling fills, mail runs and logs are OK and applications run OK, etc.  Same thing for email filling /var/mail...</description>
      <pubDate>Fri, 29 Jun 2001 21:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freeing-disk-space/m-p/2546935#M875211</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-06-29T21:54:04Z</dc:date>
    </item>
  </channel>
</rss>

