Is there any way to defrag a bootable XP hdd so all the free space is at the end of the drive?

6

I have an old PC booting Windows XP from a 40Gb drive. It also has a 320Gb hdd and a CD r/w. The 40Gb drive is getting quite noisy, and I'd like to swap it for a quieter 12Gb drive I have lying around.

I only use the machine to play video through my TV. Apart from occasional updates to XP and VLC (the video player I use) I don't write to the boot drive, which currently has about 8Gb in use. I periodically use Paragon Backup & Recovery (free) to put the latest 'snapshot' of the boot drive onto the 320Gb 'data' drive.

I always do a defrag before backing up, using Smart Defrag. But both this and XP's built-in defragger leave gaps between files. So I can't just swap drives and restore to the 12Gb unit, because the backup image actually wants to spread itself across nearly 15Gb (to mirror how the files exist on the original).

Is there any (preferably free) way to defrag the 40Gb boot drive so all the files are contiguous, within the first 8Gb of space?

UPDATE - I'm beginning to think I must need something that can create its own 'Boot CD'. Everything that's been suggested so far seems to use at least the filing system components of XP from the disk I'm trying to defrag - so they can't move those files, because they're 'in use'.

UPDATE2 - I seem to have answered my own question. Paragon Total Defrag has just done what I want. It's a 30-day trial, but I only need it once, so that's me sorted. Note that I'm not concerned about optimising disk performance at all - I just want to get all files contiguous, with no gaps between them.

FumbleFingers

Posted 2011-05-15T15:39:22.983

Reputation: 357

Answers

3

Not sure of the etiquette here. None of the suggestions worked, so I don't want to accept any of them. But I found Paragon Total Defrag (30-day trial), and it seems to have done the trick after allowing me to create a Boot CD and defrag from that.

I haven't actually restored to 12Gb drive yet, but SmartDefrag's 'disk map' suggests the awkward files at the end of the old 40Gb drive are gone.

Be warned! It took Paragon over 2 hours to defrag a drive which was already fully optimised apart from those few awkward files. So I wouldn't try it on a 1Tb+ drive unless you've got a free weekend!

FumbleFingers

Posted 2011-05-15T15:39:22.983

Reputation: 357

3

Give this one a shot, it worked for me. : Auslogics Disk Defrag

Simon Sheehan

Posted 2011-05-15T15:39:22.983

Reputation: 8 641

Thasnks, but Auslogic's offereing didn't work for me. Which is what I expected, when I saw it runs under Windows. It certainly can't move OS files that are currently in use. I also suspect it doesn't even try to move files that aren't actually in use, if they have System and/or Hidden and/or Read-only attributes set. – FumbleFingers – 2011-05-15T17:10:31.630

3

There are programs that can move the free space to the end of the drive during the defrag process.

Does it for sure but its a paid app: Diskeeper: http://www.diskeeper.com/

Think these do it as well, worth checking on as they are free: http://www.piriform.com/defraggler and http://www.iobit.com/iobitsmartdefrag.html

Amartel

Posted 2011-05-15T15:39:22.983

Reputation: 675

@Amartel: defraggler is the same as Auslogic's - they're Windows progs that can't touch files in use. I think maybe I need a cd to boot into Linux or something, the way Paragon's Backup/Restore CD works. – FumbleFingers – 2011-05-15T18:21:55.280

Diskeeper is the only one that I am sure does what you need. It has an option to defrag offline before a full boot therefore can move every file. There is a free trial available, check it out – Amartel – 2011-05-16T01:14:25.963

+1 for Diskeeper. The 2011 version is excellent. You can check out their free trial – None – 2011-05-16T15:08:21.457

@Amartel: I just tried Diskeeper (Pro) trial version, but it works the same as Smart Defrag. The 'boot defrag' feature (which runs before XP is 'fully' loaded) still can't move those 'system files' that are way down near the end of the drive. I didn't like Diskeeper much anyway - it forced me to supply an email addr and personal details before even to d/l the free 30-day trial. At least Smart Defrag doesn't mess about like that, and it's not time-limited either. – FumbleFingers – 2011-05-16T15:31:44.557

Defraggler is sufficient in most cases. But the biggest thing is MTF Fragmentation, I believe Diskeeper can fix that in preboot mode. MTF fragmentation is the largest performance hit in regards to fragmentation. – Jeff F. – 2011-05-17T17:01:44.073

@Jeff: You don't need to fix MFT (not MTF :P) fragmentation before boot. You can defragment the master file table just by opening a normal handle to it with FILE_READ_ATTRIBUTES permission, and defragmenting it like anything else. – user541686 – 2011-05-17T18:04:36.460

@Mehrdad: That would be using the built-in OS command to defrag a named file, right? So how come several major outfits produce apps like Diskeeper, Auslogic, & SmartDefrag with [pre-]boot support for dealing with MFT and such? Perhaps that OS call just returns 'success' (or 'no failure') without actually doing anything if the file is 'in use'. – FumbleFingers – 2011-05-18T02:18:32.093

@FumbleFingers: Yeah, it's completely online. No, it definitely works, there's no doubt about it; I've written a program and tested it myself. Even Microsoft's Contig recently gained the ability to call this function. The only restrictions are that you can't move a few files like $MftMirr, $LogFile, $Boot, etc.; however, files like $Mft, $Secure, $Extend, etc. are definitely defraggable. (It doesn't matter that they're "in use" -- you're not writing reading or writing any data; the file system takes care of the move.)

– user541686 – 2011-05-18T02:20:19.887

@Mehrdad: Anyway, fact remains so far only the Paragon Total Defrag method has done what I wanted. And the boot disk that enables them to do that, like their BackUp/Restore, seems to be a minimal Linux. Which I guess is what makes it possible to move all files, at the expense of being a lot slower. – FumbleFingers – 2011-05-18T02:25:25.677

@FumbleFingers: Sorry, I think I forgot to mention a caveat: the first 16 records of the MFT cannot be moved. So if you need those to be moved, you need to do it offline, hence one reason why you probably needed Paragon. – user541686 – 2011-05-18T02:26:44.970

Ah. There was definitely a 'logfile' of some kind in the area that was bugging me. – FumbleFingers – 2011-05-18T02:26:48.610

@FumbleFingers: Yup, that too -- the few very special files can't be moved unfortunately. :( – user541686 – 2011-05-18T02:27:34.643

I didn't know the terminology. Obviously I needed an 'offline' defragger, and there aren't so many of them for NTFS. – FumbleFingers – 2011-05-18T02:28:13.663

0

There is reviews for free software here:
http://www.techsupportalert.com/best-free-disk-de-fragmenter.htm?page=6

I tested MyDefrag and it does just that.

Randall Flagg

Posted 2011-05-15T15:39:22.983

Reputation: 301