http://qs321.pair.com?node_id=1143139

szabgab has asked for the wisdom of the Perl Monks concerning the following question:

I just wrote some code using Sys::Ramdisk. It worked well on OSX, but when I switched to Linux it complained:
Mount command '/bin/mount -t tmpfs -o size=100m tmpfs /tmp/ramdisk' failed: mount: only root can do that
Is there a way to get it working on Linux without running it as root?

Replies are listed 'Best First'.
Re: Sys::Ramdisk as regular user on Linux
by perlron (Pilgrim) on Sep 27, 2015 at 12:27 UTC
    Hi
    I was just going through the mount documentation on my Debian GNU/Linux instance. ($man mount)
    Non Super User Mounts
    Normally, only the super user can mount filesystem, However when fstab contains the user options on a line, anyone can mount a filesystem.


    The Great Programmer is one who inspires others to code, not just one who writes great code
Re: Sys::Ramdisk as regular user on Linux
by Anonymous Monk on Sep 27, 2015 at 18:24 UTC

    That's a question for the Sys::Ramdisk author, in truth. Could you describe the use case, however? Is the intention in setting a quota-like size limit for a subdirectory?

      Downloading a zip file, unzipping, analyzing content.
      For now I changed it to use a temporary directory on the disk. Later I'll measure if the ramdisk provides a real speedup and then I'll further investigate how to use it.

        Speedup is unlikely. Dirty pages aren't written to disk immediately. Well, if your archives are of considerable size AND your swap is much faster than regular storage, then you'd see benefits.

        I'd advise setting up your whole system to use tmpfs backed /tmp instead of mucking around with userspace options (FUSE, etc.) Incidentally, there are FUSE filesystems to access archived content.

Re: Sys::Ramdisk as regular user on Linux
by Anonymous Monk on Sep 27, 2015 at 10:53 UTC
    ?have root give perms for that?
A reply falls below the community's threshold of quality. You may see it by logging in.