Recipes » Create a Bootable Flash Key

Create a Bootable Flash Key

Last modified by Administrator on 2011/06/06 17:26

Create a Bootable Flash Key

ProxySG

On Linux machines (and in Cygwin) there is a command dd that can create a bootable memory volume (e.g. a flash key). To avoid any risk that such a command will erase a Window's computer hard drive, another program - dd-removable is recommended. It works similarly to a "dd", but can format only those disks that are removable.

On Windows

  1. Make sure to unzip your build image with WinZip (or other archive tool). The build image file must end in .img and be 512MB in size. If your build image ends in .gz, it needs to be unzipped before it can be written.
  2. Insert USB Key (Windows will mount it)
  3. use dd-removable --list to get the device name. It'll look something like this:
    \\?\Device\Harddisk1\Partition0
    NOTE: no trailing backslash
  4. Run the following command:
    dd-removable if=< image location >\< image file > of=< USB device name > bs=1M
  5. The following is an example of the correct syntax that works:
    dd-removable bs=1M if=PISA_Phoenix_Trunk_1748_20061114.usb.img
    of=\\?\Device\Harddisk1\Partition0 --progress
Warning: It's very important to select the correct device for output. Choosing the wrong device (like your primary hard disk) will have dire consequences (losing all your primary hard drive data). To mediate this risk, I renamed the dd.exe program to dd-removable.exe, which is supposed to only allow dd to write to removable disks. I've tested that this indeed works, and I was unable to write to the primary hard disk. The USB key will be listed as a removable device. After the image write is complete you'll need to remove and re-insert the USB key for the files to be viewable in Windows.
  1. To check the written image, remove the USB key via the Safely Remove Hardware dialog and attach it again. Otherwise you won't see the changes to the flash key.

Cygwin instruction

  1. Find the usb partition information: On your Cygwin window, cat /proc/partitions shows the partitions. For example, before the USB key is attached, it looks like this:
    [bluecoat-a62220;] cat /proc/partitions   
    major minor  #blocks  name
        8     0 29302560 sda
        8     1  9100791 sda1
        8     2 20201706 sda2
    After the USB key is attached:
    [bluecoat-a62220;] cat /proc/partitions
    major minor  #blocks  name
        8     0 29302560 sda
        8     1  9100791 sda1
        8     2 20201706 sda2
       8    16    64000 sdb
        8   17         8 sdb1
  2. Notice the new entries sdb and sdb1 got added, this tells us that the /dev/sdb is the right one to use.
  3. Now use the "dd" command in cygwin to create a bootable disk. For example,
    wget http://buildarchive.bluecoat.com/builds/sgme_5_4.38189/img/SGME_Sigma_38189_3417_20090316.usb.img.gz
    gunzip SGME_Sigma_38189_3417_20090316.usb.img.gz
    dd if= SGME_Sigma_38189_3417_20090316.usb.img.gz of=/dev/??(sda or sdb or any other) bs=1M

Links

  1. http://www.chrysocome.net/dd

Tags:  

Tags:
Created by Kalvis Apsītis on 2009/08/04 15:34

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 3.0.36132 - Documentation