Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you defragment Unix filesystem? 5

Status
Not open for further replies.

ag6969

Technical User
Jun 4, 2001
85
0
0
CA
I have heard a yes and a no to this answer for Linux. So if anybody knows for sure- can you defrag a Unix filesystem??
 
you can yes - but it involves taking a copy of the filesystem, detroying the original and then rebuilding it from the backup

not a job for the fainthearted, *I've* never done it for instance

what makes you think you might need to? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Actually, I am running FreeBSD 4.2.
I just noticed that everytime the system boots, it shows the defragmentation percentage (right now it is only at about 2 %), so nothing to worry about now, but maybe in a year's time it could be an issue. Since I use it for NFS and FTP, and in about 2 days- SAMBA, with a lot of copying to the drives and deleting from the drives this could create some defragmentation. I guess there is only one way to find out- wait and see! I don't reboot very much, but since I'm still in the process of configuring services, I have to reboot every once in a while.
Thanks for the responses. (I don't know how to reinitialize networking services when changes are made without rebooting, but eventually I'll figure that out!)
 
Fragmentation is not the same type of problem on Unixes as it is on a Windows NT system. I don't know all the details, but from what I understand, Unix filesystmes have a much more efficient way of indexing and accessing files than Windows NT.

I guess it's possible in an extreme situation, but I have never heard of a case where a FreeBSD system had seriously degraded performance due to fragmentation.

If you really think you need it, obviously the quick answer is to copy everything to another drive or backup, wipe the disk partition, and just copy everything back.
 
I don't know about restarting BSD, cause I use Redhat, but on Redhat you can restart network services by doing this:

/etc/rc.d/init.d/network restart

Is it the same for BSD? d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
Thanks for the info. Now that I think about it, the only file systems (or partitions?) that I should have to worry about are those that change frequently, so as long as I keep data that changes on it's own slice, I can "easily" move the data to a new fs without moving everything. Thanks again, and by the way d3funct- I'll try that suggestion.
 
I am not very familiar with FreeBSD, but I believe that it uses UFS file systems. If that is the case, UFS defragments as it goes, or "on the fly". This is one of the reasons why it is almost impossible to revover a deleted file in a UNIX environment. As soon as a block is freed, it is overwritten.

If FreeBSD utilizes the fsck utility upon boot, each file system listed in the /etc/fstab which is "checked" may be defragmented each time the system boots. UNIX rules!!!

HTH,
Jason
 
I don't know much of anything about FreeBSD (I run Solaris and Linux), but I've noticed as stated above that Unix is in general VERY different from Windows in regards to files and defragmentation. I've been around various systems (runnning databases, ftp, proxy, NFS, etc.) and have never seen a Unix system in need of a defrag (frag never got higher than 2%).

My former location had a Unix system running an OLTP database for more than 5 years and the filesystem never got above 2% frag. I've heard stories of Unix systems running 15 years all sorts of intense disk I/O apps never moving over the same 2%.

I don't you'll have any issues with frag on your Unix box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top