# [FreeNAS] Merging Directory Contents (mount_unionfs?)



## blawford (Jan 16, 2011)

I have just bought a new hard disk and I am trying to incorporate it into my FreeNAS (FreeBSD 7.3 based) media server's organisational structure.

I am looking to merge the contents of two directories on differen't drives, preferably in a third location (so the contents of /mnt/disk0/data/sorted and /mnt/disk1/data/sorted would be collectively shown under /mnt/merged/sorted). 

I have tried using mount_unionfs to achieve this for many frustrating hours this weekend:


```
# mount_unionfs /mnt/disk0/data/sorted /mnt/merged/sorted 
# mount_unionfs /mnt/disk1/data/sorted /mnt/merged/sorted
```

Although when viewing /mnt/merged/sorted/ everything seemed exactly as I was after, trying to execute one of the files from the location resulted in the system locking up completely.

For example, /mnt/disk0/data/sorted/movies contains about 150 files in individual folders, /mnt/disk1/data/sorted/movies contains 1 folder/file. I try to open /mnt/merged/sorted/movie99/movie99.mkv (an 8GB file stored on disk0) - media player tries for about 10minutes to open the file, cant even ping my box while this is happening. 

After things become responsive again I check /disk1 and the file I was trying to open is now also in /movies/ on there? Was it copying the file between hard drives when I tried to open it from the merged folder... This is obviously not what I am after.

Someone please point me in the right direction, this is driving me nuts.


----------



## DutchDaemon (Jan 17, 2011)

Reminder: Topics about PC-BSD / FreeNAS / DesktopBSD / m0N0WALL / pfSense


----------



## blawford (Jan 17, 2011)

DutchDaemon said:
			
		

> Reminder: Topics about PC-BSD / FreeNAS / DesktopBSD / m0N0WALL / pfSense


Although I hadn't read that I still think that my question is valid, hoping someone can help me with some advice.


----------



## blawford (Jan 19, 2011)

Anyone..? Even advice on where I should start looking would be useful.


----------



## jalla (Jan 19, 2011)

From the bugs section of mount_unionfs(8)():

```
THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM.  USE AT YOUR OWN
RISK.  BEWARE OF DOG.  SLIPPERY WHEN WET.
```

This manpage hasn't changed for years, and to my knowledge unionfs was never operable in FreeBSD.


----------

