I decided to create a vm image of one of the windows desktops using the following commands in ubuntu live cd. /dev/sda is the windows drive to backup. /dev/sdb is the extra drive to store the image.

On /dev/sda1

$ dd if=/dev/zero of=tempzero.tmp bs=32k
$ rm tempzero.tmp

Unmounted /dev/sda1 and on /dev/sdb1

$ dd conv=sparse if=/dev/sda bs=32k | gzip > backup.img.gz

Then restored the image in vmware player. The provisioned hard disk size was set to 510G (actualy physical disk was 500G (actually 468.5G))

Restored the image to the hard disk using (i know we could have piped but I encountered out of disk error when using pipe)

$ gunzip backup.img.gz
$ dd if=backup.img of=/dev/sda bs=32k
$ sync
$ ntfsfix /dev/sda1

Upon booting in the vm I get the following chkdisk error. What mistake did I make?

Checking file system on C:
The type of the file system is NTFS.

One of your disks needs to be checked for consistency. You
may cancel the disk check, but it is strongly recommended
that you continue.
Windows will now check the disk.                         
Cleaning up minor inconsistencies on the drive.
Cleaning up 797 unused index entries from index $SII of file 0x9.
Cleaning up 797 unused index entries from index $SDH of file 0x9.
Cleaning up 797 unused security descriptors.
CHKDSK is verifying Usn Journal...
Usn Journal verification completed.
CHKDSK discovered free space marked as allocated in the
master file table (MFT) bitmap.
Windows has made corrections to the file system.

 488375968 KB total disk space.
 101373272 KB in 700645 files.
    281608 KB in 41598 indexes.
         0 KB in bad sectors.
   1242632 KB in use by the system.
     65536 KB occupied by the log file.
 385478456 KB available on disk.

      4096 bytes in each allocation unit.
 122093992 total allocation units on disk.
  96369614 allocation units available on disk.

closed as off-topic by Jeff Schaller, cas, PersianGulf, Anthon, slm May 22 '16 at 16:14

  • This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    I'm voting to close this question as off-topic because it's asking about Windows behavior. – Jeff Schaller May 22 '16 at 11:15
  • This question is in a grey land between windows and linux, however, 1) I am amaze it simply work at all. 2) "I encoutered an out of disk error" this must explain that. 3) a small chkdisk is a small proce to paid to clone an OS. – Archemar May 22 '16 at 12:10
  • This is offtopic, but I once. long time ago, cloned xp it with generic dd if=/dev/sdb of=/dev/sdc bs=64k and run the image on another same machine and it worked fine. Windows is not predictable so if it works after all - forget about that. – user140866 May 22 '16 at 13:30
  • 1
    According to its man page, ntfsfix "schedules an NTFS consistency check for the first boot into Windows." – Mark Plotnick May 22 '16 at 13:36
  • conv=sparse makes no sense here – frostschutz May 22 '16 at 13:38

Because you'd invoked ntfsfix on the restored volume, the Windows did checked it.

From ntfsfix manual page:

       ntfsfix - fix common errors and force Windows to check NTFS
  • Hmm I meant to fix any ntfs errors that may have occurred before restarting the vm and booting into windows. I'll try not to run ntfsfix and see if I get the chkdsk. Thanks! – Andrew Tan May 22 '16 at 15:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.