Disk Utilities
Tim Seufert
yellowdog-general@lists.terrasoftsolutions.com
Sat Oct 12 17:16:01 2002
On Saturday, October 12, 2002, at 03:40 PM, puli brothers wrote:
> My question is predjudiced by my experience with Windows (NT and XP)=20=
> more than my experience with either Apple's OS or Linux, but in order=20=
> to keep Windows running well about one a week I would run the chkdsk=20=
> and the defrag program.
> =A0
> It appears to me that if their was a disorderly shutdown, then on the=20=
> next boot, Linux repairs the file system -- I assume this is a=20
> function that is similar to the chkdsk.
Yep. In Linux the command's name is fsck.
> =A0Is there a way for the admin user to force a disk check, either=20
> immediately on on the next reboot?
You cannot (well, should not) run fsck on a file system that is mounted=20=
read/write. The most convenient way to run it on the root FS is to=20
boot into single user mode, which leaves you at a shell prompt with the=20=
root FS mounted readonly.
However, my advice would be to not bother with this. Most Linux=20
distributions ship configured to force running fsck on a file system=20
after it has been mounted too many times without a check. I think=20
YDL's count is something like 20 or 30. This probably won't do a check=20=
as often as you're accustomed to, but Linux is not Windows: I've never=20=
observed fsck find an error after a clean shutdown/restart.
> Also, I do create and destroy a large number of files on an on-going=20=
> basis. On the NTFS system this can lead to a lot of fragmented files,=20=
> and over time performance can be impacted. Does Linux suffer from=20
> similiar defragmentation overtime?=A0 Is there any need to defrag the=20=
> Linux file system? Are there defrag utilities available?
There are, but I'm not sure how current / trusted they are. Most of=20
the time, the Linux ext2/ext3 file system should not get too=20
fragmented; the allocation algorithms are designed to avoid it. That=20
doesn't mean you can't cause fragmentation; the right creation/deletion=20=
patterns can do that no matter what.
One thing you could do is to place the files on a separate partition. =20=
Then you can periodically reinitialize that partition if you feel it is=20=
suffering from fragmentation. Linux is a lot more flexible than=20
Windows about dealing with partitions so this may not have as much of=20
an impact on your workflow as you might think.=