Maintaining Hard Drives

January 7, 2010

Hard drives are complex mechanical and electrical devices. With platters spinning at thousands of rotations per minute, they also generate heat and vibration. All of these factors make hard drives susceptible to failure.

Hard drive maintenance can be broken down into two distinct functions: checking the disk occasionally for failed clusters and keeping data organized on the drive so that it can be accessed quickly.

Individual clusters on hard drives sometimes go bad. There’s nothing you can do to prevent this from happening, so it’s important that you check occasionally for bad clusters on drives. The tools used to perform this checking are generally called error-checking utilities, although the terms for two older Microsoft tools – ScanDisk and CHKDSK (pronounced “CheckDisk”) – are often used. Microsoft calls the tool Error-Checking in Windows XP. Whatever the name of the utility, each does the same job: when the tool finds bad clusters, it puts the electronic equivalent of orange cones around them so that the system won’t try to place data in those bad clusters.
Most error checking tools do far more than just check for bad clusters. They go through all of the drive’s filenames, looking for invalid names and attempting to fix them. They look for clusters that have no filenames associated with them (these are known as lost chains) and erase them. From time to time, the underlying links between parent and child folders are lost, so a good error-checking tool checks every parent and child folder. With a folder such as C:\TEST\DATA, for example, they make sure that the folder DATA is properly associated with its parent folder, and that C:\TEST is properly associated with its child folder, C:\TEST\DATA.
To access error-checking on a Windows 2000 or Windows XP system, open My Computer, right-click the drive you want to check, and choose Properties to open the drive’s Properties dialog box. Select the tools tab and click the Check Now button to display the Check Disk Dialog box, which has two options. Check the box next to Automatically Fix File System Errors, but save the option to Scan For and Attempt Recovery of Bad Sectors  for times when you actually suspect a problem, because it takes a while on bigger hard drives.
Now that you know how to run Error-Checking, the next question is often, “How often do I run it?” A reasonable maintenance plan would include running it about once a week. Error-Checking is fast (unless you use the Scan For and Attempt Recovery of Bad Sectors option), and it’s a great tool for keeping your system in top shape.

Fragmentation of clusters can make your drive access times increase dramatically. It’s a good idea to defragment – or defrag – your drives as part of monthly maintenance. You access the defrag tool that runs with Windows 2000, XP, and Vista, called Disk Defragmenter, the same way you access Error-Checking – right-click a drive in My Computer and choose Properties – except you click the Defragment Now button on the Tools tab to open the Defragmenter.
Defragmentation is interesting to watch – once. From then on, schedule it to run late at night. You should defragment your drives about once a month, although you could run it every week, and if you run it every night, it takes only a few minutes. The longer you go between defrags, the longer it takes. If you don’t run Disk Defragmenter, your system will run slower. If you don’t run Error-Checking, you may lose data.

Disk Cleanup
Did you know that the average hard drive is full of trash? Not the junk you intentionally put in your hard drive like the 23,000 e-mail messages that you refuse to delete from your e-mail program. This kind of trash is all the files that you never see that Windows keeps for you. Here’s a few examples:

Files in the Recycle Bin
When you delete a file, it isn’t really deleted. It’s placed in the Recycle Bin in case you decide you need the file later.

Temporary Internet Files
When you go to a Website, Windows keeps copies of the graphics and other items so that the page will load more quickly the next time you access the page. You can see these files by opening the Internet Options applet on the Control Panel.

Downloaded Program Files
Your system always keeps a copy of any Java or ActiveX applets that it downloads. You can see these in the Internet Options applet. You’ll generally find only a few tiny files here.

Temporary Files
Many applications create temporary files that are supposed to be deleted when the application is closed. For one reason or another, these temporary files sometimes aren’t deleted. The location of these files varies with the version of Windows, but they always reside in a folder called TEMP.

Every hard drive will eventually become filled with lots of unnecessary trash. All versions of Windows tend to act erratically when the drives run out of unused space. Fortunately, all versions of Windows have a powerful tool called Disk Cleanup. You can access Disk Cleanup in all versions of Windows by choosing Start | Programs | Accessories | System Tools | Disk Cleanup.

Disk Cleanup gets rid of the four types of files just described (and a few others). Run Disk Cleanup once a month or so to keep plenty of space available on your hard drive.


Flashing the ROM

December 29, 2009

Flash ROM chips can be reprogrammed to update their contents. With Flash ROM, when you need to update your system BIOS to add support for a new technology, you can simply run a command-line program, combined with an updated file, and voila, you’ve got a new, updated BIOS! Different BIOS makers use slightly different processes for flashing the BIOS, but in general, you must boot from a floppy diskette and then run the relevant updating command from the A:\> prompt. This command shows how simple it can be: A:\> aw athxpt2.bin

