Categories
Fixing Stuff Freenas Samuel

Fixing Freenas Boot Error

We ran into an issue today with our freenas machine, when the machine was starting we received the message:
This is a FreeNAS data disk and can not boot system. System Halted

We restarted the machine, hit F9 to enter BIOS boot setup, and selected our flash drive from the list and pressed enter. The machine then went through its normal boot up sequence, and hung up on this error:


trying to moun root from usf:/dev/ufs/FreeNASs1a
mount /dev/ufs/FreeNASs3 :No such file or directory
-o ro /dev/usf/FreeNASs3 /conf/default/etc failed: dropping into /bin/sh

we then run the command:
zpool status and it shows 0 pools avaliable

we then run the command:
zpool import -f files

this didn’t work either, it could not mount the files. Now we went searching for more help. Looking online it looks like our sand disk drive (where FreeNAS lives has gone bad). We downloaded a copy of FreeNAS From here: http://www.freenas.org/download/

Next we converted the file to be bootable using the program Win32, which can be downloaded from this page: https://launchpad.net/win32-image-writer. Click on “external downloads” button to be taken to download. Once we install Win32 we complete the following steps to make the FreeNAS file bootable:

  • launch Win32DiskImager and use its “browse” button to browse to the location of the .iso 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.
  • plug this USB device into FreeNAS, along with another blank USB device (we will install the operating system on the blank USB device, it can’t be installed directly onto the same USB so we will need 2 devices)
  • After we write to the jump drive I got the error “this device needs to be formatted before it can be used”. So we formatted the device using the windows default tool, and re-installed FreeNASA following the same steps outlined above….

Now were going to install the new version of FreeNAS onto our machine:

  • plug both devices into FreeNAS machine, boot the machine up and hit F12 to select boot device, choose the jump drive…. I got lucky and chose the jump drive with Freenas Installed on it on the first try
  • when we get to the install screen select “install/upgrade” then choose to install FreeNAS on the empty jump drive
  • give the device a root password (the write the root password down on a sheet of paper)
  • select to install FreeNAS with BIOS boot since our hardware is over 5 years old
  • Once the install completes, select to reboot the machine and remove the jump drive with the FreeNAS installer on it, leaving the jump drive that we installed too plugged in

Now is the moment of Truth, we fire the machine back up, let it go through the boot up sequence and hopefully it spits out the IP address we can use to access the web interface….

— Update —

We get the IP address and we can access files but once we import our volume we get a panic error to fix this we need to do:

1.) Reboot Freenas, then When GRUB loads up and asks how to boot FreeNAS, hit the letter “e” on the keyboard to edit.
2.) Go down to the SINGLE USER MODE section and insert two lines. Type in the following into the two lines.

set kFreeBSD.vfs.zfs.recover=1
set kFreeBSD.vfs.zfs.debug=1

3.) Look on the bottom of the screen for instructions. You want to boot by hitting CTRL-X or F10. When it restarts hit single user mode

4.) press enter to start /bin/sh

5.) Now you are ready to start trying to import your pools.

First pass is just trying a straight import:

zpool import -R /mnt poolname

If this works, great. Backup your data and life goes on. In our case we get the error:
can't mount files in use by another system so we run

zpool import -f poolname

If you get a panic then repeat the above steps, but try:

zpool import -o readonly=on -R /mnt poolname

If this works your pool imported read only. Backup your data and life goes on.

As a final desperation move, or after you’ve managed to import the pool readonly and copy everything off you can try:

# zpool import -R /mnt -FX poolname

The above command has a good chance of grenading your pool, but it also has a chance of importing it.

— Useful Links —

https://forums.freenas.org/index.php?threads/zfs-has-failed-you.11951/

https://forums.freenas.org/index.php?threads/unable-to-import-zfs-volume-into-freenas-11.54871/

Categories
Fixing Stuff Freenas Samuel

fixing file permissions for windows on freenas cifs share

So I ran into an issue today where I could not copy a file from my freenas machine down to my local windows machine. The exact error message was:

you need permission to perform this action

you require permission from Unix User\”username” to make changes to this file.

The solution to this problem is to open up your freenas shell window (just navigate to your machine in the browser window, login and hit shell). Once you do that locate the file you want to move and type “chmod 777 filename” and hit enter. That will change the permissions on the file and you will be able to copy it over to your local windows machine.