How to defragment in linux (Ubuntu)
I wanna know how to defragment my disk partitions in linux (including NTFS) is there a tool for that.
|
Quote:
try searching in sourceforge.net OR google ;) |
Don't need it. Because of the way Linux file systems are set up, they don't get fragmented until a drive is almost full. If you just google "why you don't need to defragment linux" you will get 216,000 hits like this one:
http://geekblog.oneandoneis2.org/ind..._defragmenting |
Quote:
Quote:
Being that said, you usually don't defragment linux. You could always back a partition up, then format it and restore the backup, which is like a poor man's defrag. That's not too appealing, I know. There're some tools around, you can google for them, like in "defrag ext3", "defrag ntfs linux" or whatever fs you need to defrag. There's also "shake": http://vleu.net/shake/ Never tried it, don't blame me if it fries all your data and spills ketchup over it. You could also use ext4 as your filesystem, a defragmenter for ext4 is on the way, and it will also be getting an online defragmenter as well so you don't have to worry about that any more. |
The thought of having to defrag a 1TB drive leaves me cold.
|
Quote:
Thanks |
Defragmentation is not a "routine procedure" anymore ... not even for Windows boxes. For one thing, drives are huge, so a contiguous block of space is always easy to come by. Filesystems have improved too. Current Linux (and Windows) filesystems are designed for years of continuous service.
|
I like sun's answer. whats the point of spending a couple of hours trying to wring a few hundred megs out of a drive (or even a few gigs) when it would honestly be quicker to go to your local electronics retailer, buy a new drive and install. Presto! a significant % reduction in fragmentation.
|
Amen.....
In an era of contracting resources and all manner of issues, it's nice to have "brute force" solutions that are also "green". An extra hard drive for under $100 can solve all manner of problems---eg it is hands-down the most painless way to set up dual-boot. |
Quote:
Mons EDIT: Guess the situation might be different in Sri Lanka, but in any case, you won't gain anything much by defragging in Linux. |
heck, even if you're running a windows environment, theres a better idea, safer idea, and prolly still, quicker idea to defragging. Back up your data, reformat, and re-install. Gets rid of any nasty bits that might be floating around, and will take just as long as that defrag, and accomplish the same thing (and more by getting rid of whatever junk u didnt back up.)
|
i92guboj
Interesting. Learn something every day. I've seen explanations like the one in the link I posted frequently in the past. Good to learn how it really works. |
Actually,
I have a modern laptop (but due to its small size, the hard drive is only 80GB). I no longer have Windows (I quit using it, a long time ago), however the NTFS partition is still there. GParted is not allowing me to resize it, even though it is only half-full, which apparently is due to fragmentation. The partition used to be full. It is now mid-2011. A tool would still be useful. I have to copy everything off (I'm using a thumb drive... I consider this a week-long project), then delete it and resize my Ext4 partition. I am trying to make a point: do your best to try not to disprove somebody's needs, because somebody else might come along with the same issue. It happens to me again and again in all of the Linux forums. NTFS is supported in Linux and the use of NTFS partitions implies there is a possibility of fragmentation, so developing a defragmentation tool for use in Linux would be a legitimate idea and also not a bad one. It doesn't matter how "modern" technology is, I'm still using my Tandy 1000, which asks me to set the time and date and insert a floppy disk every time I turn it on. |
You have to resize the container first.
post output of Quote:
|
#13, @patrick_the_fat : Welcome to LQ.
Looks like you no more can start Windows©. And thus can't disable the pager file, which is the usual stop for a resize. ( Can be located at say 75 %.) And fragmentation, may be. But if you aren't using it, why not back up all data, and then reformat the whole NTFS partition to a Linux file system + click apply in Gparted. Now it should then be possible to do a resize. And : Please do not use any old threads for questions, etc. Better instead start a new thread. |
Quote:
By the way, because of the closed specifications for NTFS it literally took years til open source developers could come up with a working write support for it. I doubt that someone ever will put effort in writing defragmentation support for this file-system . |
Quote:
|
I would hate to defrag 3tb drives, and have to do it to 3 3tb drives 0_0
|
No matter the size, even linux drives could use a defrag if used in production. Tar off to tape and copy back was the standard way. It is perfect and has worked for decades.
|
Modern file systems don't get very fragmented. My Windows machine has never gotten more than a couple percent fragmented, even with heavy use. Windows 7 is largely self-maintaining. Linux ext systems don't really get fragmented in normal use, at least I've never seen it. It's not something I would lose any sleep over.
|
What the OP *nEEds*
This is a reply to an old thread because the OP has old equipment and old operating system which these new-fangled Whipper-snappers obviously aren't able to comprehend... and therefore just keep talking about what they need and not what the OP needs and simply don't have the ability to sympathize with the OP. :rolleyes:
I assume you don't have the 30 terabyte HD that they are talking about and/or for some reason that nobody needs to know, you want to preserve your present OS or file system environment... Why you need what you are asking for isn't the issue... and isn't my business... I worked for a company in 2009 that was running some equipment off of a DOS 6.1 environment with windows 98. This was running software that was closed source and that software designed closed source machine code to drive a $38,000 CNC machine that the shop wasn't ready to replace so .. we had to keep that old DOS system running. (I'm sure more examples could be sited) Why you need this is nobody's nosy business and I have to agree with Patrick... Not one person has answered your question here... AAAARRRRRRG!!!! :banghead::mad::cry: (they probably don't know the answer) You could try shake. Honestly, though you might not want to do what you are trying to do. If you have a Windows partition then you probably have a working windows system, you want to let windows do the defrag for you. If you have an NTFS with data on it and it's not a windows system .. then why? This is the part I don't understand, not that there aren't valid reasons, of course. Is it so that a windows system can access it? Then use windows to defrag it. Otherwise you might want to think about updating to an ext3 or ext4 file system. (or better an array of 3TB drives with ZFS :cool: ) Whatever it is you are up to I wish you success! ...... |
All times are GMT -5. The time now is 10:15 AM. |