Solved

Defragment an ext2 filesystem ?

Posted on 1997-04-28
8
438 Views
Last Modified: 2013-11-15
I am currently running linux 2.0.27 with an ext2 filesystem.
When I check the system it reports that my filesystem is
10% fragmented. I have tried to compile defrag-0.6 but I get invalid pointer errors. So the question is: How do I defragment an ext2 filesystem ?
0
Comment
Question by:wilt
  • 4
  • 3
8 Comments
 

Accepted Solution

by:
garret050297 earned 100 total points
ID: 1626212
OK, a couple of possibilities here.

If you're running Slakware, make sure you've installed the whole of the 'd' set.

More likely, you haven't got full kernel source on your machine. Once you have, or if you have already, you need to compile a kernel yourself, which will create all the include files for you.

If you have done all of this already, and are using a recent version of gcc, and it still doesn't work, then get back to me.

--
garret
0
 

Author Comment

by:wilt
ID: 1626213
I have installed the full source code and compiled my own kernal. The information I have recieved from news groups says that there are no utilities for this purpose. It is a shame that such a fine operating system lacks the proper tools to do clean up work.
0
 
LVL 2

Expert Comment

by:jprohart
ID: 1626214
the fast way is to use defrag. You can also backup your files and then restore them. I compiled defrag (with many tries) but you cannot use it on mounted filesystems.
0
 

Expert Comment

by:garret050297
ID: 1626215
defrag-0.6 isn't the latest version. Debian have a later version but it needs tweaking to run on non-debian systems. As soon as I get a running version of it I'll make it available.

(Don't blame me, I didn't change the file system specs...;)
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:wilt
ID: 1626216
Thank you for trying to help me garret. Since I asked the question I have upgraded my hard drive and in the process of installing slackware again. Your answer didn't solve the problem but you were very kind with your help. I hope you get the debian version working. Again THANK YOU!
0
 

Expert Comment

by:garret050297
ID: 1626217
No problem. There is now a version of defrag that compiles messily but does produce a working binary.

If you still need it it's at ftp://gulag.newhall.ml.org/pub/
and the file is called defrag-0_61-1.tar.gz
0
 

Expert Comment

by:garret050297
ID: 1626218
Sorry, one last thing. You'll need ncurses installed and you might need to change display.c to include curses.h instead of ncurses.h -- enjoy
0
 

Author Comment

by:wilt
ID: 1626219
Thanks for the information garret. I hope that this time the file system holds up a little better. The last check showed 2.2%. I will keep my fingers crossed. You have been very helpful. If you have any questions about PC hardware you can email me at cwilt@hotmail.com. I was a tech for several years. Thanks again!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
A list of useful business intelligence software.
Viewers will learn how to use the Hootsuite Dashboard.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now