Jump to content











Photo

How to Write-Protected you USB-HDD and UFD


  • Please log in to reply
6 replies to this topic

#1 wooShadow

wooShadow

    Newbie

  • Members
  • 16 posts

Posted 19 February 2011 - 10:35 AM

I. First method protected with Diskpart

Diskpart in Windows 2003 R2/Vista/7 have a magic function

1. For LiveXP include in you project this script Virtual Disk Services( required by Diskpart, download here,
use as source win2003R2 ), and USB Mass Storage Dummy Filter Driver. Build you Project, Boot in Live2003(liveXP)
you can use WinPE Vista/7, or Win7PE SE

2. run ->Diskpart

3. important! verify if you drive is recognized by diskpart as disk (For UFD)


DISKPART> list disk



  Disk ###  Status      Size     Free     Dyn  Gpt

  --------  ----------  -------  -------  ---  ---

  Disk 0    Online        12 GB      0 B

  Disk 1    Online      8189 MB      0 B

  Disk 2    Online       973 MB      0 B           <- this is my UFD



4. DISKPART> list vol



  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info

  ----------  ---  -----------  -----  ----------  -------  ---------  --------

  Volume 0     D   new HDD      NTFS   Partition   5193 MB  Healthy

  Volume 1     F                RAW    Partition   2996 MB  Healthy

  Volume 2     X   LiveXP       CDFS   CD-ROM       183 MB  Healthy    Boot

  Volume 3     C   system       NTFS   Partition     10 GB  Healthy

  Volume 4     E                NTFS   Partition   2283 MB  Healthy

  Volume 5     H   USBREADONLY  FAT32  Partition    973 MB  Healthy  		    <- this is volume on my UFD



5. DISKPART> select vol 5



Volume 5 is the selected volume.



6. DISKPART> att vol set readonly 



Volume attributes set successfully.



Note: For master boot record (MBR) basic disks, the attribute bits are applied or changed disk-wide and affect all volumes on the disk.



7.Verify readonly attribute 



DISKPART> detail volume



  Disk ###  Status      Size     Free     Dyn  Gpt

  --------  ----------  -------  -------  ---  ---

* Disk 2    Online       973 MB      0 B



Readonly               : Yes

Hidden                 : Yes

No Default Drive Letter: No

Shadow Copy            : No


write potected work with file system FAT, FAT32, NTFS,
exFAT not tested

After set readonly atribute File System Work like program Shadow Defender, you can copy files to you protected drive, but after first reboot all files deleted!

Clear write-protection

Diskpart> att vol clear readonly


Screenshot
Posted Image

about Diskpart commands
http://support.microsoft.com/kb/840781

Of course write-protected not work under Linux

--------------------------------------------------------------------------------------------------------------------

II. Second method protected with FBWF - protected USB Flash Drive or USB Hard Disk tested with liveXP/2003

windows 7 not tested

1. set write protected with Diskpart to you USB Flash Drive or USB Hard Disk , see first method
(this is very important stage because FBWF not work if you USB-HDD/UFD is not write protected!!!)

2. Include in you project USB Mass Storage Dummy Filter Driver script, is need for UFD, but not for USB-HDD
this driver is necesary for convert UFD to disk

3. Build LiveXP Project, detail read post here

4. run script wimboot ; 5. modify CreateISO.script

in section If,%ok%,Equal,1,Run,%ScriptFile%,Process-do repaces with If,%ok%,Equal,1,Run,%ScriptFile%,Process-do2

add this lines

[Process-do2]
RegHiveLoad,WB_setup,%target_sys%\setupreg.hiv
RegWrite,HKLM,0x4,WB_setup\ControlSet001\Services\fbwf,WinPECacheThreshold,%pTextBox2%
RegHiveUnLoad,WB_setup

6. set cache to 300MB ; 7. run script CreateISO

8. download/use Bootable USB format utility -RMPrepUSB/BootICE or Fuwi USB-BootUtilities, i use RMPrepUSB

9. prepare UFD & USB HDD with - partition/format/install G4DOS... In RMPrepUSB use set option copy OS files to USB, rename i386 to MININT

10. Final. Boot from UFD or USB-HDD

after boot free space of you UFD = size of FBWF cache

you can copy only 263MB Compressed files(zip,wim...), but uncompressed more than 263MB !


Screenshot

Posted Image

I not tested with boot FULL Windows XP/2003 from USB or others methods of boot Windows XP/2003 from .IMG or .VHD,
but exist high probability to work with this method.

#2 mobile hawk

mobile hawk
  • Members
  • 1 posts
  •  
    India

Posted 20 March 2011 - 09:31 AM

hi i am trying to do the same as u told in ur tut but still stuck at step 1
I had cerated a 4gb pendrive to install multiple os from 1 drive and i want to writeprotect it
I am using win 7 ultimate on my system and when i use diskpart it shows my pendrive as removable and don't make it read only
i had downloaded the script but does'nt know how to use it
Please Help i am in real need to writeprotect my pendrive
my pendrive shows as hdd in bios

Edited by mobile hawk, 20 March 2011 - 09:36 AM.


#3 Sakthianbesivam Anbesivam

Sakthianbesivam Anbesivam
  • Members
  • 1 posts
  •  
    India

Posted 17 June 2011 - 04:33 AM

have a great life

#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 17 June 2011 - 10:32 AM

Just for the record, cross-linking to:
http://www.911cd.net...showtopic=24390
http://www.911cd.net...pic=24390&st=13

:dubbio:
Wonko

#5 sara - pmedia

sara - pmedia

    Frequent Member

  • Lady
  • 184 posts
  • Location:tel aviv
  •  
    Israel

Posted 17 June 2011 - 12:53 PM

Thanks for the nice explanation but tel me one thing.
Why not easier to use ewf?

#6 al_jo

al_jo

    Gold Member

  • Members
  • 1218 posts
  • Location:Tellus

Posted 17 June 2011 - 03:31 PM

Don’t know if this “USB Write Protect” app is better or worse,
then the method described in first post, but it looks nice:
http://www.nareshmdr...info&soft=usbwp
and is working just fine here. And it’s quick & easy to use…

:dubbio:

#7 steve6375

steve6375

    Platinum Member

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

Posted 08 January 2013 - 05:42 PM

If your USB pen has an SMI controller it may work with the SMI_UFDiskUtility - I have written up a description of this utility here.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users