Some motherboard makers even provide Windows-based flash ROM update utilities that will check the Internet for updates and download them for you to install. Most of these utilities will also enable you to backup your current BIOS so you can return to it if the updated version causes trouble. Without a good backup, you could end up throwing away your motherboard if a flash BIOS update goes wrong, so you should always make one! Finally, one final piece of advice: Don’t update your BIOS unless you have a compelling reason to do so!


Clearing the CMOS

December 29, 2009

All technicians invariably do things within the CMOS that they want to undo, but sometimes simply making a change in CMOS prevents you from getting back to the CMOS Setup Utility to make the change back. A great example of this is when someone sets a CMOS password and then magically forgets the password. If you ever run into a system with an unknown CMOS password, you’ll need to erase the CMOS and then reset everything. All motherboards have a clear CMOS jumper somewhere on the motherboard. Check your motherboard’s documentation for the location of this jumper.

To clear the CMOS, turn off the PC. Then locate one of those tiny little plastic pieces (officially called a shunt) and place it over the two jumper wires for a moment. Next, restart the PC and immediately go into the CMOS and restore the settings you need.


Building Your Own Server

November 12, 2009

When it comes to building a server, many people hesitate. When building a server, there are a lot of choices to make, and equipment is more expensive than equipment for a PC, but the results can be very satisfying.

If you’re considering building your own server, you shouldn’t do it because you intend to save a lot of money – you probably won’t. You often cannot build a PC for less than you’d expect to spend on a major first-tier OEM, such as for a Dell or HP. Components are a commodity, and OEMs buy them by the container load. Best you can hope for is to approach their pricing with your costs. Servers, on the other hand, tend to have higher markups. So it is possible to save some money building your own server. But, again, saving money is not the best reason to build your own server.

The best reason for building your own server is that you can select your own components in a way that buying someone else’s system doesn’t allow for. When you build your own server, you have more control over the setup of the system, and you’re more likely to know what to do or replace when things go wrong. A home-built server is generally rather flexible to configure because you use industry-standard parts and not some proprietary type of casing, memory, or motherboard that will block your upgrade path in the future. Building your own server often results in equipment that has a longer duty cycle because it’s more upgradable.

Building your own server makes sense for another reason: Although system builders make their servers competitvely priced at purchase time, everything else they sell you – from service to upgrade parts and even their shipping – is priced at whatever the market will bear.

Server Purposes and Form Factors

If you have decided to build a server, the first place to start is to determining the intended purpose of the server. That purpose should guide many of your selections. A good rule of thumb when building any system is to try to build a balanced system but oversize that system for any task that is the primary function of the server. A balanced system is one where each subsystem of the server is powerful enough to allow you to avoid bottlenecks. If the purpose of the server is to serve files, then the I/O subsystem needs to be emphasized.

Regarding a balanced system – It’s impossible, or at least too costly, to size subsystems so they never present a bottleneck. When a system gets a job that requires a lot of processing, chances are that the CPU is going to be 100% utilized until the job is near completion. The goal is to allow acceptable performance in those circumstances as well as to maintain a good average CPU utilization rate. That’s one advantage servers offer. If you find that your CPU utilization goes up, if you’ve selected the right motherboard, you can upgrade your processor or add another processor. What typically separates a server from either a workstation or PC is that servers are built with more upgrade options.

Realistically, there are only a few different types of servers that are practical for most people to build themselves:

A basic server, which is really a souped-up PC.
A workgroup server, featuring dual or four-way CPU boards.
An SMB or “Small or Medium Business” server, which is typically a dual-processor system but built with a lower-performing I/O system.

It’s possible to build a thin form factor system using readily available components for rack-mounted units. Two types of servers are difficult to build, given the current retail model:

SMP systems with more than four processors on the motherboard.
Blade systems.

Neither of these two types of system is standardized enough and in great enough demand from the average system builder that companies stock the parts needed to build them. If you intend to build either a large SMP or blade system, you will find yourself spending time talking to the original parts manufacturers themselves. Chances are that for a single board or limited number of boards, they aren’t going to be much help to you.

Server Components

A server should include the following:

Two- or four-way SMP support – It’s a good idea to have at least a two-CPU system, even if you choose to populate just one of the sockets. Having additional CPU sockets allows your system to grow over time.

A high-performance server chipset – The motherboard chipset is of central importance to the overall performance of your system.

Large memory capacity and I/O bandwidth – The amount of memory determines the number of clients you can support, as does your I/O bus.

High-performance network interfaces – Without a strong network interface, you create an unnecessary bottleneck getting data in and out of your server.

Management features – Because a server is supposed to be up and running reliably, it’s important to be able to view what’s happening on the system and make changes both locally and remotely.

