Monday, September 6, 2010

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS [Optimization]

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS If your computer's running slowly and you've tried everything else, it might be time for a fresh install of your operating system. Here are some tips, tricks, and best practices to get through the process quickly and easily.

There are a lot of scenarios that can bring you to the realization that it's time to start over. Perhaps you've had your machine for a few years, you pop in the same hard drive or SSD each time you upgrade, or you just install way too much stuff and it would be far more time-consuming to do a thorough cleaning. Whatever your case may be, wiping your drive and performing a fresh install of your OS is sometimes the best course of action, but it can cause other problems—like data loss—if you're not careful. There are a few ways to approach the process but we're going to look at approaches that'll save you time—while still being thorough, of course.

Step One: Clone Your Hard Drive

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

If you backup online, keep everything important in Dropbox, use software like Apple's Time Machine, or do anything anything that takes the work out of backing up your files, you still aren't ready to just wipe everything off your computer's hard drive. While you might have a complete backup in multiple places, you're not going to want to spend time searching for files after you re-install your OS.

Creating a clone of your current drive is probably the best thing you can do to prepare for this for a full wipe and reinstallation. First of all, if anything goes awry and you want to revert to your old system, you have an exact copy of your drive before you wiped it. You can always restore it back to the way it was. What's more likely useful is that when you need to start restoring select files on your computer's hard drive, they'll all be in one place. The location of files on your backup drive will be virtually identical to the location on your computer's hard drive, so figuring out where to copy files will be a lot easier. Cloning a hard drive is also a set-it-and-forget-it kind of process, so you can just initiate the clone and come back in a few hours. Pending any unforeseen issues, it should be complete when you come back. All you need to make the clone happen is an external hard drive of equal or greater capacity than the hard drive you want to clone, cloning software, and a few hours you can devote to anything but using your computer. Let's break it down by operating system.

Windows
There are a number of options for cloning Windows drives, but we'll take a look at a couple of good ones. Easeus Disk Copy (our review) is one of the fastest ways to clone your disk and works via boot CD. It actually works on Mac OS X and Linux as well.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

If you want to clone your Windows drive without a boot CD, however, DriveImage XML (our review and how to) can do it on the fly. It has options to save to a disk image (as opposed to simply cloning) to another drive, but since you need to save the data to a separate drive anyway, you're probably better off doing an actual clone than a disk image. On the other hand, if you don't mind that you can't boot from the clone and want to use an existing external hard drive with enough extra space to host it, saving to an image is an option as well. Personally, I prefer to have a separate drive so I can continue to update the clone periodically as a means of backup, but you should follow the method that works best for your needs.

Mac OS X
My favorite drive cloning software for OS X is, by far, Carbon Copy Cloner. First of all, it's free, but after using a number of others, both free and paid, I've found there's really nothing better for this task. It also makes for great, simple backup software and can create bootable drives, so if you're on a Mac it's really the way to go.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Using the software is pretty simple. You just select a source drive (your internal hard drive) and a target drive (your backup drive) and press the clone button. If you need to stop it at any point, you can. If you reinitiate the cloning process later, Carbon Copy Cloner will just rescan everything on the target drive and pickup where it left off. There's a bit more Carbon Copy Cloner can do, but for our purposes a simple clone works well enough. Just make sure you check all your settings before starting the drive cloning process so you don't accidentally send data in the wrong direction and erase files you want to keep. Yes, yes, this seems like a pretty dumb mistake, but we're all careless sometimes and it can happen. Always remember to double check!

Linux
Clonezilla is a great option for Linux and it comes in two different flavors. Clonezilla Live is what you're going to want to use. It lets you use a CD, DVD or USB flash drive to boot the application and, from there, you can clone your drive.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Clonezilla Live gives you the option of cloning your internal drive to another connected drive, but you also have the option of backing up to a network drive as well. Alternatively you can always just use the dd command in the command line like this:

dd if=/dev/sda of=/dev/sdb

In this case we're copying content from /dev/sda to /dev/sdb. It's worth noting that to do this you should 1) be very careful so you don't accidentally write over the wrong disk, and 2) that you need to be running as root in order to execute the dd command.

Since this can take awhile, if you're looking for something to do in the meantime and you happen to have another computer you can start downloading all the software you're going to need to re-install. If you're running Windows, Ninite is a wonderful shortcut for several freeware applications. You'd also do well to look over the Lifehacker Packs (our favorite free software) for Windows, Mac, and Linux. Apart from those great freebies, you probably have more complex applications—like Adobe Photoshop—to install as well. Downloading these all ahead of time and loading them up on a flash or external hard drive can make the re-installation process a lot faster when the time comes.

