Use Ubuntu Live CD to Rescue FreeNAS Crash and Copy Data

Mindwatering Incorporated

Author: Tripp W Black

Created: 10/30/2017 at 04:59 PM

 

Category:
Linux
Other

Issue:
FreeNAS USB stick will not boot. New USB sticks with various versions still will not boot.
Can boot Ubuntu 14.04 and Ubuntu 16.04 via USB and CDROM though.

Want to move FreeNAS dataset to another server before repairing FreeNAS.


Solution:
1. Booted Ubuntu 14.04 / Ubuntu 16.04 desktop "live" CD.
( I burned the ISO via my MacBook. )

2. Started Terminal (via the top search icon)

3. Gave the default "ubuntu" user a password.
$ passwd

4. Determined my IPs on the server.
$ sudo ipconfig -a | more
( Write down the desired IP returned. )

5. Installed SSH:
$ sudo apt-get update
$ sudo apt-get install ssh

6. Installed ZFS and ZFS tools:
$ sudo apt-get install zfs zfsutils-linux

7. Confirmed where my dataset was located, and mounted:
$ sudo -i
# fdisk -l
( Noted that drive set was sda2. )

# zpool list
( Noted that my storage pool / volume name from FreeNAS was not listed. )

# zpool import
( Noted that it returned my storage "volume" (really pool) label - StorageVol1. )

# zpool import StorageVol1 -f
( If I didn't use the force flag, then it would fail since the pool/volume knew it was part of a FreeNAS install. )

# cd /
# ls -l
( Noted that my StorageVol1 was now mounted to /StorageVol1 successfully. )

# cd StorageVol1/
# ls -l
( Noted that my VM backups were intact and all there. )

At this point my steps are specific to my Mac workstation...

8. To prepare for the transfer, I mounted another storage Ubuntu NAS to my MAC via NFS.

9. Next I started up FileZilla and logged into the the defunct FreeNAS via the IP I noted in step 4 above, and logged into it as "ubuntu" with the password I set.
However, I could not transfer anything because of the user "ubuntu" permissions lack.

10. Returning to my Terminal, I gave the root account a password and updated SSH to allow root login.
# sudo passwd
( Enter a new password twice. )

# vi /etc/ssh/sshd_config
( Update/add a line under the "# Authentication:" section with a PermitRootLogin line as follows. )
PermitRootLogin yes

# service ssh reload

11. Closed FileZilla, re-opened, updated the login information and transferred my files.




previous page