Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I foolishly used Dupemerge to change all my duplicate files into hard links. Now Windows XP is not running right, eg, explorer won't start.

Is there a utility which would traverse the filesystem looking for hard links, copy the file, delete the original link, and rename the copy, keeping the original attributes and name?

share|improve this question
1  
I don't know how to find them, but I assume you'd only need to undo them for hard links in the Windows folders? No errors in the Event Log, to indicate why Explorer won't start? –  Arjan Nov 1 '09 at 9:10
    
Oops, maybe you cannot truly undo it, especially if for some reason the file date is important: Dupemerge creates a cryptological hashsum for each file found below the given pathes and compares those hashes to each other find the dupes. There is no file date comparison involved in detecting dupes, which might cause troubles. -- schinagl.priv.at/nt/dupemerge/dupemerge.html (Chances to find the same hash for different files are very low, but not exactly zero...) –  Arjan Nov 1 '09 at 9:14
2  
Like @Bender wrote: find out whether hard links are the cause of problems Unless the file date is important, or if something else went wrong while creating the hard links, I don't see how hard links would make Windows Explorer (or anything else for that matter) fail. –  Arjan Nov 1 '09 at 10:38
    
> I foolishly used Dupemerge to change all my duplicate files into hard links. Now Windows XP is not running right, eg, explorer won't start. Did you do that for Windows files as well‽ Attention everybody who lands on this page: do not do that for system files (e.g., files in \Windows\*). Even if it manages to work for a while, it’s highly inadvisable since it may break updates and such. –  Synetech Aug 2 '12 at 19:42

8 Answers 8

Try Hard Link Magic, it might help.

Also Microsoft's Junction has the ability to recursively traverse directories and list/delete junction-points.

Just be careful to create a system restore point before you do these manipulations.

share|improve this answer
    
Hard links aren't junction points. That program seems to work with junction points too (it's actually called Junction Link Magic). –  Bender Nov 1 '09 at 8:19
    
@Bender, you mean that after installation it's called "Junction Link Magic"? (All downloads seem to refer to "Hard Link Magic".) –  Arjan Nov 1 '09 at 9:08

I doubt that there's a utility for undoing what was done. You can search for duplicates again, check their link counts and attributes (or maybe Dupemerge can help identify hard links to the same files) and do the copying by hand. This may at least help you find out whether hard links are the cause of problems.

share|improve this answer
  • Since you've converted them into hard links, you might be in luck and they might still show up as duplicates using something like DoubleKiller.

  • Either way, I doubt there's a utility for this exact task.

If all else fails I recommend a re-install...

share|improve this answer

to fix the operating system use the system file checker:

insert the windows xp installation CD

press CTRL + ALT + DEL to bring up the task manager, go to File > Run (New Task) and type sfc /scannow and click OK.

note: this will only restore the system files, but it will get you going again. as for other software affected you'll have to re-install or repair install where necessary.

share|improve this answer
    
sfc /scannow with repairs can really screw-up a Windows installation. It will try to return to the state of the CD, regardless of any Windows Update or service packs applied since. The OP will have to wade through heaps of dialogs to find out which ones he really needs, and might still end up with a non-bootable system. –  harrymc Nov 1 '09 at 13:02
    
thanks for reminding me, that explorer doesn't start. and if you're asking me, this windows installation is already thoroughly screwed up. that's why people make backups from their system before pulling such stunts. :) –  Molly7244 Nov 1 '09 at 13:13
    
Quite right. I give high chances for a total reinstall if he can't go back to a restore point. –  harrymc Nov 1 '09 at 15:58
    
seriously, by the time you'll have it all figured out (and there might be still some surprises in store for you), you'll have windows installed on a dozen or more machines. –  Molly7244 Nov 1 '09 at 17:46

Update.

