Wednesday, June 20, 2012

How to install FreeNas to run from a USB stick, Proliant N40L

You will need the following tools

- A zip extractor, such as WinRAR, WinZip or 7zip

- PhysDiskWrite (at this time, it is physdiskwrite 0.5.2.zip)
This allows you to write the disk image to the USB stick

- The FreeNas ISO image. 
In my case, I downloaded FreeNAS-8.3.0-RC1-x64.img.xz 
This is the newest version at this time. You may find a newer version. 
The important bit is to download a full install version and not an *update*.
For example, do not download FreeNAS-8.3.0-RC1-x64.GUI_Upgrade.xz


1) Create a temp directory, say C:\dooda

2) Extract the contents of physdiskwrite 0.5.2.zip into c:\dooda

3) using your favourite zip extractor, extract the contents of the FreeNas XZ image into c:\dooda

4) rename whatever came out of the XZ file into something simple, say FreeNAS.img.

5) Open a command prompt (as administrator) in c:\dooda

6) type physdiskwrite.exe -u FreeNAS.img and look very carefully at the displayed results. In my case, I see the following
physdiskwrite v0.5.2 by Manuel Kasper <mk@neon1.net>
Searching for physical drives...
Information for \\.\PhysicalDrive0:
   Windows:       cyl: 14593
                  tpc: 255
                  spt: 63
Information for \\.\PhysicalDrive1:
   Windows:       cyl: 243201
                  tpc: 255
                  spt: 63
   C/H/S:         16383/16/63
   Model:         ST2000DM001-9YN164
   Serial number:          
   Firmware rev.: CC4C
Information for \\.\PhysicalDrive2:
   Windows:       cyl: 981
                  tpc: 255
                  spt: 63
Which disk do you want to write? (0..2)  2  
WARNING: that disk is larger than 2 GB! Make sure you're not accidentally
overwriting your primary hard disk! Proceeding on your own risk...
About to overwrite the contents of disk 2 with new data. Proceed? (y/n) y
You need to decide which of the drives shown is the one to dump the FreeNas image on.
Whatever drive you select will be totally overwritten. Totally!
Select carefully!

I can see that drive 2 is the smallest drive (8GB), i.e. my USB stick, so I enter '2' and press ENTphydER.

Please note that there mustn't be any partitions at all on the USB stick.
If there are, you will get an error complaining that it failed to write after 0 bytes (or some such).
To completely empty the USB stick, do the following
1) Open a command prompt (but do so as an admin)

2) Enter diskpart

3) Enter List disk
(this will list your disks and allow you to find the drive number of your USB stick)

4) Enter Select disk N         
(where N is the disk number of the USB stick. See screen dump and notes above)

5) Enter Clean

Done!

You can now install FreeNas on your hardware by booting on your newly-created USB stick.

In my case it is an HP Proliant N40L.
I have updated its BIOS as described in this article.
FreeNas v8 tips and tricks can be found here.
How to mount an external USB disk


Enjoy!


ps: Comments and/or links to this article are most welcome!

14 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. What shall i do if i don't get these lines:
    Information for \\.\PhysicalDrive0:
    Windows: cyl: 14593
    tpc: 255
    spt: 63
    Information for \\.\PhysicalDrive1:
    Windows: cyl: 243201
    tpc: 255
    spt: 63
    C/H/S: 16383/16/63
    Model: ST2000DM001-9YN164
    Serial number:
    Firmware rev.: CC4C
    Information for \\.\PhysicalDrive2:
    Windows: cyl: 981
    tpc: 255
    spt: 63

    ReplyDelete
    Replies
    1. None at all??? Aren't there any disks connected to the system?

      Delete
    2. I opened the cmd as administrator and got those lines. Thanks for the instructions.

      Delete
  3. How to restore my usb stick so windows can see it again?

    ReplyDelete
    Replies
    1. I can't test this but from memory (in Win7), right-click on MyComputer, Manage, DiskManagement.
      Find the USBdisk in the list and delete whatever may be there then create a new volume.

      Delete
  4. Im getting:
    C:\temp>physdiskwrite.exe -u FreeNAS
    physdiskwrite v0.5.2 by Manuel Kasper
    Searching for physical drives...
    Which disk do you want to write? (0..0)
    I have a number of flash drives plugged in at the time. Any ideas?

    ReplyDelete
    Replies
    1. if you right-click on
      Computer -> Manage -> Disk Management,
      dο you see your USB disks?

      Delete
    2. Have to run the CMD prompt as administrator, or it will not show any disks.

      Delete
  5. I get this:
    physdiskwrite v0.5.2 by Manuel Kasper

    Searching for physical drives...

    Information for \\.\PhysicalDrive0:
    Windows: cyl: 60801
    tpc: 255
    spt: 63
    Information for \\.\PhysicalDrive1:
    Windows: cyl: 973
    tpc: 255
    spt: 63

    Which disk do you want to write? (0..1) 1
    WARNING: that disk is larger than 2 GB! Make sure you're not accidentally
    overwriting your primary hard disk! Proceeding on your own risk...
    About to overwrite the contents of disk 1 with new data. Proceed? (y/n) y
    Failed to open FreeNAS - exiting.

    I extracted the XZ file which was simply the nearly 2GB iso file!

    any ideas?

    ReplyDelete
    Replies
    1. It's hard for me to tell what's happening.
      Did you specify the full name of the file extracted from the XZ file?
      It sounds like it cannot find it. Is it a zero-length file (ie did the extract fail)?

      Delete
    2. Solved, maybe. The file is writing!
      In my case I had to declare the full name of the file

      physdiskwrite.exe -u FreeNAS.img

      The ".img" was essential!

      Delete
  6. This isn't installing FROM usb, its installing TO.

    You can install from a usb to another usb mounted inside (as if the usb installer was a cd per se)

    ReplyDelete
    Replies
    1. I see your point. I have now changed the heading to suit

      Delete