Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, August 25, 2011

Clone a failing Windows hard disk with ddrescue on Ubuntu Rescue Remix

Scenario: The hard disk is starting to throw "bad block" errors. Windows still works/boots, but who knows for how much longer. And you don't want to have to go through the time and expense of rescuing the data from the failing disk, installing Windows and all your applications on a new hard disk, and re-loading the data on the new hard disk.

Solution: You want to use a free Linux tool called Gnu ddrescue to clone the failing drive to the replacement drive.  This is one of the tools available on the Ubuntu Rescue Remix.  For more info on this tool, start here: http://www.gnu.org/s/ddrescue/ddrescue.html

If you Google ddrescue, you'll find lots of info on how to use ddrescue to recover data.  However, there's not a lot on how to move a Windows load from a failing drive to a new drive.  For example, one mistake that I've made is imaging the failing drive instead of cloning it.  The image file is not easily restored and bootable on the new drive. 

Here's what you need to do.  Idiots beware, this is not an idiot-proof guide.  Important but obvious steps are omitted.  Feel free to embellish or enumerate such steps in your comments.
  1. Download Ubuntu Rescue Remix here: http://ubuntu-rescue-remix.org/Download and burn it to a CD.
  2. Get a hard disk to replace the failing drive that is the same size or larger.
  3. Connect the new disk to the machine with the failing disk.  A fast connection (eSATA) is better than a slow connection (USB).
  4. Boot the machine to the Ubuntu Rescue Remix CD.  This will get you to a command-line prompt; there is no GUI.
  5. At the command prompt, key in the command:
     .  This command will identify the disks as /dev/sda and /dev/sdb (or perhaps /dev/hda and /dev/hdb, or perhaps you have more than 2 drives connected, ...).  This command will list the size and make of each drive, which should allow you to determine which drive designation is the source/failing drive and which is the target/replacement drive. You need to know this without ambiguity; it is easier if the target is larger than the source.  
  6. For the sake of example, let's assume that the source drive designation is determined to be /dev/sda and the target drive designation is /dev/sdb.  Your situation may be different.  To clone the source drive, at the command prompt, key in the command:

    That's it.  Depending on the size of the source drive and the number of bad blocks, it will take time to clone the drive.
  7. When ddrescue is done, swap out the target disk for the source disk in the PC, and fire it up.  It should boot and work as well as the source disk, but without the looming prospect of imminent disk failure.
  8. If you have used a larger target disk to clone the source, you may want to expand the partition to use the whole, larger disk.  GParted will do the trick.  Unfortuantely, this tool is not on the Ubuntu Rescue Remix CD.  Parted is, but it will not resize NTFS partitions.  You can find GParted on the Ubuntu live CD.  You can download it here:  http://www.ubuntu.com/download/ubuntu/download.  Instructions for using GParted to resize a disk are here: http://gparted.sourceforge.net/larry/resize/resizing.htm.

Monday, May 14, 2007

4 Steps to Revive Your PC

Part 2 of "How to give an old PC a new lease on life." Click here for Part 1, "Questions and Answers."

Steps:
  1. Back it up
  2. Clean it up
  3. Clean it out
  4. Reload it (optional)
Step 1. Back it up
  • Your PC is going to fail one day, no matter what you do to keep it going. You've been lucky so far if it hasn't failed yet. The first step is to back up your data, documents, photos, music and other personal files. And implement an automated backup plan so that when your machine fails you will not lose anything important.

  • Backing up is something that everybody knows that they should do but almost nobody does it. Do it now. You can get online, automated backup for little or no cost. Stop procrastinating and do it.

