I had to order a new replacement for my new Dell Latitude D830. I thought that there was something wrong with my particular D830’s battery compartment since there is a gap between the memory and the rest of the laptop body. I have a 9-Cell battery and it was not fully tight-fit. The gap wasn’t that big but I could actually wiggle the battery and had it making some clicking noise. So I had Dell send me a new replacement. An exact D830 was sent to me. It’s so exact that the same issue happens, again! 2 brand new D830, same wiggling battery compartment! Anyhow, I think I just live with it since I can fix the issue by putting a small peace of folded paper between the battery and the compartment wall to nudge-fit it. I think that the issue is specific to the 9-Cell battery and the D830. Buyer beware!
Enough of my rant. I actually want to talk how I transfered the image of the first D830 to the other one using the SystemRescueCD. SystemRescueCD is a Linux-bootable image that contains all the utilities for disk imaging, partitioning, and other utilities. The ISO is about 160MB. All I had to do was burning it to a blank CD and grabbing my external USB drive to store my image files.
While waiting for my replacement D830, I installed everything I want to the “defective” laptop: Launchy, FireFox, Office, VisualStudio 2005, Rails, e-texteditor, Notepadd++, Cropper, FileZilla, Xplorer2, Xampp, Cygwin, MySQL GUI toolkit, etc.. Everything was about 10GB of data.
I booted the laptop using the SystemRescue CD with my 500GB Seagate FreeAgent external USB Drive (man, I feel like I’m doing free-advertisements now). The linux distro booted up and successfully recognized my USB drive. Next I went into the GUI with startx since I’m not too hot about the command line, plus I can have multiple XTerm’s side-by-side in X. Now it’s time to get down to the cloning business.
Mounting and Imaging the external USB drive
- First of all, my Seagate FreeAgent drive was NTFS-formatted by the manufacture. Secondly, I wasn’t sure where the device was mapped inside the /dev. Digging around, I found these commands:
- # lsusb (to list all USB devices)
- I saw that my Seagate drive was detected properly with an entry in the list. Further more, running dmesg, I confirmed that the Linux LiveCD recognized my drive:
- # dmesg | grep -i “SCSI” (this command is to grep the boot-up kernel messages for the word “SCSI” to make sure the kernel detected the device when it was booting)
- Cool, but now I thought to myself, “how am I supposed to know which device in the /dev folder is my USB?” Actually I made an educated guess here and got lucky. The USB drive was mapped to the /dev/sdb1. I guess with some greppings through the lsub/ other cryptic linux commands/ blind guesses/ beginner’s luck, you’ll find which entry in the /dev folder is your USB drive. Nonetheless, try /dev/sdb1 first, you never know.
- With my newly gained knowledge (and power), I was ready to mount my drive and start a mini cloning factory:
- # mkdir /seagate (to create a new mount folder placeholder)
- # mount -t ntfs /dev/sdb1 /seagate (to mount the NTFS-formatted USB drive to the /seagate folder)
- I was able to mount the USB drive to the /seagate folder using the above command. However, it was read-only since the LiveCD OS did not know the linux permission of the drive. I found out about this when the imaging utility partimage failed to write the image file to the drive. The correct mount command to enable Linux permission is
- # mount -t ntfs-3g /dev/sdb1 /seagate (notice the ntfs-3g param)
Afterwards I was able to write a test file to my USB drive ( #echo “test” > /seagate/test.txt ) and seeing all the Linux permissions on the files ( # ll /seagate )
- I then started partimage. I selected my partition to be imaged, put in the filename in the “Image path” box (/seagate/d830). I didn’t bother with the gzip since I really just image this one time. For my laptop, imaging 10GB took 7 minutes. The files on the USB drive was spillted into files like “d830.000“, “d830.001“, etc.
- I then unmount the USB drive with
I remember the LiveCD complained about some other processes were also accessing the device. To find out which process was using the resource, I did a
- lsof | grep /seagate (list all processes that are opening the /seagate folder)
Ah, I had a XTerm which I had CD’ed into the /seagate folder. Silly me! I cd to another folder and afterwards, umount was able to finish its job.
Restoring the image
- Since the replacement one is an exact duplicate, I didn’t have to pay much attention to the partition image. I popped the SystemRescueCD in, switched the USB drive to connect to the replacement laptop, and booted it up with the CD.
- I went through almost the exact same steps as above: mount the drive using the -ntfs-3g param, then start partimage. Only this time I chose “Restore” instead of creating image and the file name was “/seagate/d830.000“. Partimage automatically picked up the rest.
- The entire restoring process took another 7 minutes.
I restarted the laptop and crossed my fingers. To my delight, my Windows XP Pro was up and running, even my fingerprints profile was loaded correctly. I swiped my finger, smiled to myself, and thought that it wasn’t too bad, at least I didn’t have to use Norton Ghost — everything was open-source. Just have to love it!
I hope you enjoy this post and find it useful. Now I have to finish up posting this blog, pack the original laptop to send it back to Dell, and get busy finding a piece of paper to fix the battery issue for the replacement laptop. Then I can resume doing Rails and Wars of Earth…
Links & References