1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Moving unmoveable files

Discussion in 'Windows XP' started by cowplopmorris, May 27, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    Hi I'm trying to partition my hard disk which currently has a Windows partition on and a couple of other util. partitions. I am using an Ubuntu live CD with GParted to attempt to resize the Windows one, but an error was given concerning there not being enough free space. I had a look around and found out that defragmenting might help.

    I did it a couple of times with the Windows defragger and once with Vopt. However, there are some "unmovable" files near the end of the disk which are probably causing the problems.

    Is there any way I can move these, so I can resize the partition?

    Attached is a screenshot from Vopt after defragging, the green blocks show unmovable files.

    Thanks in advance.
     

    Attached Files:

    • Vopt.png
      Vopt.png
      File size:
      88.3 KB
      Views:
      1,558
  2. oshwyn5

    oshwyn5

    Joined:
    May 23, 2007
    Messages:
    730
    First off lets get a general understanding of defrag what it does and how.
    This is a simplified overview and not precisely technically correct; but aimed at allowing you to visualize and understand what is going on.

    This to some extent depends on your file system format.
    If you are formatted FAT32 you have an address based file system. There is a table of contents (The File Allocation Table) listing all available addresses and which file or fragment is saved at that location.
    If you are formatted NTFS , it is a File based file system; there is a Master File Table, a list of all files on the drive and which address or addresses each file occupies. In addition in NTFS, each file fragment contains a copy if the files MFT entry so that if it crashes the file can be placed back where it came from on reboot (no need for scandisk and lost file fragments). Very small files are often actually saved directly to the MFT . The MFT has a shadow or duplicate saved just in case the original gets damaged.


    When you save a file in FAT, it is saved to the first empty address; and if it takes up more than one they may not be contiguous(Touching , next to each other,, sequential); they could be at opposite ends of the drive, IE the file itself could be fragmented from the time it was saved.

    When you save a file in NTFS, it looks for the first contiguous space large enough to hold the entire file. But this means that there may be empty spaces on the drive which are more quickly accessible than where the file was saved. Thus while the file itself is not fragmented, the drive may become fragmented when you save a file.


    So, defragmentation is the act of moving files around so that neither the files nor the drive is fragmented. Putting all the fragments of a given file in contiguous addresses and organizing the files in such a manner that there is as little wasted space between files on the fastest parts of the drive.

    Now we run into the first problem most people encounter. In FAT if a file is accessed, or saved while defragmentation is in progress, the whole process has to start over since it would be saved to the first empty space which is where defrag wants to move something.
    But NTFS can just save it to the end and let defrag shuffle things around later.
    This is why generally we were advised to run disk defrag in safe mode in older operating systems using FAT format. But in XP with NTFS , you can generally defrag while windows and applications are running. But this does cause a few problems. Some areas are "off limits" things like your antivirus do not allow other things to write to spaces they reserve or alter their files, even temp ones. System restore likewise is basically inaccessible, the swap / paging file , hibernation file etc. There are many files which cannot be moved.

    We also run into the problem of how do you sort the files ? Each defrag utility uses a different algorithm or method of calculting what goes where. Do you sort by name alphabetically? By file type , OS first, Programs second, Data third? By frequency of use?
    A combination of the above? How do things get sorted. And does the defrag utility run only when you launch it or do you allow it to run in the background on an NTFS system and "optimize the drive" doing mini defrags to put files which were saved in an incorrect area into a better position when it senses the hard drive is not being accessed?



    So, it is normal to have some files show up as "unmoveable " when you run a defrag from within the windows environment.
    There are workarounds; some defrag utilities have the ability to run on the next boot, before windows loads from a "command prompt" type environment. Some of these things (hibernation file for example, and system restore) can be disabled for the purpose of defragmenting.

    There is a utility called Speedefrag
    http://www.snapfiles.com/get/speedefrag.html
    which allows you to schedule the windows defrag utility to run on the next boot.
    http://technet.microsoft.com/en-us/sysinternals/bb897426.aspx
    Page defrag allows you to defrag your page file if you really think that is important.


    ========================================================

    But as to your question about what happens with these "unmoveable" files if you try to resize the partition. Well you would be doing this using a partitioning program such as partition magic. It will create a temporary "virtual drive" in a folder and on rebooting load this into RAM and it contains a simplified operating system which will run the application and do all the dirty work. Thus you will not be booted to the drive / partition or operating system you are resizing and all the files on it are moveable
     
  3. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    You'll need to move those offline. Either a defragger with boot-time defragging available (Diskeeper, O&O, Raxco, etc.) or a defragger that runs outside of Windows (UBCD4Win, Paragon Total Defrag 2008) will be needed. PageDefrag may help with some files (only XP).

    Free defraggers:
    IObit Smart Defrag (Schedule and boot defrag.)
    Defraggler
    Auslogics Disk Defrag
    DefragNT
    WinContig
    Ultra Defragmenter
    Defrag GUI (GUI for native defrag.exe.)
    DIRMS 1.2.20 Defragger (command-line)
    JKDefragGUI
    Disk Idle Optimizer
    Power Defragmenter
    Diskeeper Lite
    O&O Defrag 2000 Freeware
    DefragMentor Lite (Boot-time and command-line.)

    (PageDefrag is good to use with all the above in XP. It does a boot-time defrag of all the major locked files.)
     
  4. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    Thanks for both for your detailed replies. Oshwyn5 got there first, so I tried SpeeDefrag. It was just what I needed. I gave it two runs, since I was surprised at how quickly it went. When I looked in the Windows defrag's analyze option, it had done a much better job, even though there were still some "unmovable" files left at the end of the drive.

    However, when I tried to partition it did exactly what I wanted. Thanks again!
     
  5. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    Another quick question, though. When I set it going and it rebooted, it wanted to do a file system check, which was fine, except it got to about 2% on stage 2 of 5, and scrolled loads of lines saying "Deleting an index entry from index $0 of file 13576". I've seen this before when running fsck on my PC, and it never ends; the only solutions is to hard power off and boot in to "Last known good". Any idea what this is/why this happens?
     
  6. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    That's not a good sign. Generally, I've seen this when the partition tables were invalid and chkdsk ends up ruining all the files it attempts to "fix" because it miscalculates where the file boundaries are.

    Was it running on your system drive? Does it still boot?
     
  7. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    I found another post on this forum where you rename chkdsk.exe to xchkdsk.exe from the recovery console, so chkdsk can't start. I did this, and Windows boots fine.

    At some point today, I will try chkdsk /r from the recovery console and let you know how I got on.

    Edit: and yes it was on my system drive.
     
  8. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    Any ideas how I can sort this without the renaming chkdsk hack?
     
  9. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    If chkdsk can't fix the disk errors, you will need to remove the partitions from the drive, repartition, reformat, and reinstall your operating system (provided that the drive has no physical problems and needs repalcing). There are many disk errors that cannot be repaired.
     
  10. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105

    Ouch:(
     
  11. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    Yes, I know. But even programs that make backups of your drive will detect the error and fail to launch. There is one program, however, that is designed specifically for making images of bad drives so you can try to recover data from it later:

    copyr.dma (Copies disk with bad sectors for recovery)

    I haven't used it, but it has been around for a long time, so someone must be using it. :D

    Errors of that type are rare and generally mean something is wrong with the drive.

    Free Hard Drive Testing Applications:

    Manufacturer's Tests
    Victoria for DOS
    Victoria for Windows (Both versions of Victoria are among the best and most thorough tests available.)
    HD Tune
    CheckDisk 1.03 (Marks bad sectors as unusable.)
    HDAT2 (Diagnostics and bad sector recovery)
    MHDD Low-level Diagnostics
    Bootable Hitachi Drive Fitness Test Floppy or CD Image (works on most drives)

    Hard Drive Manufacturers' Diagnostic Utilities Links:

    TachTech
    BleepingComputer
     
  12. cowplopmorris

    cowplopmorris Thread Starter

    Joined:
    Jun 7, 2006
    Messages:
    105
    Well, I can still boot with the renaming hack, and I can access all the files I need, so I shan't bother just yet.
     
  13. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/715815