Installing FreeNAS on a USB Drive

Status
Not open for further replies.

cosmicx

Dabbler
Joined
Mar 1, 2012
Messages
16
hello gurus,

i'm a new member here, i just wanted to ask this simple question.

i want to install freenas on a particular usb drive on a particular machine. now my question is, can i unplug that usb drive (with freenas installed) and then plug and use it in another machine?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Yes, I have seen a few cases here where that didn't work, but those were the exceptions. It *should* work no problem.
 

cosmicx

Dabbler
Joined
Mar 1, 2012
Messages
16
thank you for the quick reply. i got further query, i cant seem to find any quide on how to install freenas from a usb drive. instead of burning the iso to a cdr, i would rather put it on a usb.

i have no spare dvd/cd drive
 

cosmicx

Dabbler
Joined
Mar 1, 2012
Messages
16
@protosd

thanks for the reply, i was able to install and setup my nas using the link you've posted above.

i got further query, how can i copy a files from another drive, that is also physically attached to my machine via usb port.

i've create a raid0 volume with ufs fs, what i want to do is to attached my usb external enclosure and transfer all the contents of it to the newly created raid volume.

what i was thinking, was to attached the usb hard drive enclosure to the machine and then add it to the storage and then transfer the files using the webgui.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
It depends on how the USB drive is formatted & partitioned. If it's a single partition NTFS disk, you can import it from the GUI. Then it'll show up in the list of disks under Storage->Volumes-View All Volumes. After that it would probably be best to use "rsync" from the command line (there are several threads here in the forums on how to do that if you dig for them).

If the drive is formatted FAT32, or Ext2, it's possible to mount them, but last I checked the GUI didn't work properly. There's a section in the Unofficial FAQ in my signature below on mounting other disks, I think it's question #28.

Just remember that USB is going to be painfully slow if you have a lot of data to copy. It would be faster if you took the disk out of the case and connected it directly to your NAS and copied the data, then after it finished it would be ready for you to reuse.
 

cosmicx

Dabbler
Joined
Mar 1, 2012
Messages
16
@protosd

thanks again, i've tried to import a 1gb ntfs formated usb flash drive before hooking up my external 3tb hard drive, but i'm getting a labelling error.

any fix for this?

and if i successfully import my external drive, how can i copy files to my raid0 volume?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Cosmicx,

What version of FreeNAS are you using? Importing NTFS before 8.03 was broken and you had to do it from the command line. If you can upgrade to 8.04.

You'll need to use rsync to copy. You should search for that here in the forums because it been covered a BUNCH of times already.

Basically from the command line, for example: rsync -av /mnt/your-NTFS-disk /mnt/your-raid0-disk

Thats just a quick example search and you'll find more.
 

cosmicx

Dabbler
Joined
Mar 1, 2012
Messages
16
im using 8.04

still it gave me an error,

for the rsync issue, i will search the forum
 
Joined
Oct 11, 2012
Messages
2
hello

How can i backup usb drive on which Freenas is installed?
in case of usb stick failure, what can be done to boot system with same config immediately?

I Can I use 2 usb flash sticks?

thanks
 

ben

FreeNAS GUI Developer
Joined
May 24, 2011
Messages
373
Koka, the thing to do is to back up the Config database. Use "Save Config" in settings, seen here: http://doc.freenas.org/index.php/Settings

You can then upload it to FreeNAS install of that version or later and import the volumes and everything should work again.
 

ben

FreeNAS GUI Developer
Joined
May 24, 2011
Messages
373
That's a good way to do it. Remember that you will still have to import the pools to get the new drive working.
 

TDPsGM

Explorer
Joined
Oct 27, 2011
Messages
71
Hey folks, I was just wondering -- if for some reason the GUI upgrade didn't work, and instead of burning the ISO image to a DVD, could I do the "UPGRADE" from a usb stick?

If the answer is yes, which file would I use:

*_upgrade.txz
*_upgrade.xz
OR
*.img.xz

file?

for example, if I was upgrading from RELEASE V8.2.* would the command in Linux look like this:

xzcat FreeNAS-8.3.0-RELEASE-p1-x64.img.xz | dd of=/dev/sdb1 bs=64k <====== Is this the SAME as the ISO image on DVD and therefore capable of upgrades?
xzcat FreeNAS-8.3.0-RELEASE-p1-x64.GUI_Upgrade.xz | dd of=/dev/sdb1 bs=64k
xzcat FreeNAS-8.3.0-RELEASE-p1-x64.GUI_Upgrade.txz | dd of=/dev/sdb1 bs=64k <===== I am guessing NOT this. Is the *.txz file ONLY for GUY upgrades?

Obviously I don't know what EACH of these files is capable of. If someone could clarify a bit for me that would be great!
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
Is it really worth all this to avoid using a <50 cent CD?
 