Step Two: Zero Out Your Data

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Once you have a good, cloned backup (and maybe a few other backups, online or otherwise, if you're as paranoid as I am), you can erase the data on your computer's internal drive. The idea that you're actually erasing the data is a bit of a misnomer, however. When you perform a quick format, the drive is just being told that all sectors are writeable. That means next time the drive needs to perform a write, it will overwrite files that you indicated were fungible. It's only at that point the data is replaced, and sometimes data is only partially replaced. This means you have file fragments floating around, and while it's not going to cause a huge performance hit on your drive, it is nonetheless relevant. More importantly, zero-filling your hard drive will identify bad sectors in the drive and prevent them from being used. If you really want to give your machine a fresh start, it's best to zero out all the data on the drive. (All the data on your drive is stored as 1s and 0s. Zeroing your drive is sort of like hitting the reset button on your hard drive.)

Zeroing out your data does the same thing as a quick format, but afterwards it writes zeroes to every block on the hard drive. For added security you would perform this function multiple times, but since our aim is less about securely deleting your data and more about identifying bad disk sectors and forestalling disk fragmentation, we're not going to go all out. I've got a 256GB SSD and this process took about 30-35 minutes. On a traditional hard drive it will probably take a bit longer. Either way, it's another set-it-and-forget-it process, so you can let your computer do it's thing and go off and do yours.

So how do you write zeros to a disk when formatting? It varies by operating system, so let's take a look at each.

Windows
While there are a few third party options, grabbing the software from your drive manufacturer is generally free. Hitachi, Seagate/Maxtor, and Western Digital all provide software that can zero-fill their hard disks. For a comprehensive overview of your windows options, check out Gizmodo's guide tocompletely erasing your drives.

Mac OS X
In Mac OS X, the magic happens in Disk Utility. Chances are you'll be doing this after booting up from your OS X install DVD, but it'll look the same either way. First you want to select your internal hard drive and choose the erase tab.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Once you get there, you'll see a button towards the button called Security Options. Click that and you'll get the following popup:

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Chances are that Don't Erase Data is already selected. Keeping this option selected means your disk will be formatted and data will be marked as overwriteable, but the data will still be intact and is easily recoverable via disk recovery software (basically, what we talked about earlier). What you want to select is any of the other options. Zero Out Data is the fastest, but if you're interested in waiting a long time in the name of better security, the 7-pass and 35-pass erase operations will serve you better. Either way, once you've made your decision click OK to accept your selection and then Erase once you're back in the main window.

Linux
The easiest way to zero-fill a hard drive in Linux is by using dd in the command line. Similar to cloning a drive, a command like this will fill a drive with zeros:

dd if=/dev/zero of=/dev/hda

In this example, /dev/hda will be filled with zeroes. Make sure you specify the path to the drive you want to zero-fill and don't just copy and paste this statement. Although you'll have to be running as root to execute a command like this, it doesn't take much to accidentally zero-fill the wrong drive. Be very, very sure you have everything correct before doing this.

Step Three: Install Your Operating System (Again)

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

While re-installing your system is a pretty straightforward process, it's a good time to consider what you do and do not want to put on your machine. In the case of Mac OS X, you'll generally end up with extra print drivers and language translations. Although OS X 10.6 did away with that problem for the most part, it also removed software like Rosetta and QuickTime 7, which may be things you'll need and want to install.

With Windows, what you'll likely want to pay attention to most is anything that's been installed that isn't actually Windows. If you're using a system install disc that came with your desktop or laptop, you should be wary of any third-party crapware that's coming along with the operating system. If you can't stop it from being installed, make uninstalling it the very next step once the installation is complete. This process is surprisingly painless with a tool like PC Decrapifier (our review).

When it comes to Linux, this is less of an issue. Since you can pick your distribution and what you do and do not want, chances are you're not going to accidentally install packages you don't need.

Step Four: Restore Your Personal Data

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

This step is the most time-consuming and the most personal. How you go about it will vary based on your needs, but there are a couple of things to keep in mind.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS First, you don't want to just dump all your old data back on to your internal hard drive. That'll defeat the purpose of the fresh install. The idea here is to get rid of all the crap you don't need, so you really want to go through your files—by hand—and pick only what you want. This mainly pertains to files used by your operating system (such as settings files and application data) since your personal documents (music, video, photos, text files) aren't really tied to anything and only really take up disk space. Restoring these files doesn't have to take a lot of time, though, because you can just select what you want from the backup and copy them to the same relative location on your internal drive.

A warning to Mac OS X users: Although it may be tempting to use Migration Assistant to take care of all of this for you, resist the urge. Migration Assistant is great for an upgrade, but it will pretty much restore your system to the way it was and anything you'll gain from starting from scratch will be lost.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS

Once you have your system files in place, installing applications is up next. Depending on your OS and the application in question, you may be able to just copy a few things back over. In many cases, however, you'll need to reinstall from scratch. While your backup may not be too helpful with re-installing your applications, you can use it as a list of applications you need to install. Better for Windows users, however, is if you're using Ninite or our Lifehacker Pack for Windows to automatically install some of your favorite free software. And whether you're a Windows, OS X, or Linux user, hopefully you've also filled up a flash or external hard drive with every other application you need to install (as described at the end of step one). This way you can just run through each installer and get the job done quickly.

Starting From Scratch: A Step-by-Step Guide to Reinstalling Your OS When it comes to your other, personal, files, you don't really need to worry too much about what you do and do not copy back to your internal drive. They're not tied to the system and they're not going to have much of an effect on performance. Still, this is a great opportunity to do some spring cleaning. Copy back only what you think you need. The best part about having a hard drive clone is that you can potentially take it with you and just copy over files you forget if you find you need them. Keeping the clone handy for the next few days is key since you're likely to forget something. Once a few days have passed and you find you're not copying anything over, it's probably safe to leave the clone at home. At this point you should be in great shape, running a clean new install of your operating system with far fewer files around to bog down performance.

Got any great tips for performing fresh OS installs? Let's hear 'em in the comments!

Send an email to Adam Dachis, the author of this post, at adachis@lifehacker.com.


Your version of Internet Explorer is not supported. Please upgrade to the most recent version in order to view comments.

Loading comments ... -/|\\\\\" /></div>  	</div>    	<div class=

In order to view comments on lifehacker.com you need to enable JavaScript.
If you are using Firefox and NoScript addon, please mark lifehacker.com as trusted.

Posted via email from ://allthings-bare

No comments:

Post a Comment