Jump to content











Photo
- - - - -

Write Protected Bootable USB Stick


  • Please log in to reply
107 replies to this topic

#51 athrelia

athrelia

    Newbie

  • Members
  • 10 posts
  •  
    Bangladesh

Posted 28 March 2013 - 07:42 PM

Please any show me a way........

             

 

   i have a bootable ghost restore dvd. i have also its boot image file. now how its possible that make this iso boot disk password protect???



#52 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 March 2013 - 08:04 PM

popov, you are admirable in your attempts :), but again, if you could NOT panic, you would probably get faster to a solution (or at least risk less going after red herrings)

.

JFYI, bootlace.com is NOT a web site, it is a program, part of grub4dos, which is used to install grub4dos.

The site you found is a "wrap-around" to that program.

 

As you have seen, the options are many, and learning to use it is not the easiest thing to do (either in command line or through a pseudo-GUI), more than that, it is simply not needed/useful to try understanding the issue you are having.

 

RMPREPUSB has been developed as a replacement to the HPusb tool, that has a series of issues, RMPREPUSB includes each and every "trick of the trade" to have a USB stick bootable on a wider range of machines (which includes the double partition), but the sheer fact that you have issue with a single partition on USB is itself a sign that your machine has a "pesky" BIOS. :(

 

It is also possible that the grub4dos MBR code has issue with that BIOS (it has happened in the past).

 

So, the stick size is 4,083,351,552 bytes, right?

 

I will make a few test images for that stick, to see how it behaves.

 

:cheers:

Wonko



#53 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 29 March 2013 - 01:29 AM

I know that bootlace is prog, just pointed out that it's so hard that they made website with command line params so people can copy text. Obviously currently I am unable to use it alone. Also, my stick doesn't work anywhere, as I've tested it on few other computers. Mostly I am trying to run each test on at least two separate PC's with different BIOS'es.

#54 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 29 March 2013 - 01:52 PM

Just a crazy idea.

How about using a hex/disk-editor to have a look at what's different with/without WP?

Or maybe easier. Create an image of the drive once with WP on and once with WP off and compare the two.

:cheers:

#55 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 29 March 2013 - 06:35 PM

Sure... which software should I use for img and hex?


Edited by popov, 29 March 2013 - 06:37 PM.


#56 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 March 2013 - 07:32 PM

Ok, let's see if this (partial) image works.

The stick partitioning/filesystem will be modified, so, if you have any valuable data SAVE/BACKUP it, FIRST.

 

It is a single partition image using the "mini" MBR from COD11 and it's Grub4dos FAT32 bootsector (and grldr).
Attached is file Mbr_GRLDR_popov.zip.
UNzip it to (say)  C:\testimages\Mbr_GRLDR_popov.img
In the same C:\testimages\ directory put dsfi (part of the DSFOK) here:
http://members.ozema...eezip/freeware/
Open a command prompt and navigate to that directory, at the C:\testimages\> prompt type:

 

dsfi \\.\PhysicalDriven 0 0 Mbr_GRLDR_popov.img

Replace the n with the CORRECT PhysicalDrive number corresponding to your stick.

If you have only a disk, that wiil be \\.\PhysicalDrive0, and the stick will be \\.\PhysicalDrive1, the numbers are the same as the disks that you can see in Disk Management. BE CAREFUL!

 

Then try booting both with the switch on and off and report what happens.

Ask if you have any doubt on the usage of the DSFOK dsfi, or more generally any doubt BEFORE doing something that you may later regret.

 

I doubt that the image of the stick may change when the protection is on/off (a BIOS issue of some kind is more likely), but *everything* is possible (though there may be issues if the stick controller has some wear leveling functions :unsure:)

Anyway the dsfo.exe in the DSFOK toolkit is a very suitable tool.

Syntax to make the images of the stick will be:

 

 

dsfo \\.\PhysicalDriven 0 0 Write_Protected_image.img

 

and then once the stick switch has been disconnected and re-connected with the switch on:

 

 

 

dsfo \\.\PhysicalDriven 0 0 Read_Only_image.img

 

 

:cheers:

Wonko

 

 

Attached Files



#57 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 29 March 2013 - 10:29 PM

Sure... which software should I use for img and hex?
Whatever you like, as long as it creates a raw image.
I would use WinHEX for both, but i have a licence for it.
HxD may be able to do the same, but not sure about that.

:cheers:

#58 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 05:56 AM

No matter how hard I try, the content is identical. I used HDD Guru Raw Copy Tool(dd) and compared *img files with HxD. Now I am trying to create two images with HxD as it has native option to read whole disks and build their image(I am doing this with "read only" box unticked for both modes). Then I will create pair of images with HxD but I will load disk not as raw, but as windows detected drive(with its own letter). I'll update this post with results soon.

Update1: Seems that images created by Guru RAW Copy Tool and HxD(when reading drive as "Removable Disk 1" are identical. I must point out that Guru RAW Copy Tool made image like 5 times faster than HxD and didn't clog system.

Edited by popov, 01 April 2013 - 06:28 AM.


#59 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 08:14 AM

As expected, HxD reported that files are identical.

As for dsfi, I did in two ways:

Formatted drive with HPUSBDisk, did dsfi, formatted again with HPUSBDisk, installed GRUB - no effect.

Formatted drive with HPUSBDisk, did dsfi, installed GRUB - no effect.

In both cases dsfi reported that it wrote 2323456 bytes at offset 0.

I used "wmic diskdrive list brief" console command to get correct drive readings.

Edited by popov, 01 April 2013 - 08:29 AM.


#60 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2013 - 09:05 AM

Maybe the 'mode' of the USB stick is different when the WP switch is moved?

Might be good to compare the results of a few programs with the switch in each position (after unplugging and re-inserting it when the switch is changed)?

 

e.g. USBDeview, diskmgmt.msc, wmic diskdrive list

 

can you suggest any more?



#61 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 April 2013 - 10:16 AM

As for dsfi, I did in two ways:

Formatted drive with HPUSBDisk, did dsfi, formatted again with HPUSBDisk, installed GRUB - no effect.

Formatted drive with HPUSBDisk, did dsfi, installed GRUB - no effect.

In both cases dsfi reported that it wrote 2323456 bytes at offset 0.

I used "wmic diskdrive list brief" console command to get correct drive readings.

I don't understand what the HECK are you doing. :frusty:
 
The idea is to just test the image I provided.
 
You don't format anything, do not install anything, you do nothing but copying the provided (partial) image and try booting from that stick, and report what happens.


Then try booting both with the switch on and off and report what happens.
 

:cheers:
Wonko



#62 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 10:38 AM

Formatted drive with HPUSBDisk, did dsfi, then:

 

unprotected - booted into GRUB shell

 

protected - "FDD EBIOS Disk error"


Edited by popov, 01 April 2013 - 10:39 AM.


#63 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2013 - 10:40 AM

Some USB sticks have an FDD mode switch - are you sure the switch is a WP switch?



#64 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 April 2013 - 11:13 AM

@popov

AGAIN you NEED NOT to format anything, let alone with the HP USB formatting tool, before applying the immage, you simply apply the image (of course you are perfectly free to needlessly re-format that stick :), but it is not needed, nor suggested).

And it is important as a general rule, if you are told to do something you should do that EXACTLY.

In this particular case not following to the letter a set of instruction and adding to them the formatting step causes NO issues whatsoever, but in another case it may.

 

The difference should mean that the switch as Steve6375 posted does not "write protect" only or, better, beside "write protecting", it also changes something in the way the stick "presents" itself to the BIOS.

 

Try applying this other image.

The stick won't boot in either "switch mode", but it should print in both cases some data.

This one has the MBR SPY by COD11.

You could take a photo of the screen or jolt down these values and post them.

 

:cheers:

Wonko

Attached Files



#65 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 11:20 AM

Just to claryfiy, my BIOS base settings are are: Boot from USB-HDD->USB-FDD->USB-ZIP->CDROM->HDD in that other. Also as for MBRSpy, wondering if BIOS matters, because I can try on few other computers.

 

Results show that CX and DX parameters are different.

 

unprotected:

 

 

CS=0000 DS=9FC0 ES=F000 SS=0000

AX=0C8D BX=FFFF CX=0004 DX=0080

BP=7C00 SP=7BD2 IP=7C00

SI=0040 DI=8400 FG=0202

 

 

 

protected:

 

 

CS=0000 DS=9FC0 ES=F000 SS=0000

AX=0C8D BX=FFFF CX=007E DX=0000

BP=7C00 SP=7BD2 IP=7C00

SI=0040 DI=8400 FG=0202


Edited by popov, 01 April 2013 - 11:41 AM.


#66 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 12:33 PM

Also, in Windows, where drive is detected and treated normally, running QEMU I obtained two identical results:

 

 

CS=0000 DS=0000 ES=0000 SS=0000

AX=AA55 BX=0000 CX=0000 DX=0080

BP=0000 SP=6F50 IP=7C00

SI=0000 DI=0000 FG=0202


Edited by popov, 01 April 2013 - 12:34 PM.


#67 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 April 2013 - 12:35 PM

Yep, at least in combination with that particular BIOS the issue should be the DX value 80 means drive 128 (Fixed Disk) while 00 means Floppy.

 

Now it could be the "right time" to try fbinst. :unsure:

 

I am not particularly familiar with it, but the basic instructions should be these:

http://reboot.pro/to...ws-7-and-vista/

 

Again, be very careful with chosing the right device.

 

:cheers:

Wonko



#68 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 01 April 2013 - 01:02 PM

Wonko, the way i see it, the problem is that the stick is formatted as a HDD with 2 partitions and this creates problems, when the stick is detected as a Floppy.

So formatting the stick as a removable device, should fix the issue.

Would you agree with this reasoning?

:cheers:

#69 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2013 - 01:02 PM

Because the boot order is USB HDD - USB FDD, the BIOS does not think that it is a HDD and so boots it as an FDD.

 

As QEMU works OK, then I wonder what is causing the BIOS to think that it is not an HDD?

 

It might be interesting to try the 5 TESTMBR images - they also reports the disk geometry and extended BIOS support, and has one and two partition test code for 32 and 63 spt ptn tables.



#70 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 01:46 PM

I am reading instructions from website and wondering which image to chose?

 

Formatted with RMPrepUSB as HDD.

 

0P  = no partition

32S = PBR erased

63S = PBR retained

 

Should it be MBR1P63S.BIN?


Edited by popov, 01 April 2013 - 01:47 PM.


#71 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2013 - 01:49 PM

all 5 - test them all. The BIOS may do different things depending on how many partitions there are and what geometry they have.



#72 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 April 2013 - 01:55 PM

Wonko, the way i see it, the problem is that the stick is formatted as a HDD with 2 partitions and this creates problems, when the stick is detected as a Floppy.

So formatting the stick as a removable device, should fix the issue.

Would you agree with this reasoning?

No.

If the registers values change with the switch, it means that the switch does "more than" Read protect.

As said it is more likely an issue with this particular BIOS (in combination with this particular stick).

From experience, these kind of issues tend also to be connected to the size of the stick, which in this case is simply too big to make it probable that it boots as super-floppy.

It would be - in case - more likely that it could boot as Zip (and yes I have at least one motherboard that could boot form USB HDD alright, but after a BIOS update - needed for another issue - only booted if formatted as ZIP - and no - the multiple partitions do not affect seemingly the Zip format)

 

The Steve6375's TEST MBR's might be able to give more insight.

@popov

Just READ the instructions and follow them:

http://www.rmprepusb...s/diagnose-bios

 

Which one represents a problem for you?

 

 

:cheers:

Wonko



#73 popov

popov

    Member

  • Members
  • 59 posts
  •  
    Abu Dhabi

Posted 01 April 2013 - 02:35 PM

I am testing on 3 computers. First, HP Pavillion DV2718US is sometimes able to boot when stick is write protected. It is the one that is most successful in everything. Second computer, P5GC-MX is usually displaying error mesages when booting with write protection on. Third, A7N8X almost always skips to HDD when USB boot fails, giving no error messages(and when HDD boot is turned off it's often just black screen).

 

Every time I will format with RMPrepUSB (FAT32, Boot as HDD, 2PTNS, SYSLINUX bootable).

 

 

As for MBR1P63S.BIN

 

DV2718US(both in r- and rw mode):

 

 

80

0000 FE02 003F 03BD

LHDD0 00

SHDD0 00

 

P5GC-MX(rw):

 

80

0000 FE02 003F 03BD

LHDD0 00

SHDD0 00

 

P5GC-MX(r-):

 

00

0000 FF01 0000 03FF

L1

SFDD0 00

 

A7N8X(rw):

 

80

0000 7F03 003F 036F

LHDD0 00

SHDD0 00

 

A7N8X(r-):

 

skips

 

As for MBR2P63S.BIN

 

P5GC-MX and A7N8X:

 

identical results as with MBR1P63S.BIN

 

DV2718US:

 

blacked out after connecting "r-" mode stick

 

after dischargining I plugged stick in "rw" mode first and then in "r-" and results were identical as with MBR1P63S.BIN

 

@Wonko

 

Problem with DV2718US is, that it is blacking out when testing. It's not the first time I need to wait for battery discharge. Initially I didn't even test on this one due to that problem (first time I tried to boot with it, it blacked out so I didn't repeat, but now it seemed to work fine for short time), because it's happening over and over. Always when trying to boot with "r-" mode. It just seems that some sessions are issueless(and it can work with protected stick but then it blacks out at some reboot).


Edited by popov, 01 April 2013 - 03:07 PM.


#74 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 April 2013 - 02:44 PM

So, as expected, it is an issue with BIOS.

The DV2718US should be able to ALWAYS boot in the two modes (once the stick has been partitioned/formatted "properly"), what do you mean with "sometimes"?

 

:cheers:

Wonko



#75 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2013 - 02:52 PM

What about MBR2P63S ???






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users