When Windows goes wrong, it can go really wrong. Worse: Often it’s extremely difficult to save your system from Windows itself. Here’s how to use a simple USB drive to free space, remove viruses, rescue passwords and more from crunked Windows setups.
Photo by *manci*.
What You Can Fix with this Method
If you or your in-need friends or relatives can’t boot into your Windows desktop, or you can’t actually do anything once you’re into it, booting up a live Ubuntu system from a USB thumb drive or off a burned CD, can save your system, recover files and pull off other miracles. Here’s the short list of things we’ll cover here:
- Clean a virus with a Linux-based anti-virus app.
- Recover files and save them onto that same thumb drive, to a web storage spot like Dropbox, or to another USB drive.
- Change your login password if you’ve forgotten it, or someone’s changed it on you.
- Analyse your hard drive to figure out what’s filled it, and resize partitions if you’re dual booting and need to free up more space.
What you’ll need
- Empty USB drive: Sometimes called a “thumb” drive, a “flash” drive, or a USB “stick”. It’s a tiny little piece of plastic that usually holds at least 1GB, and that’s the minimum size you’ll need. If you’re looking to recover files, you’ll need to use a separate USB drive, blank CDs or DVDs, or an online backup service. The drive you intend to install Ubuntu on should be empty, because it will get cleared out when we make it bootable. Photo by .
Alternate: CD-R Using a USB drive gives you faster performance when booting a system like Ubuntu without installing it. If you don’t have a large enough drive to spare, or you’d like to save your USB drive space for backing up your much-needed files, you can still grab a recordable CD and create a “Live CD” to boot from. If that’s the case, skip the section about making a USB stick and head right to the “Boot Up and Get Started” section.
- A working Windows computer with a decent net connection Because you’ll need to download a 700 MB file to install onto your USB stick and a 4.3MB application to make it work. That application, though, doesn’t have to be installed, so you can easily clean up after yourself if you’re using a friend’s computer.
Alternate: Mac options: You can create an Ubuntu USB stick from a Mac, but it requires both tricky, theoretically harmful Terminal commands and administrator access. If that’s not your thing, you can simply burn a live CD from a Mac.
Make Your Live CD or USB Stick
Turn on your working Windows computer, make sure it’s connected to the internet and open up a browser. Head to UNetbootin’s home page. Click on the Windows icon at the top to download the latest version of UNetbootin — here’s a direct link for those following this guide on their monitor.
Once you’ve downloaded the file (unetbootin-windows-latest.exe), find it and double-click it. Windows will likely confirm that you want to do that, and you should say it’s “OK”. You’ll see this when UNetbootin opens:
What UNetbootin was made to do was automate the process of downloading an Ubuntu CD image, convert it for your USB thumb drive, find that drive and install that image on there, without you having to do much of anything. It does this job well, and doesn’t make you worry about accidentally wiping out some other drive. Still, when you’re about to run UNetbootin, you should make sure no other USB drives are plugged in, except the one you want to turn into a system rescue stick. That said, make sure your USB stick is plugged in, and soldier on.
Click on the drop-down menu in the “Distribution” category at the top, which should also have a filled-in point to the left to indicate it’s selected. Scroll down in that menu and click on “Ubuntu”. To the right of that menu, there’s another where you can choose the version of Ubuntu you want to download. At the time of this post, 9.10 Desktop is the latest stable version of Ubuntu that’s released, just above “Daily Build” options for 10.04. In any case, you should select the “Desktop” version that’s highest in number, without choosing a “Daily Build” that will likely have missing features or unfamiliar aspects. With that distribution and version selected, UNetbootin will get to work downloading, right after we’ve confirmed the USB drive and hit OK.
Alternate option: BitTorrent: If you’re savvy in the ways of torrent downloading, you can likely get a faster download, and relieve Ubuntu’s servers, by grabbing a desktkop ISO file over an official torrent, then setting UNetbootin to use that ISO file by selecting the radio button next to “Disk Image”, hitting the “…”/browse button to the right of that option, and pointing at the ISO file when it’s finished downloading.
Before you click OK and let UNetbootin set up your USB drive, triple-check that it knows which drive to transform. You’ll see which drive it wants to format to the right of “Drive:” at the bottom of UNetbootin’s window. Hit your Start menu, click Computer in the right-hand menu, and ensure that the letter your computer has given your temporary USB drive the same letter that UNetbootin wants to use. If the two are matched up, you can head back to UNetbootin and click OK.
Nine times out of 10, UNetbootin won’t need any help or spit any errors. If it does, it’s likely because a download connection isn’t available, the file that did download became corrupted, or your USB drive has a quirky boot/format problem. I’ve covered at least one common fix for USB stick booting issues under the “Fix booting problems” header in a previous Linux-on-USB feature. If your error falls outside of that, try searching out the specific text in the error message on Google.
Once it’s done, UNetbootin will ask you to restart your system. You don’t really need to do that — you want to save your non-booting or crippled computer, not this one.
Boot Up and Set Up Ubuntu
Assuming all went well with UNetbootin’s USB formatting, you can pull out the USB stick (or CD-R) from the working computer, load it into the busted computer and fire it up. If you’re lucky, the system was set up to automatically look for bootable USB devices and load them up, and you’ll see a screen that asks you, in old-school, lo-res computer graphics, if you want to boot “Default” or otherwise. Go ahead and hit Enter, and you’ll start booting into the Ubuntu desktop.
Nothing happening? Does your system just roll right into its busted Windows desktop? You’ll likely need to head into your BIOS settings and ensure that USB booting is enabled and/or “ranked” above the hard drive as a boot option. When your computer boots up, there will likely be text on the screen stating that hitting F2, the Delete key, or another button will let you enter “system setup”, BIOS or something similar. Hit that key when you first boot up, dig around in the menus and change your setup so that your computer searches out USB drives before heading to the hard drive.
Your system should boot into an Ubuntu desktop, where you’ll see one or two icons, two toolbars and not much else. The first thing you want to do is give Ubuntu an internet connection, so we can grab programs and files we need for our fixes. If you’re using a physical Ethernet cable, or even most 3G modems, ensure they are plugged into your laptop or desktop, and you should be good to go. If you’re using a wireless network, click on the tower/broadcast-looking icon in the upper-right corner.
Choose your Wi-Fi network, enter your password, if there is one, and you should see your system connect. If you’ve got a hidden network that doesn’t broadcast its name, there’s an option for accessing that, too, below your neighbour’s Wi-Fi names.
One last thing you must do before venturing forth is tell Ubuntu that it’s OK to download applications that aren’t entirely “free” in the software/copyright sense. Annoying, yes, but that’s how a free desktop works. Click on the System menu in the upper-left corner, mouse down to the Administration section, and then mouse over and down to the “Software Sources” option.
When it opens up, you’ll see that all the options in the first tab, Software Sources, aren’t checked. Go ahead and check them, then hit the Close button. You’ll be prompted to Reload your sources, so go ahead and hit the button to do so. Ubuntu now has access to a lot more software, including some applications we’ll want access to.
Now you’re ready to get started backing up, scanning, freeing up space and resizing your Windows installation.
Make Your Fixes
Scan and fix viruses: Ubuntu doesn’t have a built-in tool for scanning Windows drives for viruses — and why would it, really? — but they are available for installing. Since we’re running a live session of Ubuntu, “installing” just means downloading and saving to temporary space on our USB drive, leaving your Windows drive untouched, and preventing viruses from interfering with the scan-and-fix process.
Hit the Apply button after confirming that you want to install clamtk and all its “dependencies”. Close down Synaptic when it’s done installing, then head to your Applications menu in the upper-right corner of your Ubuntu desktop. Mouse down to the System Tools menu, where Clam should appear as an option. When it first starts, it will ask you how you want to apply signature updates — ignore the complexity of all that text, hit “Single User”, then hit Quit to move on.
When Clam loads, you’ll see options for scanning a File or Directory. Check the box to the left of the “Recursive” option, so that Clam will dig into all the sub-folders of your Windows drive. Now hit the Directory button. In the file chooser that pops up, look for your Windows system in the left-hand sidebar and click it. If you see your familiar Windows folders in the right-hand pane, you’ve got the right one. Hit “Open”, and, honestly, expect your system to hang for a bit.
Your system will hang because, basically, an operating system running off a thumb drive is using all its might to scan your entire Windows hard drive space and figure out what needs to be scanned. The freeze-out and lag should only last a few minutes on a modern system — if you see error messages, or nothing’s happened for 20 minutes, you might have to give it another go or try a different anti-virus app — the gHacks blog has a few recommendations, including Avira. Otherwise, you can make yourself a sandwich and probably crack a beer or soft drink, as Clam runs through your Windows files and checks for viruses. As mentioned above, it might not always be able to fix or properly quarantine your files, but you’ll at least know exactly which virus you’re dealing with, and can Google steps on fixing it manually — right from Ubuntu, actually.
sudo chntpw SAM
If you’re looking to change Samantha’s password instead, type something like:
sudo chntpw -u Samantha SAM
You’ll see some options you can type in, from 1-4, but you’ll generally want to stick with “clearing” the password, then changing it when you head back into Windows. It’s been reported to work with XP and Vista, and I tested it out on Windows 7 and had success clearing a standard user’s password.
Shrink or create new partitions: Gina’s already covered the ins and outs of GParted, which you can get to in your live Ubuntu system by hitting up the System menu, the Administration option and then clicking “Partition Editor”. Adam’s also shown his GParted skills, using a similar live CD, in his guide to dual-booting Windows 7 with XP or Vista. Don’t commit anything you’re not sure of, but know that you can pull off most anything you need from GParted.
All done? Simply shut down your system from the “ubuntu” user menu in the upper-right corner. Nothing was actually touched on your system, unless you specifically deleted or changed files, and when you reboot, you’ll have a chance to get reacquainted with your hopefully fixed system. Remember to remove your USB drive from its port before rebooting.
Those are our tips on what can be done with a live Ubuntu stick. Got your own? We’d love to hear them in the comments.