FreeNAS 8 will not boot after power failure?

Status
Not open for further replies.

began

Cadet
Joined
Dec 7, 2012
Messages
3
recently had a power outage and noticed today that my FreeNAS 8.0.2(?) box was offline. On examination, seeing this:

FreeBSD/x86 bootstrap loader, Revision 1.1
(root@build.ixsystems.com, Thu Jul 19 12:36:10 PDT 2012
Loading /boot/defaults/loader.conf
/boot/kernel/kernel text=0x817107 inflate: invalid code lengths set

readin failed

elf64_loadimage: read failed



hoping that this is recoverable, but very new to FreeNAS so don't know where to begin.

thanks for any guidance,
began
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Failed (or corrupted) flash. Completely recoverable.

Get a new 4GB or larger flash. Write the 8.0.2 image (really, do NOT try to upgrade). Boot.

Once booted, you can /probably/ insert the old key as well and then recover the config you had, unless you happen to have a copy, in which case just upload the config and back to happyland.

To recover the old key, you need to identify what disk device it is. I usually do this by inserting it, waiting a bit, type "dmesg" at the command prompt, and seeing what disk device just popped up new. It'll then be on "/dev/${foo}s4" which you probably want to do a "fsck -n" on to see if there's any serious damage. We can walk you through it if needed.
 

BobCochran

Contributor
Joined
Aug 5, 2011
Messages
184
You may want to connect your system to an uninterruptible power supply -- a UPS. This is also a good reminder to me to replace the batteries in my own UPS.
 

began

Cadet
Joined
Dec 7, 2012
Messages
3
Failed (or corrupted) flash. Completely recoverable.

Get a new 4GB or larger flash. Write the 8.0.2 image (really, do NOT try to upgrade). Boot.

Once booted, you can /probably/ insert the old key as well and then recover the config you had, unless you happen to have a copy, in which case just upload the config and back to happyland.

To recover the old key, you need to identify what disk device it is. I usually do this by inserting it, waiting a bit, type "dmesg" at the command prompt, and seeing what disk device just popped up new. It'll then be on "/dev/${foo}s4" which you probably want to do a "fsck -n" on to see if there's any serious damage. We can walk you through it if needed.

So, i should rephrase the original problem. it appears that the scaled down FreeBSD OS(ish) actually boots, but it wont load my FreeNAS config. I can do an ls and a ? for a list of commands (heap, reboot, autoboot, boot, lsdev, etc...) and I dont have a problem reloading to a new USB key. But now i am questioning which version i was running. I found my original install dvd, and it was 8.0.4x64, but i know that I did an upgrade at one point. Perhaps to 8.2. I *did* have multiple configs on the USB.... how can I tell from within this OS what version of the FreeNAS code i was running?

thanks very much for guidance.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
So if you can boot your original USB flash drive then you use the console to open a shell and then type
Code:
uname -a

Examine the output and it will tell you which version of FreeNAS you are using.

If you didn't have a huge configuration change form the initial installation then you don't need to recover the config fine, just redo your setup. For your pool, select Auto-Import and it should come back to you.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Actually "uname -a" give you the FreeBSD version. The FreeNAS version is in /etc/version.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
uname -a gives you this...

Code:
[root@freenas] ~# uname -a
FreeBSD freenas.local 8.3-RELEASE-p4 FreeBSD 8.3-RELEASE-p4 #0 r241984M: Wed Oct 24 00:57:10 PDT 2012
root@build.ixsystems.com:/usr/home/jpaetzel/8.3.0-RELEASE/os-base/amd64/usr/home/jpaetzel/8.3.0-RELEASE/FreeBSD/src/sys
/FREENAS.amd64  amd64

so yes it does give you the FreeBSD version but you can also see it gives you the FreeNAS version. In my example it's "8.3.0-RELEASE".
 

began

Cadet
Joined
Dec 7, 2012
Messages
3
guess i should rephrase again.... it doesnt boot into a fully functional FreeBSD instance. it boots into some scaled-down 'recovery console' (for lack of a better term.) so uname command doesnt exist. either way, i've reinstalled 8.2 onto a new flash stick. My FreeNAS config was extremely simple - 2 CIFS shares. Havent gotten around to setting up iSCSI or NFS to use with ESXi so I am fine reconfiguring by hand (and have already started that) but I *did* pop the old key in and see this:
Code:
ugen3.2: <PNY Technologies> at usbus3
umass1: <PNY Technologies USB 2.0 FD, class 0/0, rev 2.00/1.00, addr 2> on usbus3
da1 at umass-sim1 bus 1 scbus10 target 0 lun 0
da1: <PNY USB 2.0 FD 0.00> Removable Direct Access SCSI-2 device 
da1: 40.000MB/s transfers
da1: 7702MB (15773696 512 byte sectors: 255H 63S/T 981C)
GEOM: da1s1: geometry does not match label (16h,63s != 255h,63s).
GEOM: da1s2: geometry does not match label (16h,63s != 255h,63s).
[root@freenas] ~# cd /dev
[root@freenas] /dev# ls
./          ada3p2      da0s1       fd/         klog        pass3       ttyu0.lock  ttyvd       ugen6.1@
../         atkbd0      da0s1a      fido        kmem        pass4       ttyv0       ttyve       ukbd0
acpi        audit       da0s2       fw0@        led/        pass5       ttyv1       ttyvf       ums0
ada0        bpf         da0s3       fw0.0       log@        pass6       ttyv2       ufs/        urandom@
ada0p1      bpf0@       da0s4       fwmem0@     md0         pci         ttyv3       ufsid/      usb/
ada0p2      cd0         da1         fwmem0.0    md1         ptmx        ttyv4       ugen0.1@    usbctl
ada1        console     da1s1       geom.ctl    md2         pts/        ttyv5       ugen0.2@    xpt0
ada1p1      consolectl  da1s1a      ggctl       mdctl       random      ttyv6       ugen1.1@    zero
ada1p2      crypto      da1s2       gptid/      mem         stderr@     ttyv7       ugen1.2@    zfs
ada2        ctty        da1s2a      io          nfslock     stdin@      ttyv8       ugen2.1@    zvol/
ada2p1      cuau0       da1s3       kbd0@       null        stdout@     ttyv9       ugen3.1@
ada2p2      cuau0.init  da1s4       kbd1@       pass0       sysmouse    ttyva       ugen3.2@
ada3        cuau0.lock  devctl      kbd2@       pass1       ttyu0       ttyvb       ugen4.1@
ada3p1      da0         devstat     kbdmux0     pass2       ttyu0.init  ttyvc       ugen5.1@
[root@freenas] /dev# mkdir /mnt/pny
[root@freenas] /dev# mount /dev/da1s1 /dev/pny
mount: /dev/pny: No such file or directory
[root@freenas] /dev# mount /dev/da1s1 /mnt/pny
mount: /dev/da1s1 : Invalid argument
[root@freenas] /dev# mount /dev/da1s1a /mnt/pny
[root@freenas] /dev# cd /mnt/pny
[root@freenas] /mnt/pny# ls
./         .profile   bin/       conf/      etc/       libexec/   proc/      sbin/      usr/
../        .snap/     boot/      data/      home@      media/     rescue/    sys@       var/
.cshrc     COPYRIGHT* cfg/       dev/       lib/       mnt/       root/      tmp@
[root@freenas] /mnt/pny# 


i believe that I see devices da1s1a and da1s2a becasue i had my original FreeNAS on there as well as the upgraded 8.2 instance. (and I guess that clarifies somewhat the 'environment' that i was able to boot into on this stick. some initialization environment that itself picks which FreeNAS instance to boot...)

So how do i find my list of users I had before? what's in /mnt/pny/etc/passwd looks like the FreeBSD users. Does FreeNAS put its users in there or elsewhere? Guessing maybe some other chrooted environment?

thanks,
b
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Your configuration data is a file in /data, ie. /data/freenas-v1.db You might try copying the file off your old flash drive and restoring it to your new configuration. I'd save a backup copy of the current configuration file, just in case.
 
Status
Not open for further replies.
Top