Jump to content











Photo

[Tutorial] How to Test USB Key/Stick/Flash Drive/UFD Bootability


  • Please log in to reply
9 replies to this topic

#1 DSpider

DSpider

    Newbie

  • Members
  • 29 posts
  •  
    Romania

Posted 06 April 2009 - 04:38 PM

How to Test USB Key/Stick/Flash Drive/UFD Bootability
(Or whatever you want to call it... Some people call them USB Keychains.)


Quick Note: UFD stands for "USB Flash Drive".

Posted Image



On to the tutorial ! First step would be to actually download Qemu. If you Google it you'll see this address at the very top. Click the Download link. You'll see somewhere "QEMU on Windows provides precompiled QEMU versions for Windows." which will most likely send you to: http://www.h7.dion.ne.jp/~qemu-win/

Here's a mirror to the latest version (available right now) for Windows:
qemu-0.9.1-windows.zip [12.5 MB]

It was labeled as QEMU on Windows Ver 0.9.1 (2/4/2008)


1. Extract the archive to C: (for example) and rename the folder as "qemu" or "qEmu", "QeMu", "qemU" or whatever. "Qemu" would be best.

2. You can either create a batch file by right clicking inside the "Qemu" folder, choosing New -> Text Document and changing it's extension by renaming it to "usb.bat" or "test.bat" (or whatever) and adding these two lines:

@echo off

qemu.exe -L "C:\qemu" -M pc -localtime -boot c -hda \\\\.\\physicaldrive1

For simplicity purposes I've also uploaded the batch file.



Question: What if it doesn't work and my UFD isn't recognized as "physicaldrive1" ?
Answer: That's how my PC recognizes mine. Yours may differ. You ccould get this (or a similar tool) and verify.

Posted Image

See ?


PS: I believe the Linux version of this tutorial isn't very difficult either. If someone could please post the batch and/or method I would very much appreciate it. Thanks.

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 April 2009 - 06:43 PM

Just for the record latest (unofficial) Win32 build is here:
http://www.bttr-software.de/qemu/

currently 0.10.1

You will need also the DLL's:
  • original SDL version 1.2.13
  • original FMOD version 3.75
  • original zlib version 1.2.3

jaclaz

#3 TigerWhite

TigerWhite
  • Members
  • 2 posts
  •  
    India

Posted 13 July 2009 - 06:41 AM

Just for the record latest (unofficial) Win32 build is here:
http://www.bttr-software.de/qemu/

currently 0.10.1


The current rev is 0.10.5.
But the commandline given by the OP is not working with this rev.

I tested a UFD containing bootsdi.img using the command in qemu 0.9.1 and it booted OK.
However, when I tried the same command in qemu 0.10.5 it did not succeed. The qemu window appears for a fraction of a second and closes. I could not find out the error.

After searching qemu forums I tried a slightly altered commandline

@echo offqemu.exe -L "C:\qemu" -M pc -localtime -boot c -hda \\.\physicaldrive1


and the UFD booted successfully. The difference is only in the number of backslashes.
The altered commandline does not work in 0.9.1.

Strange. :lol:

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 13 July 2009 - 07:48 AM

Strange. ;)


Yep ;), though what you used appears to be the "right" way, I mean I always used "single double" slashes, maybe it was a quirk of the parsing engine of the older version that needed the doubling. :lol:

jaclaz

#5 Neel

Neel

    Member

  • Members
  • 52 posts
  •  
    India

Posted 27 July 2009 - 12:54 PM

its giving me the following error :idea:

disk error
press any key to restart

Attached Files



#6 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 27 July 2009 - 01:19 PM

its giving me the following error :P

WHAT :) is giving you the error?

The error you are having is coming from the actual device (USB stick I presume).
  • What is it?
  • How did you partition/format it?
  • With what tools?
  • Under which OS?
  • How big is it in size?
  • etc., etc.

