记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

Burning an IMG File

If your system does not have a CDROM drive to install from, you can instead write the operating system directly to a compact flash card or USB thumbdrive. Download the img.xz file, uncompress the file, and write it to a compact flash card or USB thumbdrive that is 2 GB or larger. You then boot into that device to load the FreeNAS® operating system. This section demonstrates how to write the image using several different operating systems. The Unetbootin tool is not supported at this time.

DANGER! The dd command demonstrated in this section is very powerful and will destroy any existing data on the specified device. Be very sure that you know the device name to write to and that you do not typo the device name when using dd! If you are uncomfortable writing the image yourself, download the .iso file instead and use the instructions in Installing from CDROM.

Once you have written the image to the device, make sure the boot order in the BIOS is set to boot from that device and boot the system. It should boot into the Console setup menu described in the Initial Setup section. If it does not, try the suggestions in the Troubleshooting section.

Contents

 [hide

Using xzcat and dd on a FreeBSD or Linux System

On a FreeBSD or Linux system, the xzcat and dd commands can be used to uncompress and write the .xz image to an inserted USB thumb drive or compact flash device. Example 2.4a demonstrates writing the image to the first USB device (/dev/da0) on a FreeBSD system. Substitute the filename of your .xz file and the device name representing the device to write to on your system.

Example 2.4a: Writing the Image to a USB Thumb Drive

xzcat FreeNAS-9.2.0-RELEASE-x64.img.xz | dd of=/dev/da0 bs=64k 
0+244141 records in
0+244141 records out
2000000000 bytes transferred in 596.039857 secs (3355480 bytes/sec)

When using the dd command:

  • of= refers to the output file; in our case, the device name of the flash card or removable USB drive. You may have to increment the number in the name if it is not the first USB device. On Linux, use /dev/sdX, where X refers to the letter of the USB device.
  • bs= refers to the block size

Using Keka and dd on an OS X System

On an OS X system, you can download and install Keka to uncompress the image. In FINDER, navigate to the location where you saved the downloaded .xz file. Right-click the .xz file and select "Open With Keka". After a few minutes you will have a large file with the same name, but no .xz extension.

Insert the USB thumb drive and go to Launchpad → Utilities → Disk Utility. Unmount any mounted partitions on the USB thumb drive. Check that the USB thumb drive has only one partition, otherwise you will get partition table errors on boot. If needed, use Disk Utility to setup one partition on the USB drive; selecting "free space" when creating the partition works fine.

Next, determine the device name of the inserted USB thumb drive. From TERMINAL, navigate to your Desktop then type this command:

diskutil list
/dev/disk0
  #:        TYPE NAME            SIZE       IDENTIFIER
  0:   GUID_partition_scheme    *500.1 GB   disk0
  1:                     EFI     209.7 MB   disk0s1
  2:  Apple_HFS Macintosh HD     499.2 GB   disk0s2
  3:  Apple_Boot Recovery HD     650.0 MB   disk0s3  
 /dev/disk1
  #:        TYPE NAME            SIZE       IDENTIFIER
  0:  FDisk_partition_scheme    *8.0 GB     disk1
  1:     DOS_FAT_32 UNTITLED     8.0 GB     disk1s1

This will show you which devices are available to the system. Locate your USB stick and record the path. If you are not sure which path is the correct one for the USB stick, remove the device, run the command again, and compare the difference. Once you are sure of the device name, navigate to the Desktop from TERMINAL, unmount the USB stick, and use the dd command to write the image to the USB stick. In Example 2.4b, the USB thumb drive is /dev/disk1. Substitute the name of your uncompressed file and the correct path to your USB thumb drive.

Example 2.4b: Using dd on an OS X System

diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
dd if=FreeNAS-9.2.0-RELEASE-x64.img of=/dev/disk1 bs=64k

NOTE:if you get the error "Resource busy" when you run the dd command, go to Applications → Utilities → Disk Utility, find your USB thumb drive, and click on its partitions to make sure all of them are unmounted. If you get the error "dd: /dev/disk1: Permission denied", run the dd command by typing sudo dd if=FreeNAS-9.2.0-RELEASE-x64.img of=/dev/disk1 bs=64k, which will prompt for your password.

The dd command will take some minutes to complete. Wait until you get a prompt back and a message that displays how long it took to write the image to the USB drive.

Using 7-Zip and Win32DiskImager on Windows

Windows users will need to download a utility that can uncompress .xz files and a utility that can create a USB bootable image from the uncompressed .img file.

This section will demonstrate how to use 7-Zip and Win32DiskImager to burn the image file. When downloading Win32DiskImager, download the latest version that ends in -binary.zip and use 7-Zip to unzip its executable.

Once both utilities are installed, launch the 7-Zip File Manager and browse to the location containing your downloaded .img.xz file, as seen in Figure 2.4a.

Figure 2.4a: Using 7-Zip to Extract Image File

7zip1d.png

Click the Extract button, browse to the path to extract to, and click OK. The extracted image will end in .img and is now ready to be written to a USB device using Win32DiskImager.

Next, launch Win32DiskImager, shown in Figure 2.4b. Use the browse button to browse to the location of the .img file. Insert a USB thumb drive and select its drive letter from the Device drop-down menu. Click the Write button and the image will be written to the USB thumb drive.

Figure 2.4b: Using Win32DiskImager to Write the Image

Win32e.png

Troubleshooting

If the system does not boot into FreeNAS®, there are several things that you can check to resolve the situation.

First, check the system BIOS and see if there is an option to change the USB emulation from CD/DVD/floppy to hard drive. If it still will not boot, check to see if the card/drive is UDMA compliant.

Some users have found that some brands of 2 GB USB sticks do not work as they are not really 2 GB in size, but changing to a 4 GB stick fixes the problem.

If you are writing the image to a compact flash card, make sure that it is MSDOS formatted.

If the system starts to boot but hangs with this repeated error message:

run_interrupt_driven_hooks: still waiting after 60 seconds for xpt_config

go into the system BIOS and see if there is an onboard device configuration for a 1394 Controller. If so, disable the device and try booting again.

If the burned image fails to boot and the image was burned using a Windows system, wipe the USB stick before trying a second burn using a utility such as Active@ KillDisk. Otherwise, the second burn attempt will fail as Windows does not understand the partition which was written from the image file. Be very careful that you specify the USB stick when using a wipe utility!



转载请标明出处【FreeNAS Burning an IMG File( IMG 启动盘制作方法)】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论