Step 2. Clean it up
  • To improve your old PC's performance:
    1. Remove any malicious software (malware)
    2. Uninstall old applications you don't use
    3. Get applications you don't use often out of the System Tray
    4. Delete files you don't need
    5. Defragment your hard drive

  • A. Remove any malware : Malware (viruses, adware and spyware) can hurt you in different ways. It can take up RAM, it can monopolize the CPU, it can clog the hard disk with files and messages and/or it can hijack your applications and have them behave oddly. To improve your old machine's performance, you want to remove any and all malware.

  • If you have an "anti-virus" program running, that's good; most of the commercial anti-virus programs (Norton, McAfee, AVG, et al.) provide malware protection.

  • My recommendation for keeping a system clean of malware is to have an anti-virus program running all the time. Then, since no such program will be 100% effective (because black-hat hackers are resourceful and computer owners can be their own worst enemy), periodically scan your computer using products like Ad-Aware and Spybot Search and Destroy. Go to Download.com and see what products are available and which are popular.

  • B. Uninstall old applications you don't use: Delete old applications that you don't use because they are using up disk space. And, worse, they may be automatically loaded into RAM every time you boot up, costing you precious RAM. There are two ways to delete applications. First, go to the Start/Programs menu and see if there is a folder or program group for this application. Sometimes there is an Uninstall program in the group that you can use. Alternatively, you can go to the Control Panel and select Add/Remove Programs and select the program and remove it.

  • C. Get applications you don't use often out of the System Tray: Windows' System Tray is on the right end of the bottom task bar. It holds shortcuts to some of the programs that load or run when your PC boots. To improve performance of your old machine, stop applications you don't need from being automatically loaded.

  • By default, many applications install in such a way that they are loaded into RAM every time the computer is powered up. That way the application launches more quickly whenever it is selected from the Start menu or icon on the desktop or bottom task bar. In many instances, the improvement in launch time is not worth the cost of reduced overall system performance -- particularly if an application eats a lot of RAM and is rarely used.

  • Identifying applications that load on startup and stopping them is not always easy. For example, malware usually does its best to hide itself and prevent you from stopping and removing it. At the other end of the spectrum are programs that announce themselves when they load by placing an icon in the System Tray, and you can click on the icon and configure the app to NOT LOAD on start up.

  • So, the System Tray is the first place to look. If you see any applications there that you don't need to have loaded all the time, try and stop them. Usually this means starting the applications and going into the preferences or configuration options and de-selecting "Load on startup" (or something like that). If that doesn't work, you can try deleting the application and reinstalling it to see if you get to choose to have it not load automatically.

  • If you know what you are doing, you may also be able to find and stop applications that are running automatically by checking the Control Panel/Administrative Tools/Services. The problem with this is that there is often not a clear mapping between services and applications you don't need.

  • D. Delete files you don't need: To free up disk space on an old PC, it is a good idea to archive and remove any old personal files that you do not regularly access. Put them on a network drive or on a CD or DVD. You should also delete old temporary files (.tmp), old backup files (.bak), old log files (.log), and old application downloads (.zip and .exe). You can generally reclaim disk space by emptying your browser cache and your Recycle Bin.

  • E. Defragment your hard disk: Over time, as you work with your computer and the hard disk fills up, files on the hard disk become increasingly fragmented. One file may be stored across many different sectors of the disk, causing disk read and write operations to slow down. The older and smaller your hard disk, the more likely fragmentation is to cause performance problems.

  • Defragmenting the hard disk is the last step in cleaning up your PC, after you have reclaimed as much free disk space as you can. Windows has a utility for defragmenting your hard disk. There are also tools available at Download.com.

Step 3: Clean it out
  • In an old PC, dust and dirt can block the machine's cooling systems, causing the processor and disk drive to overheat. If the components get too hot, to avoid damage, PCs are designed to slow down to reduce power consumption and lower internal temperatures.

  • How dirty can it get inside an old machine? It can get pretty dirty inside a PC, especially so if it's sitting on the floor in the basement or on a shag carpet. One machine that I saw smelled like an ash tray and inside looked like a diseased lung. Cigarette tar and dust mixed together and coated everything. Another machine I saw had been through a flood and the insides were coated with silt. Another machine was brought in for service and it was infested with cockroaches. One woman put a chocolate bar on her laptop, and it melted and ran inside. The chocolate ended up everywhere inside the machine...

  • Open up the case to clean out your old PC. Check the air intake filters and blow, vacuum or rinse them clean. Blow the dust out of the fans and cooling fins on the heat sink. Make sure all the fans are working. Replace any that are not.

Step 4: Reload it
  • You've done Steps 1-3, but you are still not happy with the performance of your old PC. Perhaps malware has hosed your operating system beyond recovery. Then you might want to think about reloading Windows. This assumes that you have a recovery CD with all the drivers you need (many PCs come with a recovery CD). It also assumes that you have the original installation media and keys for the applications you have installed. And you've backed up your data files.

  • If you've got all that, then you can reformat your hard disk, reload Windows from your recovery CD, reinstall your applications, download and install all the updates and patches to Windows and your applications and restore your data. It is not a quick and easy job.

  • How about upgrading to Windows Vista? This is probably not a good idea. So far, people are saying that XP is better than Vista. And unless you've got a “Vista-Ready” PC purchased a few months ago, it is not going to be a “cheap and easy” process to upgrade. My advice is to pass on Vista until you are ready to buy a new PC which has it loaded and once the problems with Vista are resolved.

  • Or, maybe your performance problems are not only due to the fact that your hardware is old. Your operating system and your applications are obsolete too. Microsoft is no longer supporting and patching Windows 98 for example. Norton et al. don't provide virus updates for your old anti-virus program. Websites want you to have browser capabilities your browser doesn't have.

  • In this case you have two options, throw the PC away, or do something interesting and fun. Rather than throwing the old beast away, you could try and install Ubuntu Linux on it. Ubuntu is a distribution of the Linux operating system that is free and easy to install. It has the potential to take your old machine and transform it into a usable, completely modern (software-wise) PC. I have installed Ubuntu on a half-dozen old PCs, and it worked like a charm. And if it doesn't just work, effortlessly, recognizing the hardware and installing the drivers, I wouldn't waste time with it. If it does work, you ought to max out the RAM to improve performance. If it doesn't work, throw the old thing out.

