Friday, February 6, 2009

Saving Win2K disk image using Partimage and CIFS

At work I've got this computer set up with Windows 2000 and Office XP just like I like it.  Now I want to "image" the hard drive so that later on if anything happens I can just restore the image to this computer (with all the drivers and updates and everything) and it will be just like it is now.

I've done this before.  I use a great free Linux program called Partimage.  This can be found in the Knoppix distro, but recently I've been using System Rescue CD.  I shut down the computer and booted from System Rescue CD ver. 1.1.4 using the "dodhcp" option so it would connect to my network.

Then, to make the disk image smaller, I wanted to delete the Windows paging file (pagefile.sys) before I made the image.  To do this, I first needed to mount my Windows partition.  From System Rescue CD Linux command prompt, I typed:

mount -t ntfs-3g /dev/sda1 /mnt/windows

then just   cd /mnt/windows   and    rm pagefile.sys

Next, I had to mount a shared folder from my Windows 2000 domain to save the disk image to.  Usually, I have been doing this using smbfs, but when I did this the other day, the new Linux kernel told me smbfs is deprecated and to use cifs now instead.  Here's how I used to do it with smbfs:

mount -t smbfs -o lfs,username=administrator //machinename/sharename /mnt/smb

but this time I did it with cifs:

mount -t cifs -o username=administrator //machinename/sharename /mnt/smb

When I ran Partimage, I kept getting this error "Cannot create temp file" "no space left on device" from Partimage.  I couldn't believe that I had ran out of space at first.  So I went back and tried to unmount the cifs share, but I got an "Unable to umount, device is busy" error.  I tried googling around for a solution, and finally found this page.  I needed to do a "lazy" unmount:

umount -l /mnt/smb   (I'm very thankful for this tip!)

After further research, I found that the device I was trying to save the image to actually _was_ full, and after deleting some files, partimage worked just fine.  What's more, cifs is significantly faster than smbfs!

No comments:

Post a Comment

Thank you for your time and interest in this post!
Comments to this blog are sometimes moderated to prevent spam. Please don't be alarmed if your comment does not appear immediately.