1

Topic: Defragged NTFS partition, still can't resize

I'm playing with an old Compaq tablet PC.  After pruning files and programs, about 12Gb of the 27Gb partition is full.  Until I get the electromechanical pen and screen orientation working in Linux, I don't want to blow away the Windows installation entirely.  I couldn't resize the existing partition with GParted (in Parted Magic), so I defragged the NTFS volume from Windows, first with JKDefrag, then Auslogics Defrag (both pretty good as far as Windows utilities go, but it looked like JKDefrag was piling all the bits at the back side of the partition.  GParted still says I can only reduce the existing partition by 7 meg.  Can anyone suggest the next step.  This computer is from a customer, and I haven't found the installation media yet.

2

Re: Defragged NTFS partition, still can't resize

I don't understand very well "piling all the bits at the back side of the partition". Do you mean that the free space is now at the beginning side of the partition? This seems quite strange to me. However, JKDefrag uses a specific defrag "strategy", placing the disk content in separate zones in the hard drive: (1) directories and system files, (2) regular files, (3) large files, archives, recycle bin contents, service pack files, and other infrequently accessed data files. Perhaps you have many files in the 3rd category.
Anyway, this schema looks very different from the usual windows defragmentation operation. So, you could try to use the standard windows defrag, and eventually use JKDefrag or other special software after resizing. Please, note that JKDefrag isn't supported anymore, as I found.

ntfsresize, the software tool that GParted uses to perform resizing operations on ntfs partitions, normally doesn't need to have the file system defragmented before running. Nevertheless, it seems that a heavily fragmented or complicated file system tends to cause more problems in the resizing operations. Try to deactivate (or uninstall) any potential software that could place a non-movable file at the end of the partition. This was the case for disk compression software, perhaps any antivirus, real time checkers, ...

Before proceeding to modifications, it is recommended to backup the entire partition (or the entire disk drive) content, with an image backup software or the linux/unix dd command. This manner you could restore the disk content in case of failure.

You wrote that you tried Parted magic. You can try to use the GParted liveCD too.

(Topic moved to the Live Media section)

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3

Re: Defragged NTFS partition, still can't resize

From the graphical representation of what JKDefrag was doing, it looks like 20% of the filled sectors were relocated to the first part of the partition, the rest at the end, with a lot of black space in the middle.  I also was of the mind that if fragmentation was an obstacle, no-one would ever get a Linux distro installed on a drive shared with a Windows partition.  I tried running a Lucid install, with the intent of ending the install after the NTFS partition was resized, but the only option I had was to wipe the drive and create new Linux partitions, no option to resize the existing partition.  If I want to retain the current install (I don't currently have the Windows installation media, but I should be able to locate it where I got the computer unless it's been discarded) then I think I'll have to do a byte for byte (vs. by sector) backup to other media, repartition the drive, and copy it back.

4

Re: Defragged NTFS partition, still can't resize

Class413 has listed some useful tips on how to improve the ability to resize an NTFS partition, especially the point about any non-movable files.

The FAQ point #11 contains more information on improving the ability to resize an NTFS partition.  The link to the post by forum member cmdr is particularly useful.

5

Re: Defragged NTFS partition, still can't resize

Thanks class413 and gedack.  It was probably the tip about running chkdsk /f /r (though it found no errors) or disabling Windows paging in the FAQ.  I then use JKDefrag from Safe Mode and then resized from the Parted Magic Live CD. I just booted into my new, smaller Windows partition, so I am ready to install Linux.  I also found and implemented that warning to delete HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices before altering the partition.