Saturday 11 February 2012

Mounting an external NTFS USB drive with FreeNAS

I tried to mount an en external USB drive with FreeNAS. The drive was partitioned as a dynamic disk in Windows 7 and formatted as NTFS.

Numerous attempts to mount the drive with ntfs-3g and other mount commands all failed. I received messages like "Operation Failed" and "The device xxx doesn't seem to have a valid NTFS" and "NTFS Signature Missing".

In the end I repartitioned the drive, this time selecting a Simple Volume and a MBR disk in Windows 7, reformatting as NTFS. The limitation with this approach is that the disk can only have 2TB partition, but it was enough.

To mount the drive and copy files to it, I used the following commands.

mkdir /mnt/usb
kldload fuse
ntfs-3g /dev/da1s1 /mnt/usb
rsync -av --ignore-errors --exclude .recycle /mnt/Data /mnt/usb

If you want to exclude folders then use
rsync -av --ignore-errors --exclude Andrew/Bulgaria /mnt/Data /mnt/usb
Note that the inclusion and exclusion of the slashes is important, and the folder is relative to the source folder that was specified.

Check the size of the copied folder with du -hs "My Photos"

Footnote: I'm starting to lose the will to live with FreeBSD and  FreeNAS. There are so many petty complications. For example, RSYNC sometimes fails to work; it reports "Sending File List" and then goes idle. A look at the log indicates "root: Previous local synchronization still running... exiting".
ps -eaf tells me that RSYNC is in an "uninterruptable sleep" (status D).

The solution? Reboot, then rm rsync* from /var/run.

Another problem is that I occassionally get:
rsync: recv_generator: mkdir "/mnt/usb/Data/a/b/c" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***

1 comment:

  1. ...Being that it is designed to be a "N"etwork "A"ttached "S"torage (NAS) server, have you tried using rsync "ACROSS" the actual network, between FreeNAS and your other network machine - like you are supposed to do???