Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Sys::Ramdisk as regular user on Linux

by szabgab (Priest)
on Sep 27, 2015 at 10:29 UTC ( [id://1143139]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1143139]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2025-03-24 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (63 votes). Check out past polls.