On 31-Jul-07 16:33:02, Barrys linux mail wrote:
Hi, Do you have to defragment and clean up a hard drive in Ubuntu Linux like you do with Windoze? As i can't find anything that looks like it at present.
Barry
Just to clarify a bit on other replies.
As Samwise said, fsck will be automatically run around every 30th reboot. You can also force it to run if you shutdown with the command
shutdown -F -h now
which brings the system to a halt. The "-F" causes 'shutdown' to plant adummy filename which is picked up next time the system boots, and triggers the fsck.
Or you can do
shutdown -F -r now
which forces an immediate reboot. (For normal use, omit the "-F"). [why do I always hit the wrong keywhen I type that command?]
Again as Samwise said, fsck will check for any file-system errors, and correct them. Normally there are none.
As far as I know, fsck (in whatever version is appropriate for your type of file-system) does nothing about "fragmentation". It will, however, report what amounts to the degree of fragmentation which exists in the partition it is checking, as "% non-contiguous".
On Linux systems, this number is usually very small, and stays small, because of efficient file-system design. Even under heavy usage over years, it is unlikely to rise above 2-3%.
For example, on a 4GB "/" partition which is almost full (18MB free) which I have been using heavily and continuously for about 4 years, I get the result:
155184/469568 files (1.3% non-contiguous), 885935/937432 blocks
while on another 20GB "/" partition which is nearly full (350MB free), again heavily and continuously used for about 6years, I get
214794/2420096 files (1.8% non-contiguous), 4501788/4831548 blocks
all of which is extremely healthy!
So much is fragmentation a non-issue with Linux that only recently has there been a "defrag" project:
http://defragfs.sourceforge.net/
My Red Hat 9 system (first example above), from aound 2003, has 'defragfs' installed (not that I've ever used it). My other, older systems (one is the second example above) do not have 'defragfs' at all, and I've never even thought of wanting to defrag!
Best wishes to all, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 31-Jul-07 Time: 19:03:59 ------------------------------ XFMail ------------------------------