Nov 19

PXE Booting SpinRite

Category: Misc

I had reason recently to purchase a copy of Steve Gibson’s SpinRite utility to try to recover some data on a backup drive that went kaput. Since all of our workstations in the house are Macs, and I wanted to be able to let SpinRite perform its sometimes lengthy drive analysis without tying up any currently-running machines in the house, I decided to use a spare x86 server that had been sitting idle in our rack for some time. The machine itself was basically nothing more than the case, power supply, and motherboard (with on-board video and LAN). I didn’t have a spare CD drive at the time, and I didn’t really want to go buy one for this application, so I set out to run SpinRite the same way I install my server operating systems - via PXE. The one thing I did install in the system was a removable IDE drive tray, which allows me to easily install drives that I want to run through SpinRite (the “SpinCycle”? :)). I actually started calling this setup my SpinStation, since it turned out to be a very easy way to just pop a drive in and let it run. But I digress. It dawned on my while I was setting this up that organizations, including the ones Nearband Networks supports, may have good use for being able to boot SpinRite via the network. Imagine desktop support technicians responding to the call of a non-booting workstation due to a hard drive failure. Instead of having to carry a CD with SpinRite on it, they can simply set the machine to boot off the network, and let SpinRite run its course. Imagine the case of a server in amongst a rack of servers who’s hard drive has failed. Instead of having to remove that drive for testing, simply boot up SpinRite on the server from the network and let it do its magic. Finally, imagine performing maintenance (yes, as Steve Gibson is fond of pointing out, SpinRite is a drive maintenance tool just as much as it is a recovery tool) on a lab of machines. You could burn a CD for each system, run each system sequentially, or you could boot all of the systems from the network into SpinRite simultaneously and let them perform their maintenance overnight. These are some of the useful examples I was able to dream up while thinking about using SpinRite in this fashion. So, without further ado, on to how I set up SpinRite to boot via PXE.

PXE, or the Pre-boot eXecution Environment is an Intel standard on how to boot x86-based machines via the network. Many different system architectures through the years have had ways to boot from the network (Sun, Apple, etc). PXE is basically network booting for Intel-and-like-based machines. As I mentioned before, I use PXE to perform my server installs, usually Linux. If you’re familiar with the Windows way of doing things, then you may have used Remote Installation Services to install Windows over a network, a technology based on PXE. Most x86 systems built within the last 5+ years come with client-side PXE capabilities built in, especially if they have on-board ethernet, so chances are the systems you’re using now already support it.

Since my home network is Linux-server based, I already have the capability to boot via PXE. The basic requirements are DHCP and TFTP. I use the standard ISC DHCP server that is freely available and comes with most Linux distributions and the TFTP server that is included as well. In order to boot a PXE image off of the network, you’ll need to update your DHCP configuration to tell the client where your TFTP server is and what PXE image file to retrieve and boot from. Most DHCP servers are capable of sending clients the appropriate DHCP options to perform PXE booting with the appropriate configuration, but the specifics that follow will focus on the ISC DHCP server. For ISC DHCP to pass clients the necessary options, you’ll need to add two options to your configuration:

  • next-server
  • filename

The next-server option is followed by the IP address of your TFTP server, and the filename option is followed by the path to the file on the TFTP server. I use pxelinux to PXE boot my clients, and my TFTP server IP address is 172.16.24.1, so my lines look like this:

# For network OS installs
next-server 172.16.24.1;
filename "pxelinux.0";

Once you have DHCP set up to pass the appropriate bootstrap information, you need to configure pxelinux. Here’s where things get interesting. SpinRite comes with two image options: It can write out an ISO image or a floppy image for you. Normally, you’d use the images to create the necessary disks to run SpinRite from. With pxelinux, however, comes a very handy feature called memdisk, which allows you to boot a floppy image from the network, allowing you to take the floppy image written out by SpinRite, and use it directly with your PXE clients with no doctoring necessary. You’ll need to take the memdisk image and SpinRite images, and place them in the root of your TFTP directory alongside pxelinux.0. Next, edit the pxelinux.cfg/default file in your TFTP directory. If you have other network booting options, be sure to set prompt to 1 so that a prompt is displayed where you can type your booting option. You can also set up a boot message, which can display a menu of choices. Once you have that configured, add the following lines to the file:

