DRIVE IMAGING 101
Upgrade to a speedy SSD the fast and easy way
Back in the July 2018 issue, we looked at some easy ways to keep your precious data safely backed up. Part of the rationale of any backup strategy is not to bother with any data that can be easily downloaded again, which is why backups usually ignore boot drives these days. User folders store configuration files, and the general OS files are restored when you reinstall, right?
As true as that is, there’s still a couple of arguments for running clone operations; one of the most common is to migrate your boot media, transferring it from an old slow HDD, or perhaps shifting from an outdated SSD to a more modern one. The other argument is backup—while it’s true you can reinstall Windows from scratch, we all know how long that can take, and don’t get us started on updates. So, if a clone can be created easily and quickly, it can offer a simple way to deal with future problems.
We’re going to look at two options, one that Microsoft offers and the other an open-source solution. The first is the tried and trusted Windows System Image. It’s convenient, because it can run live as you use your system, and it ties in to the default Windows Recovery system. We’re also going to look at the off-putting but incredibly flexible Clonezilla, created back when everything was called project>zilla.
Cloning or imaging? We really should get our parlance sorted before we continue. When most people think of imaging a drive, it’s the process of copying an entire drive or partition to an image file stored elsewhere. In terms of drive cloning, people tend to think of “live imaging” of one drive or partition to another drive or partition on the fly.
Essentially, both processes are the same, it’s just the destination that’s different. Once a drive image is written to another drive, you’ve accomplished the same cloned state, just with an extra write step. To keep things simple, we’ll call it all drive or partition imaging; if we’re doing it disk-to-disk or disk-to-file, it’s hardly going out of our way to say so.
Typically with backups, an incremental option should be available. This is a drive image that only stores the bytes that have changed, so it’s quicker. Sounds useful, huh? Annoyingly, neither the Microsoft option nor the open-source tool support this, though it’s not out of the question.
To be fair on Microsoft, imaging isn’t a well-regarded way of backing up data these days, especially if you can’t use an incremental system. It’s time-consuming, and even considered pointless. If you have a boot drive larger than 240GB, you might want to consider another approach or repartitioning, so your user data is stored separately from Windows.
Unix-based operating systems nailed this aspect of separating user files from the OS a long time ago, insisting that all meat-bag data is stored (originally) in a dedicated /home folder, and in recent years on a /home partition. This enables the OS files to be nuked from orbit, reinstalled, and the world keeps on turning, because user files and config files are safely stored away from the detonation site. Windows 2000 did introduce something similar, but there’s still an unholy mishmash of files all over the place. It’s annoying.
THE MICROSOFT WAY
We’re going to kick off by looking at the built-in Windows System Image tool. Microsoft tried to push people away from system images when it introduced Windows 8, in its not so subtle way of killing off Windows 7 Backup and Restore, which was originally introduced in Windows Vista. After much Gen-X moaning, Microsoft restored the system to Windows 8.1, and it remains tucked away in Windows 10 under the Control Panel section in “System and Security > Backup and Restore (Windows 7).”
In its favor, it’s pretty straightforward to use, uses shadow copy to run in the background as you work, and the recovery (usually) works as part of the standard recovery mode options. The “usually” comment there is inserted as we have run into issues restoring images made under different versions of Windows— as in, it won’t do that. Technically (and actually), you should make a recovery disc as a catch-all—you’re prompted to do this when an image is completed.
Limitations with Windows System Image include: minimal options (it only images the entire system drive, and you can’t restore individual files after); it only backs up to the root of a selected backup drive, and it only allows one image on there; it insists on a network username and password for network shares, even if they have public access rights (in this case, you need to provide the remote system’s standard username and password); and, as mentioned, it doesn’t support incremental backups, so it always takes a long time to run.
Creating a disk image with Microsoft System Image is pretty easy, but you need a separate internal drive, a spare external
drive, a big stack of DVDs, or a network share to which you know the username and password. Got that sorted? Good!
In “Search,” type “Control,” and select “Control Panel.” Under “System and security,” click “Backup and Restore (Windows 7),” and click “Create a system image” on the left. It scans for what it considers viable backup targets. An external drive or network share would be best, though any internal drive is fine; as mentioned, though, for any network share, even if it’s set for guest access, you need to provide a suitable username and password. If everything appears to work, click “Next.” You’re provided with an estimate of the space requirements and a “Start backup” button. Hit that, and you can continue life as normal, while the drive is imaged in the background.
To recover your PC, you have two options: reboot using a recovery DVD, or start Windows in Recovery mode. If Windows runs, open the “Start” menu, type “Recovery,” and choose “Recovery options.” Select “Restart now” under “Advanced startup.” Choose “Troubleshoot > Advanced options > System image recovery.” Windows then reboots into Recovery mode. You need the drive with the system image on plugged in to your computer. Follow the prompts, and your system tis restored.
THE OPEN WAY
So, the Microsoft tool is limited and slow, but it has saved our bacon a couple of times over the years. We look at other proprietary options in the box below, but we’d like to focus on the long-standing industry tool Clonezilla. In development since in 2007, it’s an enterprise-class diskimaging and restore tool, with support for over 20 filesystems, over six operating system types, and sector-to-sector copy for those it doesn’t support. It has full network support, a client-server mode, and supports full encryption of its images. It’s beyond the scope of this article, but it also supports Multicast for multi-clone/ restore to networked systems, with PXE and WoL support.
That’s all nice, but it means Clonezilla is more complex to use. It’s not helped by the fact that it has its roots in the Linux garden, so text-based interfaces and indecipherable drive names are the order of the day. The flip side is that it’s superflexible, and free to use anywhere and on anything. And once you’ve run through the menu systems, you soon learn what’s important and what can be ignored.
Clonezilla is a “live disc” OS, which means you grab the ISO image from
www.clonezilla.org, and write it to either
a CD, DVD, or USB stick. You then boot your system off that. Get the “Alternative Stable” image, aka Ubuntu-based build, from www.clonezilla.org/downloads.php —it’s about 220MB. This version can avoid potential UEFI boot issues on new systems. If you want to write this to a USB stick, the latest tool to do that is Etcher.io. Gather all that together, write it to the USB stick, and come back when you’re ready.
Now work out how to boot your PC from a USB device—many systems offer an early “Boot” menu, accessed by tapping F9 (HP), F12 (Dell, Lenovo), F8 (Amibios), or F11 (Award BIOS) while it runs the power-up POSTs; otherwise you need to hit Del, and fiddle with your boot device priority settings in the BIOS/UEFI.
If all has gone well, you’re presented with the glorious text-based screen shown below. A rule of thumb here is to use the defaults—you can’t really go too wrong. We’re going to take you through creating an image of your boot drive and restoring that. We’ll talk about live imaging driveto-drive, and in the box on the left, we cover networked imaging, because Samba networking takes a couple more steps to set up.
Going through the menu, “800x600” is more than enough pixels for anyone, then “English language,” “Default US keyboard layout,” and “Start Clonezilla.” Then you land at the first menu of import. Use the up/down arrow keys to move up and down; switch between “<OK>,” “<CANCEL>,” and main menu options with the Tab key; and if you need to select multiple items, do that with the space bar.
Choose “device-image” or “devicedevice” mode—we’re not covering the other options. We’re selecting “deviceimage” first, so hit Enter. Next, choose the location of the image file; we’re using “local_dev” (local storage device), so tap Enter. For network access, you’d select “samba_server,” while if you have accounts for Amazon S3 or OpenStack, they would be useful for remote backups.
At this point, it prompts you to plug in your USB device. Wait five seconds, then press Enter. It now lists all the suitable devices it can detect; this should include the source drive you want to image, and the target drive where you want to store the image. The list uses modern Linux parlance, such as “/dev/sda VBOX_ HARDDISK VBOX_HARDDISK_<LONG HEX NUMBER> 163GB.” The initial “/dev/ sdX” is the human-readable system label for the drive; the first name is the detected hardware device name; and the long name containing hexadecimal is the unique OS label, ending with the total capacity.
If those look correct, press Ctrl-C, and Clonezilla scans for partitions. This results in another overly complex-looking list. You should recognize the device labels
“sda,” “sdb,” and so on that denote drives, while the partitions on each drive are numbered “sda1,” “sda2,” and so on for one drive, and “sdb1,” “sdb2,” etc. for the next drive. Each following label consists of “<capacity>_<file system>_<drive label> _<device name>_<OS Unique ID>.” Select the target drive to save the image to; if you’ve named it, look for the “<drive label>” section. Select it, then press Enter.
You’re presented with a “Directory Browser.” If your backup drive is blank, it just has a confusing “<ABORT>” selection, but if you have sub-directories, these are listed and selectable. Don’t worry—each image creates its own folder anyway. Tap Tab twice to select “<DONE>,” then press Enter to use the root to store images.
Select “Beginner” mode, then we need to select the backup style. To keep things simple, we’re going to focus on “savedisk,” as in the entire drive—for a typical Windows boot drive, this is three partitions, which you want to save: boot partition, OS partition, and a recovery partition. If you’re recovering your image, select the “restoredisk” or “restoreparts” option—notice the “1-2-mdisks” option, which enables multi-disk restoration if you’re doing a mass clone. Press Enter to get this show on the road. Keep the default date-based name. Finally, select the drive (or partitions, if that’s the option you’ve chosen) to image, then press Enter.
There’s a final batch of options to go through. Choose “-sfsck” to skip disk checking (it doesn’t work well on NTFS filesystems anyway); choose to verify the final image; encrypt the image for security if you want, but you need a strong password; and it offers to power down when done. Hit Enter twice to get started. There’s a final “Press (y/n)” to get started, before a detailed progress display is shown. Even on older spinning drives, imaging a boot drive shouldn’t take much longer than 15 minutes, unless its capacity is in the terabyte range. SSD scenarios are significantly faster.
Restoration of a drive is exactly the same—the advantage for Clonezilla is the images are always compatible, you can easily get a fresh ISO to boot from, and images can be stored anywhere, even in the cloud—just after the “Beginner” mode selection, choose “Restoredisk” mode.
Disk imaging isn’t a cure-all backup solution, but it can help get a system back up faster than reinstalling, and is a real time-saver for deployment scenarios.
The targets in Windows Backup still include DVDs.
It’s really handy having a rescue disc to hand in case of emergency.
If everything goes to plan, recovery is a smooth process.
Take your time, and you’ll find that the device list does make sense.
Clonezilla’s file browser is super-basic, but does the job.
Use the space bar if you need to multi-select devices.
Clonezilla is pretty fast, and has a good time-remaining estimate.