So, there you have it, 4 steps to revive your old PC. We are not talking about transforming it into something that can keep up with a new machine with the latest processor and lots of RAM. But you don't need all that speed and capability to read email, do word processing and surf the web, do you? These steps will help your PC to do these things better, and work more smoothly for you and with the people you communicate with and the web sites you visit.

Thursday, April 12, 2007

Recommendation: Macintosh

I used to be an Apple computer user and a Macintosh man. But, I haven't had one for many years.

For a long while I avoided Macs because I thought that Apple was going to disappear, like hundreds of other computer manufacturers have. I was afraid I'd be stuck with orphan technology, and I'd lose my work and my data.

With the success of the iPod, Apple's future is secure for the time being. Now, I'm thinking that Apple will abandon Macs and focus instead on iPods, iPhones, Apple TV, et al. But Mac PCs have become more like their competitors over the years, and there would probably not be any difficulty migrating work and data files to another platform. So that's no reason not to buy a Mac now.

Historically, Macs were significantly more expensive than Windows PCs. However, Mac users reportedly have fewer problems than Windows owners. So, from a total- cost- of- ownership perspective, Macs are probably cheaper than Windows PCs, even if they are more expensive out of the box.

The main reason that people have fewer problems with Macs is that there are fewer hardware and software choices available for Macs than there are for Windows PCs. Less crap installed and connected to the Mac equals fewer problems. Unfortunately for Apple, many people like me want all that crap. If you are satisfied with the crap that you can get for a Mac, then a Mac may be right for you.

Macs have long been fashionable and hip in certain circles. I do not travel in those circles. I thought the iMacs were pretty when they came out, but the idea of a monitor married to a CPU never appealed to me. If the look and feel of a Mac appeals to you, go for it.

Because of increasing returns to scale, Microsoft was able to corner its market and act in a predatory and monopolistic fashion, without proper regard for the interests of its customers. Now Apple has had similar success in the online music market. It is likely that Apple will be demonized as a monopolist one day, tarnishing the holier- than- thou image it has today in some quarters. But again, that is no reason not to buy a Mac today.

If you are looking to buy a PC for the office, and your company is a Windows shop, as most companies are, then you are probably better off getting a Windows PC at work. You probably don't have any choice in the matter.

If you want to buy a computer for yourself or someone in your family, then you should consider a Mac. Does it have the software, games and peripherals you want/need? When something goes wrong, will you be able to get support somewhere? Given the "right" answers to these questions, I recommend that you get a Mac.

Monday, April 02, 2007

Episode 6: Printers

The continuing adventures of one man's attempt to migrate his desktop PC from MS Windows to Ubuntu/Linux.

Setting up my Ubuntu machine to print was a step I was dreading. Over many years I have spent long hours dealing with the myriad of problems that printing spawns. And as my regular readers know, I don't normally approve of printing anyway (see Friends Don't Let Friends Print).

Notwithstanding my dread and hostility, no computer is complete without one or more printers installed and working. There are situations when even I need to print out something.

To date, I've installed 4 different printers on different Ubuntu Edgy machines. These were all network printers. One was an HP LaserJet wired directly to the network. Two were HP OfficeJets shared by Windows PCs, and one was a Samsung laser shared by a Windows PC. One network was a peer-to-peer network and the others were Microsoft Active Directory networks.

So, how hard is it to set printers up on Ubuntu? I am happy to report that it is not hard. In fact, it is so easy that I made it more difficult for myself than I had to because I said to myself, "It can't be that easy."

The information you need to install your specific printer is available on the Internet. Google it. Start with the simplest pathway you can find; resist the impulse to make it difficult.

If you have any trouble, stop. The problem is either a lack of drivers for your model printer (complain to the manufacturer and get another/different printer -- they are cheap) or with you (get another self(?)). The problem is not Ubuntu. So, don't waste time agonizing about the solution. There is an easy one available.



Episodes: 1, 2, 3, 4, 5, 6.