TDPsGM

Explorer
Joined
Oct 27, 2011
Messages
71
Is it really worth all this to avoid using a <50 cent CD?

I think you may have missed the point - though I haven't made it clear in THIS thread.
I am trying to learn the in's and out's of FreeNAS 8
People used to make wheels out of wood at one point in time as well, but you really don't see THAT any more either.

The Data I am tinkering with is Test data.

Further, the CD is irrelevant in the grand scheme of things.
It is the:
  • Case (slots available that i could put and extra drive in - with a caddy of course);
  • the added Optical Drive;
  • cabling;
  • the extra estata port that is used;
  • etc, etc, etc.

The CD upgrades work just fine. I KNOW how to do that.

Is there something 'less safe' about using a usb burnt image that I haven't yet read about?

Comments on THAT would be a little more useful that commenting on the price of a cd (which, by the way, I have in Rewritable form as well).

Anyone?
 

ben

FreeNAS GUI Developer
Joined
May 24, 2011
Messages
373
The problem with that approach is in how the upgrade process works and the layout of a FreeNAS USB drive. The FreeNAS boot USB contains not one, but two bootable slices. What a GUI upgrade is actually doing is copying a bootable image (the upgrade file unpacked, *.txz or *.xz both work the same for this) to the slice you're not booted to and then setting that slice to be booted next, instead of the current one. It also copies the config database over to the updated slice. Merely copying the upgrade image onto the USB stick would actually break your FreeNAS boot, and copying the full install image (*.img.xz) would be the equivalent of a clean install, wiping out your config database and requiring you to re-import your pools.

The CD image is different from the upgrade or clean install images - the CD has a bootloader of the type needed for CDs to boot a FreeBSD kernel and then a custom installer environment with scripts for clean installs and upgrades.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The problem with that approach is in how the upgrade process works and the layout of a FreeNAS USB drive. The FreeNAS boot USB contains not one, but two bootable slices. What a GUI upgrade is actually doing is copying a bootable image (the upgrade file unpacked, *.txz or *.xz both work the same for this) to the slice you're not booted to and then setting that slice to be booted next, instead of the current one. It also copies the config database over to the updated slice. Merely copying the upgrade image onto the USB stick would actually break your FreeNAS boot, and copying the full install image (*.img.xz) would be the equivalent of a clean install, wiping out your config database and requiring you to re-import your pools.

The CD image is different from the upgrade or clean install images - the CD has a bootloader of the type needed for CDs to boot a FreeBSD kernel and then a custom installer environment with scripts for clean installs and upgrades.

Exactly. So you know what I do to avoid the "need" for a CD if things get rough? I simply run a cronjob that backs up my config file every night at 2300. If all hell breaks lose on my USB drive I just burn a new image to the USB using winimage32, autoimport my zpool, then import the config file. Problem solved!
 

TDPsGM

Explorer
Joined
Oct 27, 2011
Messages
71
He Ben, Thanks for the reply.

I probably wasn't that clear on what I was asking.

I was looking to see if it was possible to 'burn' one of those image files to a DIFFERENT usb drive (NOT the one that is actually "Live") and then boot from THAT (just like what someone would do with the *.iso image you'd burn to a CD). From there I was asking "IF" someone did that, could you then continue to "Upgrade" the "Live USB" like you would with the CD burnt image.

After playing with it, and upon further reading, if I understand things correctly, the *_Upgrade.txz and the *_Upgrade.xz files are ONLY to be used via the GUI and have NO OTHER abilities -- in other words, they can not be booted from a usb stick if they are burnt there DIRECTLY. Again - they are to be used through the GUI only.

I was kinda hoping that the *.img.xz files would "ACT" the same as the CD burnt ISO files ---- basically I was hoping that I could BOOT from the *.img.xz image burnt to the usb, and use it to upgrade the 'Live' OS in the same way AS the CD burnt ISO file.

If I understand this right, the *.img.xz files are a clean install of what you'd get if you were to do a clean install FROM the CD burnt ISO files.

. . . and copying the full install image (*.img.xz) would be the equivalent of a clean install, . . .

The CD image is different from the upgrade or clean install images - the CD has a bootloader of the type needed for CDs to boot a FreeBSD kernel and then a custom installer environment with scripts for clean installs and upgrades.

Thanks again for the response.
 

TDPsGM

Explorer
Joined
Oct 27, 2011
Messages
71
Exactly. So you know what I do to avoid the "need" for a CD if things get rough? I simply run a cronjob that backs up my config file every night at 2300. If all hell breaks lose on my USB drive I just burn a new image to the USB using winimage32, autoimport my zpool, then import the config file. Problem solved!

That's Brilliant. Thanks noobsauce80
 
Status
Not open for further replies.
Top