How to defragment HDD?

Post Reply
yukko2011
Posts: 2
Joined: Wed Dec 28, 2011 8:52 pm

How to defragment HDD?

Post by yukko2011 » Wed Dec 28, 2011 9:01 pm

Hi,

I have a HMNHD, just replaced dead HDD with new 2TB drive and enabled telnet. Works fine. Thanks to NAS-Central!
Loaded with old data (data partition on dead drive was readable).

I've got 2 questions:
1. Is it recommended to defrag?
2. if YES then HOW?

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: How to defragment HDD?

Post by Mijzelf » Fri Dec 30, 2011 10:40 am

yukko2011 wrote:Loaded with old data (data partition on dead drive was readable).
Really? Then why do you call it dead?
yukko2011 wrote:Is it recommended to defrag?
That's an almost religious question. Generally it's not needed. XFS won't fragment a lot, unless the disk is almost full (less than 1% left), and you keep adding and removing files.
You don't have ways to defrag the partition, other than moving all data to another disk, and then moving it back to the (now empty) partition.
In your case the partition isn't fragmented at all. When you just added a bunch of files, all files are written sequentially. Fragmentation (on XFS) only happens when the size of the file is not yet know when it's created, and it becomes bigger than expected (by the filesystem). Or, when the partition is almost full, and there are simply no big consecutively blocks anymore.

yukko2011
Posts: 2
Joined: Wed Dec 28, 2011 8:52 pm

Re: How to defragment HDD?

Post by yukko2011 » Fri Dec 30, 2011 1:45 pm

Hi,
Mijzelf wrote:Really? Then why do you call it dead?
1. lots of very loud clicks (heads parking?)
2. lots of read errors on system partition
3. SMART failures. I'm not sure which parameter but my friend-expert told there are no more space for bad blocks remapping.

After backing up all data I tried to "repair" old drive (Barracuda 7200.11 1TB). I couldn't.
I did it from Xubuntu (live-CD on USB stick). System partition was mounting/unmounting due to read errors.
After repartitioning fdisk couldn't save changes.

Dead or not? I call it dead.
And also new drive was a gift from Santa :)))


I've got you idea on fragmentation. Thank you!
But just curious does is make sense to install xfsdump package? It has xfs_fsr which is for defragging also.

Post Reply