A server operating system – You don’t want to limit the number of connections or any other properties of your system because you’ve used a desktop- or workstation-oriented operating system. Your equipment should be selected with the operating system in mind.

The above list represents a checklist for selecting your basic server components. They’re necessary to create a server, but aren’t probably sufficient for most purposes. Servers are differentiated from workstations or desktops through the addition of these features:

Redundant components that allow for graceful failover – Redundant components used are power supplies, fans, and hard drives.

Hot-swappable components – The most important hot-swappable components are disks, but it’s valuable to be able to swap out other components.

High-performance and high-capacity storage – The purpose of your server determines the amount of storage (and memory) that you need.

Intelligent RAID arrays that allow for advanced volume management – RAID arrays make so many important volume operations possible that they are really a requirement for most servers these days.

All these requirements speak to the fundamental differences between workstations/desktops and servers. Servers must be much more dependable, must be higher performing, and must be flexible and have room to grow. Servers require a significantly higher investment than standard PCs, so you want to maximize your investment in them by selecting components that support the features described in the above section.

Assembling a Server

After you’ve selected your components, the next step is to assemble the system. In most respects, there isn’t much difference between assembling a server and assembling a PC. There are, however, a few critical differences, so in the section below, I discuss the construction of a hypothetical server, step-by-step.

Installing Core Components

First, let’s take a walk through the casing assembly, assuming you bought a case with no pre-assembled components already installed. Begin as following:

1. On a good work surface with adequate lighting, open the case and remove any included screws, mounting brackets, disk cages, and other components that you will be populating with parts.

2. Take a good look at your case to familarize yourself with the design and determine some fundamental issues, such as power supply placement, and number of fans needed and what type.

3. Install the power supply, and don’t skimp on it. Your power supply should be sufficient to run all your components well below the stated operating limit and should have good thermal properties as well as run quietly. You can pay a lot for a server power supply, but it’s money well spent.

4. Install all the fans. The goal of cooling your system should be to create airflow through the case so that it dissipates heat. A lot of system builders position their fans so that intake is from the front of the case, and exhaust is out the back. Some units, such as drive cages, may require their own fans.

5. Install the motherboard as well as any backplane your system may have.

6. Install your CPU and then attach your cooler or heat sink and plug it into your motherboard’s CPU connector. Be sure to either use an ESD wrist strap to prevent electrostatic discharge or ground yourself properly.

7. Attach your case’s front panel connections (power, power LED, restart, HD LED and speaker) to the motherboard’s connectors. Visually inspect the connections up close to verify they’re on the correct posts and the polarities are correct.

8. Insert one stick of RAM into your system, on the slot closest to the CPU.

9. If your motherboard doesn’t have a video chipset built in, install your video card into the appropriate slot: AGP, PCI-x, etc.

10. Attach a keyboard, video monitor and mouse or attach the appropriate leads to your KVM switch.

11. Boot up your system, verify it proceeds to the BIOS, and stops at the point it can’t find a boot device.

It’s a good idea to test the basic system at step 11, because it becomes increasingly difficult to diagnose problems later on, when there are more potential causes. At this point, if there are issues, you can swap the memory, change RAM slots, swapping the CPU or video board, changing the power supply, and checking your connections. In your initial boot to the BIOS, you can determine whether your power LED is functioning, whether your restart button works, and whether you’re getting beep sounds.

Installing the Remaining Components

After you’ve installed the core components, you can add your peripheral  devices. It’s a good general rule to add 2-3 devices at a time and then test the boot process to ensure the additions aren’t causing problems.  Below are some steps you need to follow, but the order isn’t as important as the previous list:

1. Add the remaining memory. Be sure to test your system again once all modules are installed to check for any potential problems.

2. (Optional) Install your floppy drive. Be sure the red wire in the connection is closest to the floppy power connector (not all floppy drives have this requirement).

3. Install any optical drives and connect the ATA/IDE, SATA or USB connection, the audio connection and the power connection to it.

4. In you’re installing a USB flash storage reader or any other USB storage device, install it, but do not connect it to your USB bus. The reason you don’t want to do this is to avoid your operating system from grabbing a set of drive labels for these devices until you’re done assigning devices to your more common drives.

5. Install any PCI, PCI-x or PCI-Express boards into their correct slots and connect any supported devices (such as hard drives) to those boards.

6. Test your system to make sure all devices are recognized and renumerated by the BIOS.

At this point, your server is fully populated and ready for configuration. If you’re using hardware RAID, you’ll need to follow the steps below:

1. During the boot process, go into the RAID BIOS and create the RAID container.

2. Add all the drives you intend to use in your array and designate any additional drives that you want to keep as spares.