Compare with point #d. of "common sense advice" attached to Rules :P:
http://www.boot-land...?act=boardrules

:idea:


jaclaz

#7 Neel

Neel

    Member

  • Members
  • 52 posts
  •  
    India

Posted 28 July 2009 - 05:04 AM

WHAT :P is giving you the error?

The error you are having is coming from the actual device (USB stick I presume).

  • What is it?
  • How did you partition/format it?
  • With what tools?
  • Under which OS?
  • How big is it in size?
  • etc., etc.

Compare with point #d. of "common sense advice" attached to Rules :):
http://www.boot-land...?act=boardrules

:idea:


jaclaz


sorry my bad :P

yes it is a USB stick, i am using grub4dos, i used "HP Disk Storage Format tool v2.0.0" to format it and i am using winxp with sp2 x64. my USB capacity is 1GB. its working fine when i am trying to boot my system using it. the following is the content of my disk

and the content of menu.lst
color white/blue black/white white/blue white/blue

timeout 30

default 0



title 1. USB XP

find --set-root /xpldr 

chainloader /xpldr



title 2. Kaspersky Rescue-CD

kernel /KAV2009_JUL_13/isolinux/rescue subdir=/KAV2009_JUL_13 setkmap=us scandelay=5 root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/KAV2009_JUL_13/image.squashfs cdroot

initrd  /KAV2009_JUL_13/isolinux/rescue.igz



title 3. Avira System Rescue

find --set-root /AVISO/avira26July2009.iso

map /AVISO/avira26July2009.iso (0xff) || map --mem /AVISO/avira26July2009.iso (0xff)

map --hook

chainloader (0xff)

savedefault --wait=2



title 4. Boot CDROM

cdrom --init

map --hook

chainloader (cd0)

rootnoverify (cd0)



title 5. Boot from hard disk

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

chainloader (hd0)+1

boot



title 6. commandline

savedefault --wait=2

commandline



title 7. Reboot

reboot



title 8. Halt/Shutdown

halt

Attached Files



#8 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 July 2009 - 11:06 AM

I'll try again.

i used "HP Disk Storage Format tool v2.0.0"

is the "wrong" answer (AFAIK there are only two version around, 2.0.6 or 2.1.8) too this question:

  • With what tools?


The answer to this other one:

  • How did you partition/format it?

Could be:
  • NTFS
  • FAT16 CHS mapped (06)
  • FAT16 LBA mapped (0C)
  • FAT32 CHS mapped (0B)
  • FAT32 LBA mapped (0C)
:idea:

The HP tool produces usually (read always) not-balanced CHS/LBA data, that can cause that a stick is bootable on a given BIOS, but it is not on another one.

If data is balanced, the usual test is to change the partition type from CHS to LBA or viceversa.

FAT32, additionally has a known problem with it's bootsector (in the version from 2K/XP/2003, the one invoking NTLDR)

Please, try using fuwi's utility:
http://www.911cd.net...o...c=21702&hl=
(which does make use of the HP formatting utility, but corrects some of its "quirks").

Other appropriate apps are listed here:
http://www.msfn.org/...o...87993&st=17

or post your MBR compressed into a .zip or .7z archive and i'll have a look at it (first sector of PhysicalDrive, use HDhacker to save it):
http://www.dimio.altervista.org/eng/

jaclaz

#9 Neel

Neel

    Member

  • Members
  • 52 posts
  •  
    India

Posted 28 July 2009 - 07:42 PM

2.0.6 sorry i mistyped

ok let me go through the links u provided

#10 Neel

Neel

    Member

  • Members
  • 52 posts
  •  
    India

Posted 29 July 2009 - 03:38 AM

thanks jaclaz i was finally able to boot using qemu didn't understood what the problem was so i tried recreating and it seem to be working now thanks, also more dumb questions might be coming up now as i am able to boot using qemu plz bare with me, and i hope from next time onwards i will be able specifics. :idea:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users