Go Back   AnandTech Forums > Hardware and Technology > General Hardware

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· AMD Video Cards
· Nvidia
· Displays
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Home and Garden
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals with Free Stuff/Contests
· Black Friday 2014
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 11-10-2012, 02:51 AM   #1
lambchops511
Senior Member
 
Join Date: Apr 2005
Posts: 659
Default Defrag Single File Linux ext3

Sorry if wrong section.

I have a relatively (50G) large file on ext3, I need good linear access / bandwidth times on it. Is there a way to "defrag", the way it was copied over to the server I am pretty sure was fragmented pretty badly. I don't need perfect defrag, but is there a good way to make the file "less fragmented"?

Would a something simple like

cp my_file /tmp/garbage
rm my_file
mv /tmp/garbage my_file

do the magic?
lambchops511 is offline   Reply With Quote
Old 11-10-2012, 12:15 PM   #2
Cerb
Elite Member
 
Cerb's Avatar
 
Join Date: Aug 2000
Posts: 17,044
Default

Tried defrag?

There's also shake, which is probably better.

Also, yeah, this should probably go under *nix Software.
__________________
Quote:
Originally Posted by Crono View Post
I'm 90% certain the hipster movement was started by aliens from another galaxy who have an exaggerated interpretation of earth culture(s).
Cerb is offline   Reply With Quote
Old 11-10-2012, 02:22 PM   #3
AnonymouseUser
Diamond Member
 
AnonymouseUser's Avatar
 
Join Date: May 2003
Location: Dallas TX
Posts: 8,494
Default

To see how fragmented a file is, use

Code:
filefrag -v filename
__________________
I often hear from readers that they would prefer a straight, neutral treatment — just the facts. But The [New York] Times has moved away from that, reflecting editors’ reasonable belief that the basics can be found in many news outlets, every minute of the day. They want to provide “value-added” coverage.

Margaret Sullivan, NYT Public Editor
AnonymouseUser is offline   Reply With Quote
Old 11-10-2012, 04:47 PM   #4
mfenn
Elite Member
Super Moderator
General Hardware
 
mfenn's Avatar
 
Join Date: Jan 2010
Posts: 22,383
Default

Quote:
Originally Posted by AnonymouseUser View Post
To see how fragmented a file is, use

Code:
filefrag -v filename
Let's not get crazy unless there is actually a problem. I wouldn't be worried unless the file had thousands of extents.
mfenn is offline   Reply With Quote
Old 11-10-2012, 06:22 PM   #5
lambchops511
Senior Member
 
Join Date: Apr 2005
Posts: 659
Default

Quote:
Originally Posted by AnonymouseUser View Post
To see how fragmented a file is, use

Code:
filefrag -v filename
WOW! THANKS! I did not know this command. Is 86 extents good / bad for a 30 G file? I am guessing its pretty good? That probably means if I want better IO perf I need to hit SSDs?
lambchops511 is offline   Reply With Quote
Old 11-10-2012, 06:41 PM   #6
Cerb
Elite Member
 
Cerb's Avatar
 
Join Date: Aug 2000
Posts: 17,044
Default

Quote:
Originally Posted by lambchops511 View Post
WOW! THANKS! I did not know this command. Is 86 extents good / bad for a 30 G file? I am guessing its pretty good? That probably means if I want better IO perf I need to hit SSDs?
Yes. Generally, anything above around 50MB/fragment is, "good enough," and that's over 300MB/fragment. Even with some tiny fragments mixed in there, that's good enough to just not worry about it. Any newish HDD (500GB/platter or denser) aught to be able to read such a file at 100MB/s, no sweat.
__________________
Quote:
Originally Posted by Crono View Post
I'm 90% certain the hipster movement was started by aliens from another galaxy who have an exaggerated interpretation of earth culture(s).
Cerb is offline   Reply With Quote
Old 11-11-2012, 08:20 PM   #7
mfenn
Elite Member
Super Moderator
General Hardware
 
mfenn's Avatar
 
Join Date: Jan 2010
Posts: 22,383
Default

Quote:
Originally Posted by Cerb View Post
Yes. Generally, anything above around 50MB/fragment is, "good enough," and that's over 300MB/fragment. Even with some tiny fragments mixed in there, that's good enough to just not worry about it. Any newish HDD (500GB/platter or denser) aught to be able to read such a file at 100MB/s, no sweat.
Agree.

OP, the -v output from filefrag lists all the file's extents along with their length (5th column). Double-check to make sure that there aren't a bunch of really tiny extents, but you are most likely OK.
mfenn is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:54 AM.


Powered by vBulletin® Version 3.8.8 Alpha 1
Copyright ©2000 - 2015, vBulletin Solutions, Inc.