Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using ubuntu server 12.04 as a file server with 3 disks, two contain files and one contains parity of the others, using snapraid. I have been able to share one disk as both SMB and NFS, but now I want make both disks show as one and share that. so I created a folder to mount my AUFS branch: "storage_pool" then I added my AUFS branch to my fstab file:

#AUFS Pool system
none /storage_pool aufs br:/mnt/disk1=rw:/mnt/disk2,sum,create=mfs 0 0

from what I have understood create=mfs will put the next file written to the branch, on the disk with the most free space. thats is the way I want it to be. then I shared the folder "storage_pool" via SMB together with each disk shared by them selves:

[Storage_Disk1]
path = /mnt/disk1
available = yes
valid users = nick
read only = no
browseable = yes
public = yes
writable = yes

[Storage_Disk2]
path = /mnt/disk2
available = yes
valid users = nick
read only = no
browseable = yes
public = yes
writable = yes

[XBMC_Pool]
path = /storage_pool
available = yes
valid users = nick
read only = no
browseable = yes
public = yes
writable = yes

I am now able to see both disks and the AUFS brach from my windows desktop. I then tried to write a file to AUFS branch, and noticed that it showed up on disk1 which is almost full so I expected it to show up on disk2. I then tried write a file to the root of disk2 and shows up in the root of the AUFS branch. I the created a folder on disk2 with the same name as one on disk1, and a subfolder with a new name which contains 2 files. the new folder and files does not show up in the AUFS branch. and I don't understand why.

my next question how I can share my AUFS branch via NFS. My NFS bindings in fstab looks like this:

#NFS4 Share bindings
/mnt/disk1 /NFS4/XBMC none bind 0 0
/storage_pool /NFS4/XBMC_pool none bind 0 0

and my NFS exports look like this:

/NFS4 *(rw,fsid=0,insecure,async,no_subtree_check)
/NFS4/XBMC *(rw,nohide,insecure,async,no_subtree_check)
/NFS4/XBMC_pool *(rw,fsid=0,nohide,insecure,async,no_subtree_check,crossmnt)

the share /NFS4/XBMC works perfectly but /NFS4/XBMC_pool shows up empty.

I hope someone can help me, if more info is needed I'll try and add it.

I now tried to move my AUFS Branch mount to my /etc/rc.local instead of my fstab, like this:

mount -t aufs -o br:/mnt/disk1=rw:/mnt/disk2,sum,create=mfs none /storage_pool

I then restarted my server and now the folders and files from disk2 shows up in the AUFS branch. writing files to the branch still gives problems, in that it only tries to write to disk1, when tried from my windows desktop, it reports back that there is not enough disk space, but only disk1 is full.

hope someone can help me.

regards nick

share|improve this question

1 Answer 1

I have found the problem related to my AUFS branch, the mount commands wa falty. instead of:

mount -t aufs -o br:/mnt/disk1=rw:/mnt/disk2,sum,create=mfs none /storage_pool

it should be like this:

mount -t aufs -o br:/mnt/disk1=rw:/mnt/disk2=rw -o sum -o udba=reval -o create=mfs none /storage_pool

it now mounts properly, writes new files to the disk with most space, and written directly to one of the disks are presented in the pool.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.