|
|
 |
11-10-2012, 01:51 AM
|
#1
|
|
Senior Member
Join Date: Apr 2005
Posts: 659
|
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?
|
|
|
11-10-2012, 11:15 AM
|
#2
|
|
Lifer
Join Date: Aug 2000
Posts: 12,264
|
Tried defrag?
There's also shake, which is probably better.
Also, yeah, this should probably go under *nix Software.
__________________
"The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows." - Frank Zappa
|
|
|
11-10-2012, 01:22 PM
|
#3
|
|
Diamond Member
Join Date: May 2003
Location: Dallas TX
Posts: 7,891
|
To see how fragmented a file is, use
Code:
filefrag -v filename
__________________
“If you don’t stand for something, you’ll fall for anything.”
“There's class warfare, all right, but it's my class, the rich class, that's making war, and we're winning.” - Warren Buffett
|
|
|
11-10-2012, 03:47 PM
|
#4
|
|
Elite Member
Join Date: Jan 2010
Posts: 16,767
|
Quote:
Originally Posted by AnonymouseUser
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.
|
|
|
11-10-2012, 05:22 PM
|
#5
|
|
Senior Member
Join Date: Apr 2005
Posts: 659
|
Quote:
Originally Posted by AnonymouseUser
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?
|
|
|
11-10-2012, 05:41 PM
|
#6
|
|
Lifer
Join Date: Aug 2000
Posts: 12,264
|
Quote:
Originally Posted by lambchops511
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.
__________________
"The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows." - Frank Zappa
|
|
|
11-11-2012, 07:20 PM
|
#7
|
|
Elite Member
Join Date: Jan 2010
Posts: 16,767
|
Quote:
Originally Posted by Cerb
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.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:46 PM.
|