Tuesday, February 06, 2007

Episode 3: Sound Idiosyncrasies Abound

The continuing adventures of one man's attempt to migrate his desktop PC from MS Windows to Ubuntu/Linux.

On boot with the USB headset plugged in, there is a drum-tap sound that plays through the speakers when the "username" login screen appears. After logging in, the Ubuntu jingle plays through the headset. Strange...

Putting an audio CD in the CD-RW drive sets an "audio CD" icon on the desktop. Double clicking the icon launches a music player, but I hear the music through the speakers. Damn, the boss will know I'm hardly working, not working hard!
  • Checking System/Preferences/Sound reveals that the sound card (SB Live!) is the default sound card. Selecting the USB Headset and rebooting, the CD music plays through the headset. Problem solved.
    • However, rechecking the System/Preferences/Sound reveals that the sound card (SB Live!) is again the default sound card. I don't know why the music is coming from the headset now when it came from the speakers before.
Controlling the volume in the headset for the CD I am playing is problematic.
  • A single click on the "Master" volume control on the Ubuntu panel displays a slider control that does ABSOLUTELY NOTHING.
    • This behavior of this Master slider control holds true if I am playing the CD using either Rhythmbox or Sound Juicer.
  • In the player window, there is a control that WORKS! It does allow you to increase or decrease the overall volume in the headset.
    • This behavior of the player volume control holds true if I am playing the CD using either Rhythmbox or Sound Juicer.
But how do I control the balance and tone of the music played by Rhythmbox or Sound Juicer in the headset?
  • Trial and error disclosed that a double-click on the Master volume control on the Ubuntu panel launches an "Alsa Mixer" volume control window for the USB headset. Here I can adjust the sound volume. I can also change the balance by "unlocking the channels."
    • BTW, somewhere along the trial-and-error line I added the Alsa Mixer to the system using Add/Remove Applications.
    • I haven't found how to change sound tone yet.
I continue to believe that the issues I am having with sound are related to the sound card driver. Sound Blaster sound cards used by Dell may not be the same as the versions used by other system builders. The card that Dell used in my machine may require a different driver, one that works better than the one that Ubuntu installed for this card!?

Episodes: 1, 2, 3, 4, 5, 6.

Monday, January 22, 2007

Bye, Ma!

Episode 1

This is a story of leaving home. I am saying good-bye to Ma Microsoft on my desktop, installing Ubuntu on my PC instead of Windows.

What fate awaits me as I struggle to adjust to life without Ma? Will I be able to cope without Microsoft Office? Will I be able to see my Exchange emailbox? Will I be able to use file and print sharing services on the network? Or will I give up in frustration, turn away from Ubuntu and go back to Windows?

Over the years, I have installed different distros of Linux on different PCs. These PCs then went into service as a firewall/router, a database server, a file server, and a web server. These were all command-line or non-GUI (graphical user interface) instances of Linux.

Last year, I installed Debian with KDE and Gnome GUI interfaces on an old laptop. I use the laptop to make presentations. It is a great attention grabber to show a non-Windows desktop to business audiences accustomed to Windows and the occasional Mac desktops. Talk about tech cred!

Recently, the 86-year-old patriarch of my family, AKA Grandpa, complained that his computer was running slow. His computer was a 9-year-old, Windows 98 machine with a 366 Mhz processor and 64 megs of RAM. My brother donated a 3-year-old machine that was recently retired from service, and I loaded Ubuntu on it for Grandpa. He's made the transition to his new setup like a champ! So, I figure if he can do it, I can too.

Ubuntu has greatly simplified the installation of Linux. Gone are all the questions about the refresh rate of your monitor, the chipset of your graphics card, the size and number of your swap disk and other questions that left me scratching my head when I installed Linux in the past. It detected all my hardware, and it got and installed the right drivers. Amazing!

Tips & Tricks: When I moved my PC from the bench where I did the install to my desktop, I discovered that the Linksys USB WiFi adapter I planned to use did not work. There is no Linux driver for it. I didn't want to use the Window's driver with ndiswrapper -- too much work for a cheap piece of hardware, so I swapped the USB adapter for the Linksys "Wireless Gaming Adapter" my son uses with his XBOX. This Wireless Gaming Adapter is a bridge device that requires no drivers. Problem solved. FYI, the 802.11-b version of the Wireless Gaming Adapter sells for less than $20 on Ebay.

In future episodes I will let you know how the migration from Windows to Ubuntu is going. Will I be able to survive or will I come running home to Ma with my tail between my legs? Stay tuned.

Only free software was used in the creation, storage and delivery of this message.

Episodes: 1, 2, 3, 4, 5, 6.