3. After you create the container, use the RAID BIOS to create the hardware RAID type: RAID 5, RAID 1+0 and so on.

The process of creating the container is fast, but striping a large array can take some time.

Installing an Operating System

After your RAID has been configured, it’s time to install your operating system and complete the installation. To install your operating system, follow the steps below:

1. Insert the O/S install disc into your optical drive and start your system.

2. As your system proceeds past the BIOS and into the installation routine, make sure to correctly specify what your boot device will be and that you have the correct driver in hand to install so that your operating system will recognize the device.

In many instances, an operating system may come with the correct driver, but whenever possible, you should try to install the very latest driver from the vendor’s Website. If you are installing a RAID system, try to have that driver on hand for your operating system.

3. As part of the installation routine, specify the boot partition and the type of drive formatting you wish to have on it. With Windows Server, you probably want NTFS; with Linux or Unix, you may need to specify not only the partition and its type but also the number and definitions of any slices on the drive. Formatting a large volume takes some time, so this is a good time to attend to other tasks.

4. Proceed through the installation, specifying the details of your network connections as well as the particular system components that you want to install.

5. When your operating system is installed, shut down the system and connect your USB connections for any USB drives.

In building a server, the steps people seems to have trouble with are creating the RAID container and not having the correct device driver in hand. Many RAID boards are poorly documented, and if you haven’t done a system build before, you might not realize that you need to create a container first and stripe it prior to installing the operating system and then formatting the volume. The container and its striping are a hardware feature, separate from the formatting the operating system does.

With your server now up and running, it’s good practice to let it burn for 48 hours, monitoring your system temperature, which can be done using capabilities built into modern motherboards. In particular, you should monitor your CPU temperature to verify it’s not overheating.


Command Line Backup & Restore Using reg.exe

November 11, 2009

A command line registry manipulation tool called reg.exe is included with Windows XP. This tool is useful for selectively backing up or restoring specific Registry subkeys. Numerous functions are available in reg.exe, including Registry exporting and importing.

To backup a Registry key using reg.exe, use the following syntax:

reg export rootkey\subkey filename

For rootkey, you can use the abbreviations HKLM, HKCU, HKCR, HKU or HKCC. Subkey must be the full name of a Registry key under the selected root. Filename is the name of the file to which you want to save the exported data.

To restore a Registry key using reg, use the following syntax:

reg import filename

When importing, filename can be any file created by reg export, from the regedit Registry Editor’s Export command, or created manually with a text editor.


Server Categories

November 11, 2009

Entry-Level Servers – An entry-level server is a one- or two-processor system meant to provide a network service or services to as few as one client/user, up to as many as a workgroup. Many entry-level servers are used in horizontally deployed applications.

Midrange Servers – The midrange server offerings are viewed as department-level servers or servers that can provide network services to 10 clients/users, up to 250 clients/users for large applications. For simpler network services, such as DNS, a server of this class might service thousands of users.

Enterprise Servers – An enterprise server is a PC-based server equivalent of a mainframe. Sun’s systems in this area scale to hundreds of processors and are used for applications such as databases that best scale vertically.

Blade Servers – A blade server is a motherboard that’s been modified so it fits into a chassis and is hot-swappable.

Appliances – An appliance server is a special-purpose server that requires little maintenance and/or management.

Carrier-Grade Servers – This line of servers offers NEBS Level 3 (Network Equipment Building System, an industry standard) solutions for the telecommunications industry and for back offices.

Storage Servers – Sun is a major supplier of storage arrays, tape backup systems, and storage software, through its StorEdge line. Sun’s business is mostly to Sun server customers, but it also plays a central role as a management console of choice for Storage Area Networks (SANs).


Wildcards With the DIR Command

November 11, 2009

Visualize having 273 files in one directory. A few of those files have their extension .doc, but most don’t. You’re only looking for files with the .doc extension. Wouldn’t it be nice to type the DIR command so that only the .doc files come up? You can do this using wildcards.

A wildcard is one of two special characters, asterisk (*) and question mark (?), that can be used in place of all or part of a filename, often to enable a command-line command to act on more than one file at a time. Wildcards work with all command-line commands that take filenames. A great example is the DIR command. When you execute a plain DIR command, it finds and displays all the files and folders in the specified directory; however, you can also narrow its search by adding a filename.

If you want to confirm the presence of a particular file in a particular place, this is very convenient. But suppose you want to see all files with the extension .txt. In that case, you use the * wildcard, like this: dir *.txt. A good way to think of the * wildcard is “I don’t care.” Replace the part of the filename that you don’t care about with an asterisk.

Wildcards also substitute for parts of filenames. This DIR command will find every file that starts with the letter a:

C:\>dir a*.*

We’ve used wildcards only with the DIR command, but virtually every command that deals with files will take wildcards.