Fuse inode number & aufs?

Hej,

I am mounting my entire Amazon Drive using
/usr/local/bin/rclone --config /root/.rclone.conf mount --max-read-ahead 1024k --transfers 20 --checkers 40 --read-only --allow-other --no-modtime remote:/ /mnt/amazon_ori &

Works flawless.

Now I wanted to add a layer above using aufs to be able to have a transparent cache for frequently used files. But when I try to mount this:
mount -t aufs -o br=/mnt/cache/amazon=rw:/mnt/amazon_ori -o udba=reval none /mnt/amazon

aufs is complaining
[ 279.750882] aufs au_xino_read:702:ls[697]: I/O Error, too large hi11613993917959617111

After reading up it seems aufs has a limit when it comes to the size of the inode numbers.

So, (finally) my question: Why are the inode numbers so big and any chance we can get them smaller?

Here is a ls -ilsa from the /mnt/amazon_ori

root@odroid64:/mnt/amazon_ori# ls -ilsa /mnt/amazon_ori/ total 0 6361105148754046731 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Backups 3424564663998667886 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Books 10506996466445958951 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Games 12334951539984183433 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Movies 7351975847773898335 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Music 5922203585319387058 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 TV 11613993917959617111 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 Transfer 10509979743363668140 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 enc 738198852751780662 0 drwxr-xr-x 1 root root 0 Nov 7 15:12 iTunes

I was able to mount it under aufs:

mount -t aufs -o br=/data/Media1=rw:/data/Media2 -o udba=reval none /root/u
root@HS: ~
ls -l /root/u

total 92
drwxrwsr-x 3 deluge mediashare 4096 Oct 27 15:44 apk
drwxrwsr-x 17 deluge mediashare 4096 Jun 14 22:18 AudioBooks
drwxrwsr-x 23 deluge mediashare 12288 Nov 5 12:32 eBooks
drwxrwsr-x 2 deluge mediashare 4096 Dec 29 2015 Incoming
drwxrwsr-x 1079 deluge mediashare 45056 Jul 21 13:42 Music
drwxrwsr-x 227 deluge mediashare 12288 Sep 4 19:44 Pictures
drwxrwsr-x 3 deluge mediashare 4096 Feb 10 2016 Software
drwxrwsr-x 7 deluge mediashare 4096 Oct 25 16:02 Videos
root@HS: ~
->#
root@HS: ~
-># ls -ilsa /data/Media2
total 0
13104277429449718690 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 apk
12698259885990105152 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 AudioBooks
992735947171396007 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 eBooks
7351975847773898335 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 Music
2102590970354217311 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 Pictures
14427994098429341819 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 .recycle
2694014729628246401 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 Software
17302735507196230190 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 .unionfs
5878437855037434916 0 drwxrwxr-x 1 deluge mediashare 0 Nov 7 11:07 Videos
root@HS: ~

I recreated it. It actually works under crypt. It doesn’t work on a regular non-crypt. Interestingly enough the inode numbers are high on both. I doubt that is actually the problem but it sure doesn’t like non-crypt.

-># rclone --config /home/robert/.rclone.conf mount --max-read-ahead 1024k --transfers 20 --checkers 40 --read-only --allow-other --no-modtime robacd:/cams /root/t &
root@HS: ~
-># mount -t aufs -o br=/data/Media1=rw:/root/t -o udba=reval none /root/u
root@HS: ~
-># ls /root/u
ls: reading directory /root/u: File too large
root@HS: ~

I’m using the default inode generator in the FUSE library which will generate a 64 bit random number more or less.

It seems from a bit of research that AUFS expects build a table with all these inode numbers in. If the max inode number is 2^64 then that will never fit in memory, hence the error.

This seems like a bad/strange design decision from AUFS - surely it should be using a hashmap to store the inodes…

Anyway rclone could implement its own sequential inode generator - it would have to keep a map of all files and generate them sequential inode numbers which would fix this problem completely at the expense of using more memory.

If you would like to see this feature then make an issue on github.

Well, I found mhddfs now which seems to do the job.
There are also other union filesystems. I think your time is better spend on other tasks then this one.

Thanks

1 Like

Does this work better than unionfs-fuse?

Well, I mhddfs is working for me just fine to get a layer above the rclone fuse mount for quick access to frequently used files. I could not use unionfs since my kernel (3.14 on an Odroid C2) has no support for it.

I haven’t tested unionfs-fuse but it looks interesting.

I give it a try since I have an issue with mhddfs to get write access when mounting it via netatalk on my Macs :frowning:
But I guess that’s a very special problem