Rarely Mentioned Pseudo-filesystems

Discussion in 'Filesystem' started by DevynCJohnson, Mar 3, 2014.

  1. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,158
    Likes Received:
    983
    Trophy Points:
    113
    Linux has many virtual filesystems. Some are well known like ProcFS while some (seen below) are not well known. Understanding the different virtual filesystems helps people understand Linux and its inner working better. Plus, you never know when this knowledge will help. So, we will discuss CloopFS, OverlayFS, FutexFS, EventpollFS, HugetlbFS, and mhddfs.


    CloopFS

    Some live Linux distros are stored in a single compressed file called a cloop file. A cloop file contains a whole filesystem called CloopFS which compresses the data on this read-only filesystem. CloopFS stands for "Compressed LOOPback device FileSystem". CloopFS's format is similar to the DMG format used by Apple/OS-X. Cloop files are transparently decompressed when used. The code for CloopFS is part of the Linux kernel.


    OverlayFS


    OverlayFS is meant to replace AUFS and UnionFS. Thus, overlayFS is another union filesystem that is useful in live Linux distros. OverlayFS makes many filesystems appear as a single tree under root (/). OverlayFS has two parts, a lower filesystem and an upper filesystem. The lower filesystem contains the read-only data originally from the LiveCD. The upper filesystem contains the data the user made or changed. For instance, if a user makes a shell script in a live distro and saves it in their home folder, then the script is on the upper layer. To mount an overlay filesystem, use this command template - "mount -t overlayfs -o {MOUNT-OPTIONS-HERE} overlayfs {MOUNTPOINT}". LiveCDs automatically mount the filesystem, so this mounting command is rarely needed.


    FutexFS

    FutexFS is a filesystem used to access the Fast-Userspace-muTEX (mutex = MUTual-EXclusion). A futex is a fast userspace managing mutexes. "Mutex" refers to the concept of not allowing two threads to access a shared resource at the same time. Various busy-wait algorithms exist to ensure no more than one thread accesses a shared resource at any given moment. The Futex Filesystem allows users/processes to view the currently busy-waiting threads and other parts of the futex system via a filesystem interface. Interesting, right? Well, the real interesting part is the fact that this filesystem has not been put in the kernel. This virtual filesystem has been proposed and discussed, but Linus Torvalds has not accepted the idea. Should he?


    EventpollFS

    The Eventpoll Filesystem (EpollFS or EventpollFS) is a filesystem interface used to allow processes to access the Epoll system. Epoll monitors file descriptors for Input/Output (IO) events. This checks whether the file descriptor is ready to receive or give data.



    HugetlbFS


    This RAM-based virtual/pseudo filesystem used to handle larger pages. A standard page in memory is four kilobytes (4k), but if a process has many hundreds of megabytes worth of pages (or more), this can cause performance issues because the CPU will take longer finding data. Thus, large pages are needed and supported via the HUGE TaBLe FileSystem (HugetlbFS).

    The Filesystem Hierarchy Standard (FHS) does not define where HugetlbFS is mounted, so every distro may differ. So, some users may want to define their own mount point if one is not already set up. First, make an empty directory that will serve as the mount point. In a command-line, type this - "mkdir /hugepages/". Then, create a group for the filesystem like this - "groupadd hugetlbfs-gp". After that, retrieve the group-ID (GID) of the new group - "getent group hugetlbfs-gp". (For this example, we will assume 3737 was the GID) Next, in /etc/fstab, add this line - "hugetlbfs /hugepages/ hugetlbfs mode=1770,gid=3737 0 0". Now, we can add users to the group. Add one user at a time using this command - "adduser USER hugetlbfs-gp", where "USER" is the username to add. Once done, the administrator has one of two options to use to activate the huge-pages. For option one, the system can be rebooted. If you do not want to do that or you cannot do that, use this command which is your second option - "systclt -p". If the command fails for any reason, then you must use the first option mentioned (reboot).

    Some users may wonder if HugetlbFS is enabled or supported by their kernel. To test if HugetlbFS is supported, use this command - "grep HUGETLB /boot/config-$(uname -r)". Alternately, this one can also be used - "grep -i hugetlbfs /proc/filesystems". If nothing appears in the output, then HugetlbFS is not supported. To see if your system is set up to use HugetlbFS, look in the Filesystem Table (cat /etc/fstab) or grep it - "grep -i hugetlbfs /etc/fstab". To see if the system is currently using HugetlbFS, use this command which also shows various data about the huge-pages - "grep Huge /proc/meminfo". Here is a simple table for debugging HugetlbFS:

    Code:
    Is it supported by my kernel? [No output = not supported/enabled] - grep -i HUGETLB /boot/config-$(uname -r) || grep -i hugetlbfs /proc/filesystems
    Is it ready to use; is it setup? [No output = not setup] - grep -i hugetlbfs /etc/fstab
    Is it actively/currently being used? [Valid Output = HugetlbFS in use] - grep Huge /proc/meminfo
    
    Utilities exist for managing and checking on the status of HugetlbFS. Install "hugeadm" which offers some helpful tools.


    mhddfs

    Sometimes, users may wish to combine multiple storage units into one filesystem. Unfortunately, the user may think this is impossible or may not know how. Thankfully, a special FUSE filesystem exists that makes this possible. The Multi-Hard-Drive-Disk-FileSystem (mhddfs) can combine multiple storage units as one unified storage unit. To format/combine the storage devices, use this command - "mhddfs /media/SPACE0/,/media/SPACE1/,/media/SPACE2/ /media/BORG/". List as many storage units as needed separated by a comma and no space. After the first unescaped space, type the pool's mount point. To make the mhddfs storage cluster mount on bootup, add this line to /etc/fstab or something like that - "mhddfs#/mnt/hdd1,/mnt/hdd2,/mnt/hdd3 /mnt/POOL fuse defaults,allow_other 0 0". Specifically, each storage device is being listed and then the mount point, like in the command example.

    Attached Files:

    Mitt Green likes this.

Share This Page