label spinrite
kernel memdisk
append initrd=spinrite.img

When the spinrite option is invoked from the pxelinux boot command line, the client will retrieve the memdisk image and use it to then boot the spinrite.img file, which is the floppy image containing SpinRite’s FreeDOS and the SpinRite application.

That’s pretty much it. There may be some details left out, but most of those can be found from other PXE booting tutorials or the pxelinux documentation. If you’re feeling adventurous, you can even open up the SpinRite floppy image, using your image tool of choice, and make changes to the image, such as setting the auto option when invoking SpinRite from the autoexec.bat. This will basically make SpinRite a mostly hands-off operation (other than choosing to boot from the network and, optionally, choosing the spinrite boot option), as the machine will boot from the network and immediately begin checking all available drives in the system. Using this setup, I actually ended up testing every old and unused hard drive I had around the house, so that I could begin using them in my new Icy Dock external USB enclosure.

Finally, one last note. If you’re thinking about using this in a large organization, be sure that you pay attention to Steve’s modest site and enterprise licensing requirements.

3 Comments so far

  1. notslad November 26th, 2007 10:46 am

    this is a great idea!!

    also can be used for..
    . memory tester
    . virus scanner
    . secure video-conference clients (pre-setup)
    . a legal “single-computer license” work-around
    . non-AD based software push

    you could also use this as a quick way for an organization to get a workstation back “up and running” quickly after an attack or misconfiguration. Create an image with all of your organization’s “common applications” and they could be up and running within half an hour.. or less..

  2. mgriego November 26th, 2007 11:50 am

    You have to be careful about that “legal” piece. Many licenses are written such that it may not matter how many copies you have in persistent storage (ie on hard drives), what matters is how many you have in active memory (or are just “in use”) at the same time. On the other hand, if the license is written such all that matters is which physical medium its stored on, then you could have a point there, although I’m betting that, in most cases, that’s not what the author intended… :)

  3. blaisep July 1st, 2008 11:44 am

    MANY thanks for this inspiring post. I´ve considered buying Spinrite just to support the SecurityNow podcast, but we run Macs at home.
    I get that VMware may boot SpinRite via PXE with this solution, but can it actually recognize the disks in the iMac.
    I have a Psystar Hackintosh which will probably work, but if this works on Apple Hardware, it could change the world for me.
    (We spent US$2500 at DriveSavers to rescue my wife´s G4 iBook drive last year… filevault partition sitting on bad sectors.)

  • Buy Cheap cheapest price on phentermine Online Internet Prices For cheapest price on phentermine! Best Internet.
  • Buy cyalis levitra sales viagra Online Without Prescription. Low Prices. Pharmacy Store.
  • Buy Cheapest ultram 50 mg Now Best Internet. Drugs, Health And Beauty.
  • buy tadalafil cheap Online Without Prescription Pharmacy Store. Best Prices.
  • Buy Cheap cialis tadalafil information page Online Best Online. Cheap Prescription Drugs.
  • Buy Cheap cheap tramadol cod free fedex Now Pharmacy Store. Top Online Pharmacy Supplier.
  • Buy Cheap generic for ambien Now Free Viagra Pills! Cheap Online Pharmacy.
  • Buy Cheap buy diet pills in uk Now Cheap Pharmacy Online. Online Medical Shop.
  • Buy Cheap viagra generic soft tab Now Safe And Secure Payment System. Best Internet.
  • Buy Cheapest codeine side effects Now Cheap Prescription Drugs. Best Drugstore.
  • Buy Cheapest zolpidem 10mg Online Online Medical Shop. Best Online.
  • Buy Cheap buy prescription drugs with no prescription Online Online Prices For buy prescription drugs with no prescription! Best Drugstore.
  • Buy Cheap cheap phentermine diet pill Now Safe And Secure Payment System. Low Prices.
  • Buy Cheapest atarax hydroxyzine Now Free Viagra Pills! Online Medical Shop.
  • Buy Cheap cialis tadafil order online Now Internet Prices For cialis tadafil order online! Best Prices.
  • Buy Cheapest phentermine fedex Online Pharmacy At The Best Price! Best Online.
  • Buy Cheapest pregnancy and phentermine Online Best Drugstore. No Prescription Needed.
  • Buy Cheapest buy online zoloft Now Pharmacy Store. Online Prices For buy online zoloft!
  • Buy Cheap tramadol next day delivery Online Top Online Pharmacy Supplier. Best Online.
  • Buy Cheap tadalafil no prescription Now Pharmacy Store. Pharmacy At The Best Price!
  • Buy Cheap burn belly fat Online We Can Offer You Visit Our Online Pharmacy.
  • Buy Cheap withdrawal from effexor Now Best Online. Internet Prices For withdrawal from effexor!
  • Buy Cheap addicted to ativan Online Best Drugstore. Cheap Prescription Drugs.
  • Buy Cheap herbal diet pills Now Pharmacy Store. Online Prices For herbal diet pills!
  • Buying Cheapest ambien rx. Mexican Pharmacy, Good Prices. Best Online.
  • Buy Cheapest online xanax sales Now Best Drugstore. Discount Pharmacy Online.
  • Buy Cheap acne buy care product skin Now Drugs, Health And Beauty. Guaranteed Shipping.
  • Buy Cheap halflife of ativan Online 100% Satisfaction Guaranteed. Best Online.
  • Buy Cheapest ordering ambien Online Best Online. Cheap Pharmacy Online.
  • Buy Cheapest viagra generic drug Now Special Prices For viagra generic drug! Best Internet.
  • Buy Cheapest levitra facts Now Guaranteed Shipping. Best Drugstore.
  • Buy Cheap cialis does not work Online Discount Online Pharmacy. Best Online.
  • Buy Cheap generic cialis viagra Now The Largest Internet Pharmacy. Best Drugstore.
  • Buy Cheapest online sale viagra Now Free Viagra Pills! Top Online Pharmacy.
  • Buy Cheap klonopin dosage information Now Buy Medications Online. Guaranteed Shipping.
  • Buy Cheapest medications for bipolar disorder Now Low Prices. Order Cheap Meds Without Rx.
  • ativan 1 mg Online Without Prescription Best Online. Free Viagra Pills!
  • Buy Cheap buy viagra australian Online Special Prices For buy viagra australian! Best Drugstore.
  • Buy Cheapest fat loss tips Online Discount Pharmacy Online. Best Internet.
  • Buy Cheap discount lipitor Online Pharmacy Store. Cheap Pharmacy Online.
  • Buy Cheap discount vitamin supplements Online Safe And Secure Payment System. Low Prices.
  • Buy Cheapest buying xanax online Now Top Online Pharmacy. Cheap Online Pharmacy.
  • Buy Cheap fluoxetine hcl Now Best Prices. No Prescription Online Pharmacy.
  • Buy Cheap us prescription mail order pharmacy Online Discount Pharmacy Online. Pharmacy Store.
  • Buy Cheap rx pharmacy Now Pharmacy Store. Special Prices For rx pharmacy!
  • low dose cialis side effects Online Without Prescription Free Viagra Pills! Best Online.
  • Buy Cheap genuine cialis Now Best Internet. Cheap Prescription Drugs.
  • Buy overseas drug stores Without Prescription Doctor. Best Prices. Best Online.
  • Buy Cheap side effects of muscle relaxants Now Best Online. Top Online Pharmacy Supplier.
  • Buy Cheapest discount weight loss supplement Now Internet Prices For discount weight loss supplement! Low Prices.
  • Buy Cheap new antidepressant approved Online Best Drugstore. Discount Online Pharmacy.
  • Buy Cheap drugs affecting levitra Now Best Online. All Medications Are Certificated!
  • Buy Cheapest cialis drug information Online Guaranteed Shipping. Best Drugstore.
  • Buy Cheap clomid and multiple births Now No Prescription Needed. Free Viagra Pills!
  • Buy Cheapest xanax on line Now Pharmacy At The Best Price! Low Prices.
  • half life of valium Online Without Prescription Best Prices. Best Internet.
  • Buy Cheapest diet pills herbal Online Best Internet. Online Medical Shop.
  • Buy Cheapest mexico ambien Now Online Medical Shop. Top Online Pharmacy.
  • Buy Cheapest generic prescription drugs Now Buy Medications Online. Best Prices.
  • Buy Cheapest obesity solutions Online Low Prices. Cheap Online Pharmacy.
  • Buy Cheap verapamil drug Now WorldWide Shipping. Buy Medications Online.
  • Buy Cheapest new prescription weight loss drug Now Online Medical Shop. 24/Online Pharmacy.
  • Buy Cheapest us online pharmacy Online Buy Medications Online. Pharmacy Store.
  • Buy Cheap weight loss pill digestion Now Pharmacy Store. 100% Satisfaction Guaranteed.
  • Buy Cheap online overseas pharmacy Now Best Online. FDA Approved Rx: Online Pharmacy.
  • Buy Cheapest buy alesse online Online 24/Online Pharmacy. Low Prices.
  • Buy Cheap buy vigrx Now Pharmacy Store. Discount Pharmacy Online.
  • Buy Cheap norvasc 10mg Now Free Viagra Pills! Cheap Pharmacy Online.
  • Buy Cheap order pain pills Now Pharmacy Store. Drugs, Health And Beauty.
  • Buy Cheapest canada viagra Now Best Drugstore. Online Prices For canada viagra!
  • Buy Cheap valium info Online Pharmacy Store. Discount Pharmacy Online.
  • Buy Cheap top fat burners Online WorldWide Shipping. Cheap Online Pharmacy.
  • Buy Cheap prescription pain killers side effects Online Buy Medications Online. Best Internet.
  • Buy Cheapest online prescription medication Now No Prescription Needed. Best Internet.
  • shop clonazepam canada Online Without Prescription Low Prices. Top Online Pharmacy.
  • Buy Cheapest letrozole for infertility Now Online Medical Shop. Pharmacy Store.
  • Buy Cheapest generic names for prescription drugs Now No Prescription Needed. Pharmacy Store.
  • Buy Cheap phentermine on line Online Special Prices For phentermine on line! Best Drugstore.
  • Buy Cheap legal viagra Now Top Online Pharmacy. Cheap Online Pharmacy.
  • Buying Cheap codeine canada border. Offshore Pharmacy, Best Prices. Best Internet.
  • Buy Cheap viagra sales online in uk Online Order Cheap Meds Without Rx. Best Internet.
  • Buy Cheapest ocd zoloft Online Best Drugstore. Top Online Pharmacy.
  • Buy Cheapest buying valium Now 24/Online Pharmacy. Top Online Pharmacy.
  • Buy Cheap prescription meds Now Special Prices For prescription meds! Best Internet.
  • Buy Cheapest tramadol side effects Online Cheap Prescription Drugs. Best Online.
  • Buy Cheap cialis overnight shipping Online Special Prices For cialis overnight shipping! Best Drugstore.
  • Buy Cheapest cialis tips Online Best Drugstore. Cheap Pharmacy Online.
  • side effects of lasix Online Without Prescription Low Prices. WorldWide Shipping.
  • Buy Cheap info ultram Now Free Viagra Pills! Internet Prices For info ultram!
  • Buy Cheapest buy ambien online fast Now Cheap Prescription Drugs. Best Internet.
  • Buy Cheapest does zyban work Online Best Drugstore. 24/Online Pharmacy.
  • Buy Cheap india online drugstores Online Best Drugstore. Cheap Prescription Drugs.
  • Buy Cheap ship free viagra sample Now Discount Pharmacy Online. Free Viagra Pills!
  • Buy Cheapest generic cialis cheapest Online Best Drugstore. Guaranteed Shipping.
  • Buy Cheap benicar buy Online Discount Pharmacy Online. Best Online.
  • Buy Cheap side effects of cialis overdose Online Special Prices For side effects of cialis overdose! Pharmacy Store.
  • Buy Cheap women's health products Online Discount Pharmacy Online. Low Prices.
  • Buy Cheapest generic valium without prescription Now Low Prices. Cheap Prescription Drugs.
  • pain relief creams Online Without Prescription Free Viagra Pills! Low Prices.
  • Buy Cheap viagra cialis canadian pharmacy Online Pharmacy Store. No Prescription Needed.