Jump to content


Photo
- - - - -

Ep 1021 Pxe Server And Spinrite 6


  • Please log in to reply
5 replies to this topic

#1 TheMacOne

TheMacOne

    Hackling

  • Active Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Australia

Posted 17 April 2012 - 09:00 AM

Hello all,

First time caller, long time listener :P

Was following int0x80's segment on Debian PXE server and have successfully deployed one on an old HP Pavillion 503a (1.7GHz Celeron, 1Gb RAM, 160Gb HDD). It broke out of the VM :P

The one thing I wanted to do was use Spinrite 6 over PXE should the optical drive and hard drive pack it in (that has happened, amazingly :blink:), but saw loads of tutorials using a modified version of Freedos and including Spinrite.

I did notice that Spinrite had its own config.sys file and its own way of doing things. For example, the splash screen is a .sys file.

When I did the Freedos option, it wasn't elegant - it asked for date and time, then had to type spinrite.exe at the prompt.
There had to be a better way. And by <deity>, there is. :)

Before we continue, I own my own copy of SR6 and if you don't, get yours here.

So, here is the easier method for SR6 via PXE:
1. Get Spinrite.exe onto a Windows desktop (or your windows-compliant system of choice) and launch it.
2. Once the application is open, click on "Create ISO or IMG File" button.
3. A different window will appear and then click "Save a Boot Image File". A dialog box will now appear.
4. Navigate to the location you wish to save the file but BEFORE clicking the Save button, use the dropdown menu to Save as type "IMG". So, your filename should be SpinRite.img. Now save.
5. Upload this img to your PXE server. I put it under /tftpboot/sr6. Make the dir to your liking but if its different, remember the dir name.
6. Use your editor of choice to make a menu file in that (sr6) folder.
7. This is your code for the Spinrite sub menu:
LABEL 21
MENU LABEL Spinrite 6
KERNEL memdisk
APPEND initrd=/sr6/SpinRite.img
TEXT HELP
Boot the Spinrite 6 CD
ENDTEXT
Save as sr6.menu and close.
8. Use your editor of coice to edit the /tftpboot/pxelinux.cfg/default file. I duplicated the backtrack 5 settings and subbed in the Spinrite details. Be sure your MENU INCLUDE is sr6/sr6.menu.
9. Because syslinux is already installed, we need to copy memdisk to the tftpboot dir. So:
cp /usr/lib/syslinux/memdisk /tftpboot
10. Restart the tftpd-hpa and nfs-kernel-server services to be on the safe side by using service:
service tftpd-hpa restart
service nfs-kernel-server restart
11. Boot your target system via PXE and under the Backtrack menu, should be Spinrite and then the Spinrite 6 CD sub menu option.

If everything worked well, it will boot 99.9998% like the CD does. The only difference I saw was that if the target system had a floppy disk drive, instead of A drive, it would be B instead.

It looks daunting but if you got the PXE server up from int0x80's tutorial, then this should take about 5 mins to implement.

Thanks to Hak5 and int0x80 for everything.

Mac.

#2 int0x80

int0x80

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 158 posts
  • Gender:Male
  • Interests:Internet

Posted 19 April 2012 - 08:54 PM

Very cool! I hadn't thought of doing Spinrite, well played :)
6a 25 58 6a ff 5b 6a 09 59 cd 80

http://dualcoremusic.com

#3 TheMacOne

TheMacOne

    Hackling

  • Active Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Australia

Posted 27 April 2012 - 04:26 AM

A bit of an update since...

I was playing around with specific MAC address configuration and found out a few things.
So, for example, let's say you want a specific MAC address to boot into SpinRite 6 when it boots via PXE.

The first thing is, find out the MAC address for the device you wish to send to SR6 automatically via PXE.
Let's say the MAC address is 00:11:22:33:aa:bb.

So, make a file with the MAC address with the 01-prefix. The filename would be: 01-00-11-22-33-aa-bb.
This file should be in the /tftpboot/pxelinux.cfg folder.

Once the file is created with your editor of choice, put this into the 01-00-11-22-33-aa-bb file:
DEFAULT vesamenu.c32
TIMEOUT 10
MENU AUTOBOOT "SpinRite 6 is about to boot ... stand by ..."
KERNEL memdisk
APPEND initrd=/sr6/SpinRite6.img

Save and close the editor.

Then boot your device and it should autoboot into SR6.

Mac.

#4 foo

foo

    The Dude

  • Active Members
  • PipPipPipPipPip
  • 220 posts
  • Gender:Not Telling

Posted 27 April 2012 - 03:56 PM

First time caller..


First time caller? Posted Image

#5 TheMacOne

TheMacOne

    Hackling

  • Active Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Australia

Posted 28 April 2012 - 07:32 AM

First time caller? Posted Image

Yep and long time listener :lol:

Mac.

#6 TheMacOne

TheMacOne

    Hackling

  • Active Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Australia

Posted 19 February 2013 - 07:56 AM

Massive update since.

 

Been tinkering away for a long time now and found this gem across my travels today.

It relates to using whole untouched iso images for pxelinux and transformed this solution for me.

 

The TL;DR is this: only 3 lines change and two files.

Once you have copied the SpinRite.iso to the tftpboot directory, make sure memdisk is copied into the directory as well (You can get memdisk from FreeDOS.)

 

Before we had:

KERNEL memdisk
APPEND initrd=/sr6/SpinRite6.img

 

Now, change that to this:

KERNEL memdisk
INITRD sr6/sr6.iso
APPEND iso raw

 

What this does is tell memdisk to mount the iso as (obviously) an iso in the RAW format.

 

SpinRite 6 doesn't play well with AHCI so be sure to change the BIOS to legacy (IDE) and make sure SMART is enabled (the next update will hopefully address that).

 

HTH.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users