<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HauntedShell &#187; system recovery</title>
	<atom:link href="http://hauntedshell.com/tag/system-recovery/feed/" rel="self" type="application/rss+xml" />
	<link>http://hauntedshell.com</link>
	<description>Just another Hauntedshell.com weblog</description>
	<lastBuildDate>Sat, 01 May 2010 20:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Windows 98 Boot Disks and Linux</title>
		<link>http://hauntedshell.com/2007/12/18/windows_98_boot_disks_and_linux/</link>
		<comments>http://hauntedshell.com/2007/12/18/windows_98_boot_disks_and_linux/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 00:16:15 +0000</pubDate>
		<dc:creator>Kwame</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[bootdisk]]></category>
		<category><![CDATA[system recovery]]></category>

		<guid isPermaLink="false">http://hauntedshell.com/2007/12/18/windows_98_boot_disks_and_linux/</guid>
		<description><![CDATA[<p>
If you've ever had to reinstall Windows on a computer, be it yours or someone else's, you probably know that boot disks can be rather useful things to have around. The best kind are the Windows 98 boot disks (IMHO); they fit onto one floppy and give you access to the cdrom even if the computer's BIOS doesn't support booting from cdrom.
</p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever had to reinstall Windows on a computer, be it yours or someone else&#8217;s, you probably know that boot disks can be rather useful things to have around. The best kind are the Windows 98 boot disks (IMHO); they fit onto one floppy and give you access to the cdrom even if the computer&#8217;s BIOS doesn&#8217;t support booting from cdrom.</p>
<p>So what do you do when you need to reinstall Windows and the computer your&#8217;re working is a tiny laptop with no floppy, no cdrom and a serious malware overdose?<span id="more-12"></span> Since the computer supported booting from USB, all I had to do was figure out a way to get the Windows 98 bootdisk on a USB key. I tried several utilities but none worked for me.This is where Qemu and dd come in. Basically, what you do is :</p>
<ul>
<li> Download a Windows 98 Boot Image.</li>
<li> Create a Qemu RAW disk image (big enough to hold the bootdisk files and any other files you might need. Mine was about 700MB)</li>
<li> Boot up a Qemu virtual machine with the boot image for your floppy device and the disk image as your primary hard drive</li>
<li> Use <strong>fdisk</strong> and <strong>format</strong> to partition and format the disk image</li>
<li> Transfer boot &amp; command system to disk image with <strong>sys</strong>.</li>
<li> Use <strong>dd</strong> to  strip off the first 63 512-byte blocks on the disk image</li>
<li> Use <strong>dd</strong> to copy the disk image to USB Key.</li>
</ul>
<p>Now for more detailed instructions:</p>
<p>Open a terminal (xterm, konsole, gnome-terminal; whatever you&#8217;re comfortable with)</p>
<p>Create a folder to contain all your files<br />
<code>ray@zangetsu:~$ mkdir win98boot<br />
ray@zangetsu:~$ cd win98boot<br />
</code></p>
<p>Download the Windows 98 boot image from <a href="http://www.hauntedshell.com/files/win98se.img">here</a><br />
<code>ray@zangetsu:~/win98boot$ wget http://<br />
</code></p>
<p>Create a 256MB Qemu  RAW disk image (or whatever size you need)<br />
<code>ray@zangetsu:~/win98boot$ qemu-img create -f raw drive_c.dsk 256M<br />
</code><br />
Next, we load a virtual machine that boots from the floppy image<br />
<code>ray@zangetsu:~/win98boot$ qemu -fda  win98se.img -hda drive_c.dsk  -boot a -m 32<br />
</code><br />
Once the VM boots up, you should see something similar to the following:</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5145110101942516018"><img src="http://lh6.google.com/kwame.nkansah/R2caYLSOuTI/AAAAAAAAAVg/yMP9Cd9mrlQ/s400/Qemu-7.png" alt="" /></a></p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5132998437149276242"><img src="http://lh4.google.com/kwame.nkansah/RzwS4f7q-FI/AAAAAAAAAT4/AsOiigZik_Q/s400/Screenshot-QEMU.jpg" alt="" /></a></p>
<p>What we need to do is partition our virtual drive, so<br />
<code>A:\fdisk C:<br />
</code></p>
<p>Enter 1 at the first screen to select the first option (Create a DOS partition or Logical DOS Drive)</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5132998484393916514"><img src="http://lh3.google.com/kwame.nkansah/RzwS7P7q-GI/AAAAAAAAAUA/UpzfWFIbOY0/s400/Screenshot-QEMU-1.jpg" alt="" /></a></p>
<p>Enter 1 at the next screen to Create a Primary DOS partition</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5132998531638556786"><img src="http://lh6.google.com/kwame.nkansah/RzwS9_7q-HI/AAAAAAAAAUI/M09kCeUICVE/s400/Screenshot-QEMU-2.jpg" alt="" /></a></p>
<p>Answer yes if fdisk asks you if you want make maximum use of your disk</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5132998574588229762"><img src="http://lh4.google.com/kwame.nkansah/RzwTAf7q-II/AAAAAAAAAUQ/cYNMzLUd0wk/s400/Screenshot-QEMU-3.jpg" alt="" /></a></p>
<p>After fdisk finishes, you will need to restart the VM before you can format your drive.</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5134362243884578978"><img src="http://lh4.google.com/kwame.nkansah/R0DrQf7q-KI/AAAAAAAAAU4/0PhP6K6QNS8/s400/Screenshot-QEMU-4.jpg" alt="" /></a></p>
<p>Just close it and run the following again:<br />
<code>ray@zangetsu:~/win98boot$ qemu -fda  win98se.img -hda drive_c.dsk  -boot a -m 32<br />
</code><br />
Now you can format:<br />
<code>A:\format C:<br />
</code><br />
Answer yes when asked if you want to proceed with format. After formating is done, you will be prompted to enter a volume label. This is optional.</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5145110101942516002"><img src="http://lh6.google.com/kwame.nkansah/R2caYLSOuSI/AAAAAAAAAVY/HMFyC0kqC5A/s400/Qemu-6.png" alt="" /></a></p>
<p>Next, we transfer system to c:<br />
<code>A:\sys C:<br />
</code></p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5145110106237483330"><img src="http://lh3.google.com/kwame.nkansah/R2caYbSOuUI/AAAAAAAAAVo/YuyI9ma08ZM/s400/Qemu-8.png" alt="" /></a></p>
<p>Once that&#8217;s done. Close your VM and boot it up once more but without the floppy image this time.<br />
<code>ray@zangetsu:~/win98boot$ qemu -hda drive_c.dsk -m 32<br />
</code><br />
If you did everything right, the windows 98 splash screen should flash briefly and you should get something like this:</p>
<p><a href="http://picasaweb.google.com/kwame.nkansah/Screenshots/photo#5145110106237483346"><img src="http://lh3.google.com/kwame.nkansah/R2caYbSOuVI/AAAAAAAAAVw/spiy1ijXwZI/s400/Qemu-9.png" alt="" /></a></p>
<p>Before we can copy the image to our usb drive, we need to modify it a little. This strips off the first 63 blocks of the image( Found this useful piece of info thanks to <a href="http://colinux.wikia.com/wiki/Converting_Distributions"></p>
<p>http://colinux.wikia.com/wiki/Converting_Distributions</a>)</p>
<p><code>ray@zangetsu:~/win98boot$ dd if=drive_c.dsk of=boot.img bs=512 skip=63<br />
</code><br />
We can now copy the image to the drive. In this case, my drive happens to be /dev/sdb. You can use <strong>dmesg</strong> to find out what it is on your machine.<br />
<code>ray@zangetsu:~/win98boot$ dd if=boot.img of=/dev/sdb bs=512<br />
524288+0 records in<br />
524288+0 records out<br />
268435456 bytes (256 MB) copied, 108.920273 seconds, 18.5 MB/s<br />
</code><br />
Voila, you have a working Win98 bootable USB drive. You can now mount the drive and copy whatever else you need onto it. Your results may vary depending on the options you choose but they should be similar to the above.</p>
]]></content:encoded>
			<wfw:commentRss>http://hauntedshell.com/2007/12/18/windows_98_boot_disks_and_linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