Things that didn't work:

  1. I didn't find any nice tool to undo hardlinks (ie, id hardlinks, copy the file, delete hardlink, rename copy to the hardlink name).
  2. Ran chkdsk in Recovery console (after uncompressing all files)
  3. My Lenovo system disk wouldn't let me reinstall windows xp home, and Lenovo's Rescue and Recovery program would not reinstall Windows
  4. copying out (to a 2nd partition) and back didn't help

What I did:

  1. copied out my C: drive to another partition in a directory "\c-drive-2009Nov4 using Richcopy

  2. In may I installed a new bigger disk, creating a partition on the new disk the same as my old C: partition. Then I copied, using a USB holder, from my old c: to the new C: partition on the new disk. Then I moved the data & installs out to a new large data partition, leaving a 70GB c: system partition on the outer faster ring of the HD. So I just did it again, using a live boot linux GParted to copy my partition from May to my trashed partition.

  3. Then I used the copy I made of my current C-drive to bring back any simple files I needed, eg, updated BAT files, and reinstalled any more recent programs.

  4. I was using FEBE to backup my Firefox profile, so I used the backup to reset my FF settings, in windows, and in Ubuntu, which I installed on another partition. Ubuntu is how I still had web access and some utility. Worked pretty well, even if stuck on the slow portion of the HD.

Losses: some "giveawayoftheday" programs I cannot reregister, some program settings.

share|improve this answer
    
Thanks for the update! –  Arjan Nov 13 '09 at 16:16

SameFiles Assistant 3.1 might work:

Same Files Assistant is the hard links managing utility.

Specifically one feature it has:

  • You can roll back hard links to the regular files at any time.
share|improve this answer

I have written a Perl script that identifies all regular files that are hard links to the same data. The script works fine on UNIX and Cygwin. I haven’t tested it with Strawberry Perl or any other Windows port of Perl, but I thought I’d share it anyhow. On Windows (Cygwin) I would open a terminal and do ./list-dup-hard-links /cygdrive/c/.

#!/usr/bin/perl
#
# NAME
#
#   list-dup-hard-links - list regular file names pointing to the same inode
#
# SYNOPSIS
#
#   list-dup-hard-links DIRECTORY
#
# DESCRIPTION
#
#   For each inode that is referred to by more than one regular file, print
#   the inode number and the list of corresponding files.
#
# AUTHOR
#
#   Peter John Acklam <pjacklam@online.no>

use strict;                             # restrict unsafe constructs
use warnings;                           # control optional warnings
use File::Find;                         # traverse a file tree

if (@ARGV != 1) {
    die "Usage: $0 DIRECTORY\n";
}

my $start_dir = shift;                  # starting directory
my $start_dev = (stat $start_dir)[0];   # device number of where we start
my %inum2files;                         # map each inode number to file(s)

sub wanted {
    return if -l;                       # skip symlinks
    my @fileinfo = stat();              # get file info

    if (-d _) {                         # if a directory
        my $this_dev = $fileinfo[0];    # get device number
        if ($this_dev != $start_dev) {  # if we crossed a device boundary
            $File::Find::prune = 1;     #   mark directory for pruning
            return;                     #   and return
        }
    }

    return unless -f _;                 # continue only if a regular file

    my $inum = $fileinfo[1];            # get inode number
    push @{ $inum2files{$inum} },       # append this file to the list of
      $File::Find::name;                #   all files with this inode number
}

find(\&wanted, $start_dir);             # traverse the file tree

while (my ($inum, $files) = each %inum2files) {
    next if @$files < 2;                # skip non-duplicates

    print "\nInode number: $inum\n\n"   # print header
      or die "$0: print failed: $!\n";

    for my $file (@$files) {
        print "    $file\n"             # print file name
          or die "$0: print failed: $!\n";
    }
}
share|improve this answer

In Unix, hard links to one file links same "inode number". "stat" function returns file properties like size, mode, alter date, modification date, inode number, ..., but return inode number "0" for any file in Windows. Use perl Win32::IdentifyFile (CPAN) to get a file disk "localization". Hard links "links" to same disk "localization".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.