Plugging USB drive into FreeNAS box

Status
Not open for further replies.

watha

Dabbler
Joined
Mar 3, 2013
Messages
24
Real dumb question here. I want to back up stuff from a FreeNAS box to an external hard drive. How do I connect it up so that FreeNAS sees the external drive, and how do I then move the files to it? Thanks.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The best way, IMO, is going to be to plug the drive in and create a ZFS pool on it. Then copy or move the files using the command-line tool(s) of your choice. When you're done, export/detach that pool and unplug the drive. When you want to access or add to what's on the external drive, plug it back in, import the pool, do your business, export the pool, and unplug it.
 

MaLaCoiD

Dabbler
Joined
Sep 23, 2014
Messages
12
I have a USB drive I used on my Windows box, with NTFS. I plugged it into my FreeNAS server and it showed up as 'da1' under "Storage> View Disks".

Now in the shell, verify what the USB's partition is called:
Code:
[root@freenas /mnt]# ll /dev/da1*
crw-r-----  1 root  operator  - 0xa9 Dec 30 08:39 /dev/da1
crw-r-----  1 root  operator  - 0xac Dec 30 08:48 /dev/da1s1


Then load the kernel module which will allow you to mount NTFS volumes. This will last until reboot or you unload the module:
Code:
[root@freenas /mnt]# kldload fuse.ko


You can make the kernel module permanent by adding fusefs_enable="YES" to /etc/rc.conf.

Then make a directory and mount the volume:
Code:
[root@freenas /mnt]# mkdir /mnt/usb
[root@freenas /mnt]# mount -t ntfs /dev/da1s1 /mnt/usb
[root@freenas /mnt]# ls -l usb
drwxrwxrwx  1 root  wheel  -       4096 Jan  1  2014 $RECYCLE.BIN/
drwxrwxrwx  1 root  wheel  -       4096 Dec 12 10:07 ./
drwxr-xr-x  4 root  wheel  uarch    120 Dec 30 08:48 ../
drwxrwxrwx  1 root  wheel  -       4096 Dec 10 20:26 Pictures/
 

MaLaCoiD

Dabbler
Joined
Sep 23, 2014
Messages
12
Writing seems to be no problem:
Code:
[root@freenas /mnt/usb]# ls -l dan*
-rwxrwxrwx  1 root  wheel  0 Dec 30 10:25 danb35

[root@freenas /mnt/usb]# uname -a
FreeBSD freenas.box 9.3-RELEASE-p5 FreeBSD 9.3-RELEASE-p5 #0 3b4abc3: Mon Dec  8 15:09:41 PST 2014  root@build3.ixsystems.com:/tank/home/jkh/build/M/FN/objs/os-base/amd64/fusion/jkh/M/FN/FreeBSD/src/sys/FREENAS.amd64  amd64
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Good to know, thanks. If NTFS r/w support is there, and stable, that would give OP another option. I think I'd still favor ZFS for the external disk (but then I use a Mac, so I don't do much with NTFS anyway), for its various data-integrity features and the ability to do replication to the external disk if desired, but there are options.

If @watha feels like giving any detail beyond "I don't know what any of that meant", no doubt we could give some more detailed suggestions on how to accomplish his/her goal.
 

Dennis.kulmosen

Explorer
Joined
Aug 13, 2013
Messages
96
@danb35 You can use ZFS on your Mac with https://openzfsonosx.org
It works really good. :smile:
@watha You can use the steps mentioned first by danb35, but you dont have to go to the terminal if the size of your dataset do not exceed the size of your external harddrive. You can make a replication in webgui. Make a snapshot and replicate that to the external drive.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've played a little bit with openzfsonosx, but it couldn't import the pool I'd created with FreeNAS on an external disk--I think the issue was support for some of the feature flags. At the time, it was just a novelty issue for me, so I never pursued it.

How does the GUI work for setting up local replication tasks? Everything looks like it's geared toward replicating to a remote host.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
NTFS will soon be read-only. It should NOT be used long-term and the options of adding fuse are very badly conceived. NTFS is not overly stable and has eaten quite a few NTFS partitions in its day. Do NOT use NTFS long-term as it is NOT that stable. NTFS support was meant to copy data from current NTFS drives to ZFS formatted disks easily and locally. Nothing more. If you are doing more you do so at your own peril.
 
Status
Not open for further replies.
Top