2

When formatting a Windows computer I always copy the full content of the harddisk to an external drive using an USB-based Linux distro (currently Knoppix). This makes sure that I can always retrieve any and all files in case the user suddenly realizes that they 'forgot' that one important file in the root of their C:-drive - which has a tendency to happen.

The laptop I'm currently working on displays an odd problem: in Windows, the disk space is reported as 220GB in use out of 260GB (NTFS, uncompressed) but it completely filled up a 320GB drive (NTFS, uncompressed, same cluster size) and still wasn't done copying. Using a different external drive with 220GB available I tried to copy the /Users directory which was reported by Windows as 120GB in size but completely filled up the drive taking up 220GB and still returning 'No disk space available' errors.

I've done this kind of operation a lot in the past but this is the first time I encountered something like this and I'm baffled by it. What would cause this to happen?

Edit: When working with malware-infested, spyware loaded systems that are beyond redeeming the last thing you want to do is start copying from the infected OS. I learned a long time ago that it'll just crash or lock up on you and that's why I use a USB-based Linux. Plus, I can just hit copy and leave it on overnight, no Windows nagging about files being in use.

Copying to an external NTFS drive means I can plug that drive back into the re-installed (vanilla) Windows and copy back the essential files to the computer.

Edit 2: the solution to my problem is simply 'use the right tool'. Apparently the regular copy of the Linux I used gets confused over NTFS and hardlinks. I used ntfsclone to copy and that worked like a charm.

5
  • have you tried copying this from within windows?
    – Jim B
    Jun 15, 2011 at 13:20
  • I've edited my question to indicate that I specifically want to avoid doing that. On some systems that is an option but I only tend to get computers that are so far beyond redeeming I sometimes wonder if the malware hasn't imprinted itself on the hardware ;-)
    – JDT
    Jun 15, 2011 at 14:33
  • So you are concerned that a CD or USB stick that boots a copy of windows will get infected just by copying files?
    – Jim B
    Jun 15, 2011 at 17:11
  • No, that's not a concern to me. Aside from the fact that I'm not familiar with Windows live CD/USB-key installations I also prefer free tools - I don't want to spend money on software I won't be using every day.
    – JDT
    Jun 15, 2011 at 17:52
  • a "live cd" comes on the windows CD see en.wikipedia.org/wiki/Windows_Recovery_Environment
    – Jim B
    Jun 15, 2011 at 18:16

2 Answers 2

3

What app do you use to copy/duplicate the data and does it understand Window's hard links?

For linux/unix based disk/partition duplication, I would recommend you use an app that simply makes a binary copy of the partition, rather than trying to figure out the latest NTFS features. The app I'm referring to is 'dd'.

Don't forget you can mount ISO and partition images just like you can with an external hard disk or DVD disc.

4
  • I'm just using the built-in copy tool of the Linux distro to copy files to the external disk. After the OS is re-installed I plug in the external disk, copy the files back and if required backup the data to a DVD or other external disk. I'm aware of tools that create disk images but intentionally do not use them as I want all the files to be accessible from the external disk from a vanilla Windows installation.
    – JDT
    Jun 15, 2011 at 7:49
  • +1 for dd; also you could use gparted, and then a Windows machine can natively read it.
    – Andrew
    Jun 15, 2011 at 7:49
  • OK, so just use dd to duplicate the partition onto the external hard disk? I assume the source partition doesn't have a dynamic size, so you only have to setup the partition table on the external hard disk once.
    – DutchUncle
    Jun 15, 2011 at 8:09
  • 1
    I've designated this as the right anwser, it explains exactly what went wrong. Once I started using ntfsclone I managed to get the files on the external drive.
    – JDT
    Jun 15, 2011 at 17:46
0

Using NTFS on the USB disk is a dumb idea. While the guys who wrote it have done a great job of reverse engineering the format, it is unlikely to ever work the same way as MS's implementation.

While Unisot's suggestion of using a different format on the copy makes sense, using a crude tool like dd will copy over the unused disk sectors - and unless they have been explicitly zeroed-out they will occupy space on the destination drive.

If you need an image of the disk, have a look at the tools designed for the job.

If you just want the files, then use the most appropriate filesystem for the drive running under the OS you use for copying, and just copy the files.

(for file archiving you might want to have a look at afio which compresses each file - rather than tools like cpio and tar which compress the whole stream - which is not as robust)

1
  • I've edited my original post to indicate that running under the OS of the drive I'm trying to copy is not an option. I have also outlined why disk images or even booting the copied disk is of no interest to me.
    – JDT
    Jun 15, 2011 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .