Tuesday, October 03, 2006
Short list of NTFSClone commands
This assumes that you have a hidden Linux partition (ext2/ext3) on the hard drive and that you're creating an image on that hidden drive. Most of the time that means you're writing to either /dev/hda2 or /dev/sda2, but you should double-check that.

List the partitions on the known hard drives:
# fdisk -l

Mount the hidden Linux partition:
# mkdir /mnt/image
# mount /dev/hda2 /mnt/image
# mkdir /mnt/image/machinename-date
# cd /mnt/image/machinename-date


Image the drive (be very careful with commands!):
# sfdisk -d /dev/hda > machinename-date-hda.sfdisk.dump
# dd if=/dev/hda bs=512 count=1 of=machinename-date-hda.mbr
# ntfsclone -s -o - /dev/hda1 | gzip | split -b 500m - machinename-date-ntfsclone-hda1.img.gz_


Notes:

- There are two places in the command where a "-" appears by itself. These are critical as they tell ntfsclone to pipe to standard output ("-o -") and that the split command should pull from standard input ("-" by itself).

- You'll probably want to use the underscore ("_") on the end of the image filename so that split adds the 2-letter suffix (aa, ab, ac, etc) in a way that is not confusing.

- Note, the split size of 500MB is used in order to avoid the 2GB limit when writing to SMB network shares. Plus it lets you spread the files across multiple disks if needed.

Labels:

Monday, July 17, 2006
Gentoo 2006.0 LiveCD and NTFSClone
In the past, I've been using the Knoppix LiveCD and NTFSClone to make snapshot images of Windows workstations. However, since Knoppix 4.0.2 doesn't auto-detect the ethernet port on the Asus A8N-VM CSM motherboard, I tried out the Gentoo AMD64 2006.0 LiveCD instead.

The big trick with the newer LiveCDs is keeping them from booting into X. At the boot: prompt you need to enter "gentoo nox" in order to prevent that from happening. That gives you the normal command line that has root level access to the LiveCD and you can switch between sessions using [Alt-F1] and [Alt-F2].

After that, it's pretty easy to mount a drive and write the image file out to wherever you need it to go. I typically create a hidden Linux partition at the end of the primary drive using ext3 and write a pair of images to it when I finish the initial build. I'll also burn one of the images to DVD-R for use in cases where the user manages to wipe out the hidden partition (or the drive dies entirely).

Labels: