How to write the embedded FreeNAS 8 image under Windows

Status
Not open for further replies.

John Doe

Guru
Joined
Aug 16, 2011
Messages
635
If you have a writtenWrite error

If you have an error like this :

******/1000000000 bytes writtenWrite error after ****** bytes.

You should clean the Boot Record :

1. Open a command prompt with administrative rights

2. Execute those commands (you must fit to your configuration ; X is your flash drive number)
Code:
c:\FreeNAS> diskpart

DISKPART> list disk

DISKPART> select disk X

DISKPART> clean

DISKPART> exit


3. Re-execute physdiskwrite
Code:
physdiskwrite.exe –u FreeNAS


Now, it should work ! :)

Thank a lot for this tutorial.
 

John Doe

Guru
Joined
Aug 16, 2011
Messages
635
@alesga
Code:
physdiskwrite.exe -u FreeNAS


FreeNAS is the name of your image.

For me, after extracting the XZ archive, the name of the FreeNAS image was being "FreeNAS-8.0.1-RC2-amd64-Full_Install".

So...
Code:
physdiskwrite.exe -u FreeNAS-8.0.1-RC2-amd64-Full_Install
 

edaimald

Cadet
Joined
Sep 28, 2011
Messages
1
Hi there !

I strictily followed instruction of the thread, as you can see below everything ended well :
I used FreeNAS-8.0-RELEASE-i386.Full_Install.xz

c:\FreeNAS>diskpart

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
Sur l'ordinateur : CHEVAMOBILE

DISKPART> list disk

N° disque Statut Taille Libre Dyn GPT
--------- ------------- ------- ------- --- ---
Disque 0 En ligne 298 G octets 1024 K octets
Disque 1 En ligne 3814 M octets 0 octets

DISKPART> select disk 1

Le disque 1 est maintenant le disque sélectionné.

DISKPART> list partition

N° partition Type Taille Décalage
------------- ---------------- ------- --------
Partition 1 Principale 3812 M 64 K

DISKPART> clean

DiskPart a réussi à nettoyer le disque.

DISKPART> exit

Quitte DiskPart...

c:\FreeNAS>physdiskwrite.exe -u FreeNAS

physdiskwrite v0.5.2 by Manuel Kasper <mk@neon1.net>

Searching for physical drives...

Information for \\.\PhysicalDrive0:
Windows: cyl: 620181
tpc: 16
spt: 63
C/H/S: 16383/16/63
Model: WDC WD3200BEVT-22ZCT0
Serial number: WD-WXE408ER1834
Firmware rev.: 11.01A11

Information for \\.\PhysicalDrive1:
Windows: cyl: 486
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
1000000000/1000000000 bytes written in total


When I try to boot on my usb key I got this :

Not ufs
Not ufs
No /boot/loader

FreeBSD/x86 boot
Default : 0:fd(0,a)/boot/kernel/kernel
boot:
Not ufs
No /boot/kernel/kernel

FreeBSD/x86 boot
Default : 0:fd(0,a)/boot/kernel/kernel
boot:

Is someone can help me??
 

mwoliver

Cadet
Joined
Sep 30, 2011
Messages
1
I had written up my process of writing the Full Install image to USB flash on Windows and subsequently copying that from the USB flash to IDE CF in my NAS box. The write-up is here:

http://rfandip.blogspot.com/2011/07/freenas-8-getting-out-of-my-comfort.html

The gist of it (for those not wanting to read the whole blog post) was to pipe the `xz` decompress output to `dd` under Cygwin rather than using some Windows-based disk writing tool. I find those tools to be flaky sometimes, and besides this allowed me to create the USB flash directly without having to decompress the Full Install image prior to writing. Yay for Cygwin and pipes!

I am following nearly the same process to bump to 8.0.1-RC2 right now, albeit with modified `dd` options due to the increase in image size to 2GB (3906250 records of 512 bytes each).
 

Custler

Cadet
Joined
Aug 14, 2011
Messages
4
I use very comfortable and simple tool "USB Image Tool" - http://www.alexpage.de/usb-image-tool/

capture0012310201108594.jpg
 

Hi-Liter

Explorer
Joined
Oct 6, 2011
Messages
83
Hi,

I just used Win32 Image Writer after I unpacked the embbeded file and renamed it to .img

In Win32 image writer you select your img file and then you select the drive to install the img file too.
This worked like a charm for me as well, I can only recommend using this tool, especially since physdiscwrite did not work for me.
Another Tool which helped me a lot was "HP USB Disk Storage Format Tool" (http://download.cnet.com/HP-USB-Disk-Storage-Format-Tool/3000-2094_4-10974082.html). I could use it to restore my USB Stick when it got completely screwed up using physdiscwrite and I couldn't format it using Windows.
 

Darkside

Cadet
Joined
Oct 25, 2011
Messages
1
I had problems with formatting and was getting write errors as well. Here are the steps I found that were successful:

1. Insert your flash drive.
2. Hit Win-R and type cmd to open a command-line.
3. Type diskpart to run Windows DiskPart utility.
4. Type list disk to list all disks attached to the machine.
5. Type select disk [number] to select your flash drive.
6. Type clean to remove any formatting from the selected disk.
7. Type create partition primary.
8. Type select partition 1 to select the only partition, which you now have on the flash drive.
9. Type active to mark the partition as active.
10. Type format fs=fat32 to format the disk in FAT32 (otherwise the drive will not be bootable).
11. Type assign to assign a drive letter.
13. Type exit to exit Windows DiskPart utility.
14. physdiskwrite.exe –u FreeNAS (assuming you renamed your image to FreeNAS after extracting the FreeNAS-8.0.1-RELEASE-i386-Full_Install.xz with 7-Zip)
 

shinigaimi

Cadet
Joined
Nov 9, 2011
Messages
8
this worked for me!! sweet!!! Thank!
If you have an error like this :

******/1000000000 bytes writtenWrite error after ****** bytes.

You should clean the Boot Record :

1. Open a command prompt with administrative rights

2. Execute those commands (you must fit to your configuration ; X is your flash drive number)
Code:
c:\FreeNAS> diskpart

DISKPART> list disk

DISKPART> select disk X

DISKPART> clean

DISKPART> exit


3. Re-execute physdiskwrite
Code:
physdiskwrite.exe –u FreeNAS


Now, it should work ! :)

Thank a lot for this tutorial.
 
Joined
Nov 20, 2011
Messages
8
Darkside,
I'd propose adding a step in this. Add a new 14 and move 14 to 15:

1. Insert your flash drive.
2. Hit Win-R and type cmd to open a command-line.
3. Type diskpart to run Windows DiskPart utility.
4. Type list disk to list all disks attached to the machine.
5. Type select disk [number] to select your flash drive.
6. Type clean to remove any formatting from the selected disk.
7. Type create partition primary.
8. Type select partition 1 to select the only partition, which you now have on the flash drive.
9. Type active to mark the partition as active.
10. Type format fs=fat32 to format the disk in FAT32 (otherwise the drive will not be bootable).
11. Type assign to assign a drive letter.
13. Type exit to exit Windows DiskPart utility.
14. Use the H2testw util from http://www.heise.de/software/download/h2testw/50539 to validate the flash drive, and delete the file created when done.
15. physdiskwrite.exe –u FreeNAS (assuming you renamed your image to FreeNAS after extracting the FreeNAS-8.0.1-RELEASE-i386-Full_Install.xz with 7-Zip)
 
Joined
Nov 20, 2011
Messages
8
Here is what a failed test looks like:

Code:
Error reading file 'E:\4.h2w', offset 0xc00000.
(Data error (cyclic redundancy check). Code 23)
Warning: Only 3822 of 3823 MByte tested.
The media is likely to be defective.
3.0 GByte OK (6309873 sectors)
3.0 MByte DATA LOST (6159 sectors)
Details:512 KByte overwritten (1024 sectors)
0 KByte slightly changed (< 8 bit/sector, 0 sectors)
2.5 MByte corrupted (5135 sectors)
512 KByte aliased memory (1024 sectors)
First error at offset: 0x00000000146cf600
Expected: 0x00000000146cf600
Found: 0x00000000165af000
H2testw version 1.3
Reading speed: 15.7 MByte/s
H2testw v1.4
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Good info guys, I'll have to add a pointer to this thread in the FAQ, I'm a bit behind.
 

Schifty1

Cadet
Joined
Dec 11, 2011
Messages
4
4GB USB Stick On Release 802

Hi Guys,

Very good information in this thread. I tried to follow ALL the instructions and used the physdiskwrite method, with a diskpart "clean" on a Win 7 machine. I did have a difference in that it showed 2000000000000, and the counter incremented until the other side matched (2000000000000..).

However, when I put the USB stick in the FreeNAS machine and went to boot, i just got a message "no boot device". Can someone tell me what went wrong??? What should I try now???

Thanks in advance for your help.

Regards Schifty1
 

flyboymax

Cadet
Joined
Dec 31, 2011
Messages
2
Some trouble

after trying the steps from the first tutorial i couldn't get physdiskwrite to open the image file. So instead of downloading FreeNAS-8.0-RELEASE-i386.Full_Install.xz I downloaded FreeNAS-8.0.2-RELEASE-amd64.iso.
1. Opened with ultraiso and then extracted FreeNAS-amd64-embedded.xz
2. Then extracted with 7-zip

to get the usb to work I used darkside's steps below:

I had problems with formatting and was getting write errors as well. Here are the steps I found that were successful:

1. Insert your flash drive.
2. Hit Win-R and type cmd to open a command-line.
3. Type diskpart to run Windows DiskPart utility.
4. Type list disk to list all disks attached to the machine.
5. Type select disk [number] to select your flash drive.
6. Type clean to remove any formatting from the selected disk.
7. Type create partition primary.
8. Type select partition 1 to select the only partition, which you now have on the flash drive.
9. Type active to mark the partition as active.
10. Type format fs=fat32 to format the disk in FAT32 (otherwise the drive will not be bootable).
11. Type assign to assign a drive letter.
13. Type exit to exit Windows DiskPart utility.
14. physdiskwrite.exe –u FreeNAS (assuming you renamed your image to FreeNAS after extracting the FreeNAS-8.0.1-RELEASE-i386-Full_Install.xz with 7-Zip)

Afterwards ran physdiskwrite and got a write error. Unpluged usb and then ran it again. Everything worked.

I used Windows 7 with a dane elec 4GB usb.
 

Richard J

Cadet
Joined
Jan 27, 2012
Messages
1
STUCK ON IMage

If I could elaborate a bit (the run as Administrator thing needs to be more explicit).

First make sure the USB stick is physically big enough. You should use at least 2GB, preferably 4GB, because the USB drive should be capable of holding at least two images, the current image and a second image wen the occasion comes to upgrade your version of FreeNAS.

Second extract your full install image to a simply named directory, something like "Install" (only seven characters long), on a disk of your choice in your system. Give the extracted image a simple name such as "freenas8" (only 8 characters long). The simple names make it easier to navigate to the working directories while running from the command line.

Third download physdiskwrite from m0n0wall. Extract and install physdiskwrite in the Install directory.

Make sure you invoke the command prompt as an Administrator (right click on the command prompt icon and select "run as Administrator"). Failure to do this will result in physdiskwrite not finding your target drive, with you potentially wiping out your main disk drive.

Fourth navigate to the directory containing both physdiskwrite and freenas8.

Fifth follow the instructions for using diskpart on the m0n0wall page (referenced above). This will ensure the USB stick is emptied and with no partitions.

Sixth run physdiskwrite -u freenas8 and follow the prompts to enter the physical disk number (which you will discover when you run diskpart).

