Archive for Operating System

Copying the contents of a hard disk drive and an opportunity to revisit Linux

My current 80GB HDD was running low on disk space and so it was time for an upgrade. My plan was to copy the data from the old HDD to a new 500GB one and extend the one and only system partition. A straightforward task.

Now, the PC in question has only one SATA port on the motherboard so that ruled out a straight disk-to-disk copy, complicating things slightly. I decided to copy the existing data to a Windows fileserver on my local network, install the new disk and copy it back. Using an external USB hard disk would’ve been a viable alternative.

I don’t know how to do a straight sector copy in Windows without resorting to third-party software or writing code, so I decided this would be a good opportunity to try a Linux-based “Live CD”. I chose Ubuntu simply because it was the first that came to mind and I knew it would have almost all the utilities that I needed right there on the CD.

First impressions… everything just works. Booting from the Ubuntu CD, after a minute or so I’m looking at the GNOME desktop. Wireless networking is working; video is working; impressive!

To mount the SMB share on my Win fileserver, I needed to grab smbfs …

sudo apt-get install smbfs

… and mount the share:

smbmount \\\\myserver\\myshare ./images –o user=myuser

I piped the existing HDD data through gzip to save on storage and network bandwidth:

sudo dd if=/dev/sda bs=512 | gzip > ./images/sda.img.gz

After a few hours of network copying, I swapped out the old HDD for the new and copied the data back:

gzip –c -d ./images/sda.img.gz | sudo dd of=/dev/sda bs=512

Note: I copied every sector including the MBR / partition table from the old to the new disk. This approach will only work if both disks have the same geometries.

dd responds to the USR1 signal by writing status to stderr, so I tracked progress (updating every 2 minutes) during long running dd operations using:

sudo watch –n 120 killall –s USR1 dd

I then used GParted to take care of resizing the NTFS partition to occupy the entire disk.

After a reboot into Win XP and one chkdsk later, I had more than 400GB free disk space.

Disclaimer: I don’t recommend you follow this approach unless you’ve backed up your data, are prepared for the possibility that things may turn bad and have a reasonable idea of what you’re doing.

Comments off

Unknown PCI device (Device Manager) – How can I find out what drivers I need?

If a PCI device is showing up as an “Unknown Device” in the Windows Device Manager (devmgmt.msc) and you’re not sure what the manufacturer and/or device name is, here’s a quick tip that may help.

Pull up the Properties for the device. Select “Hardware Ids” in the drop-down and make a note of the Vendor (VEN_XXXX) and Device (DEV_XXXX) identifiers (in this example, 8086 and 24C6). With this information you can search for your device at


Once you have the vendor and device name, it will increase your chances of finding the correct driver on the manufacturer’s website.

Comments off