In my case the end result was:
Which disk do you want to write? <0..2> 2
WARNING: that disk is larger than 2GB! 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
1000000000/1000000000 bytes written in total


Seventh eject the USB drive, then remove it from your PC and install it into your target system, boot from the USB drive and start the installation and configuration work.





~~ hello: ~~
I've tried to make a boot able "LIVE" CD but that failed. now, I tried to create a USB disk in windows. I have an XP machine and I had read the instructions OVER AND OVER again. I traced my steps following the instructions and again, nothing. I get to the "about to auto write the contents of disk 2 with new data" and select "y". this is where it fails.

any help will do
 

flyboymax

Cadet
Joined
Dec 31, 2011
Messages
2
Hi!

~~ hello: ~~
I've tried to make a boot able "LIVE" CD but that failed. now, I tried to create a USB disk in windows. I have an XP machine and I had read the instructions OVER AND OVER again. I traced my steps following the instructions and again, nothing. I get to the "about to auto write the contents of disk 2 with new data" and select "y". this is where it fails.

any help will do

I believe I had the a similar problem. However I don't know who's directions you have followed. I found that doing these steps to get the image fixed my problem while following the rest of the tutorial. Instead of FreeNAS-8.0.2-RELEASE-amd64.iso though you might want the 32bit version.

after trying the steps from the first tutorial i couldn't get physdiskwrite to open the image file. So instead of downloading FreeNAS-8.0-RELEASE-i386.Full_Install.xz I downloaded FreeNAS-8.0.2-RELEASE-amd64.iso.
1. Opened with ultraiso and then extracted FreeNAS-amd64-embedded.xz
2. Then extracted with 7-zip
 

Illanair

Dabbler
Joined
Mar 19, 2012
Messages
12
Slightly noob question : Is this procedure is an INSTALLATION of FreeNAS onto the destination - not simply copying the installation files to a destination drive? (so I can boot that instead of the CD for installation on another machine)

Reason for me asking is that I don't have a drive that can burn discs, but I have a SATA harddrive that is supposed to run FreeNAS but on another computer - so basically I need to install FreeNAS on the other machine from USB (or another machine) since I cannot boot the .iso from the BIOS.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You can install FreeNAS to the USB from another machine and then take the USB to the actual machine that will be your FreeNAS machine.
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
You can install FreeNAS to the USB from another machine and then take the USB to the actual machine that will be your FreeNAS machine.

You know, I actually had quite a bit of trouble finding this out when I started. All the guides I'd read seemed to imply it needed to be done on the machine you'd run on. Or rather, given that I had that question in my head, none of them were explicit against my uncertainty. They all said things like "If you don't have a CD-ROM drive on the machine, temporarily connect one" or "Get an external/usb burner" or some such variation. I finally just broke down and tried making the flash drive on another machine with a CD-ROM drive, then carrying it over to the FreeNAS machine. I didn't really expect it to work, but it did.

My uncertainty was because I wasn't familiar with *NIX (certainly not FreeBSD), but OS's in general can be installed in a way where they do their hardware configuration during bootup, or they can scan the machine they're on and do a lot of it during install. Windows does some combination of both, to the point where I've seen some people successfully move a Windows boot drive to another machine and have it boot OK. But I've also seen people try that and fail miserably (the machine is too different from the machine it was installed on).

Anyway, I just thought I'd mention it here because I really did probably spend about 3-4 (wall) hours trying to figure it out before I reached my own internal research time limit and just tried it.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
You know, I actually had quite a bit of trouble finding this out when I started. All the guides I'd read seemed to imply it needed to be done on the machine you'd run on. Or rather, given that I had that question in my head, none of them were explicit against my uncertainty.
Don't be so timid. :eek: Once you understand the CD install is just Burning an IMG File it makes sense. Of course I've always used the .img file.

Stephens is the current documentation still unclear about this? If so suggest a change? It might save other people some wasted searching.
 
Status
Not open for further replies.
Top