increase size of /tmp -folder

Discussion in 'Linux' started by garfieldpbj, Oct 11, 2008.

  1. garfieldpbj

    garfieldpbj

    Joined:
    Oct 11, 2008
    Messages:
    5
    Likes Received:
    0
    Hi.

    Can anyone tell me how to increase the size of the tmp folder? (I am trying to install a program called comsol script by using a mounted iso image of the dvd, but I get an error telling me that there is no space left - even though I have 2.9 GB free)

    /Peter
     
    garfieldpbj, Oct 11, 2008
    #1
  2. garfieldpbj

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    You really can't increase the size of /tmp as it's just a directory on your SSD drive. if you're running out of memory, then you're running out of disk space on the SSD drive. That's a dangerous thing to happen (filling up /tmp) because I've seen Linux systems where once this happens, /tmp can't be cleaned up with a shutdown.

    I guess one could actually increase /tmp by having it mounted to some other external flash memory card? That might be a possibility. But that would require editing /etc/fstab to have /tmp mounted on that card and having the card formatted ext2 and always available.

    I think you need to look at some other way to do what you want to do. With that I can't help, as I'm not familiar with what you're trying to install.

    BTW, where is that iso located? What size is it? That could account for the shortage of disk space on your SSD. Maybe if you had the iso on a flash key and mounted it from there, you would at least save the disk space that the iso is occupying on the SSD, if indeed that is where you have it?

    Cheers.
     
    rbil, Oct 11, 2008
    #2
  3. garfieldpbj

    garfieldpbj

    Joined:
    Oct 11, 2008
    Messages:
    5
    Likes Received:
    0
    Hi, and thank you for the answer.

    The iso is located at a external (usb) hard drive. (and mounted at /mnt/iso)..

    As said do I have about 3 GB free space at the ssd, but the problem is that the tmp folder only has about 250 MB free - that is what I do not understand , and want to change.

    /Peter
     
    garfieldpbj, Oct 11, 2008
    #3
  4. garfieldpbj

    Japser

    Joined:
    Aug 28, 2008
    Messages:
    267
    Likes Received:
    0
    I think rbil has it wrong here: /tmp/ lives in a temporary filesystem in memory.
    One of many tweaks of Acer/Linpus to avoid too many writes on the SSD.
    --Japser.
     
    Japser, Oct 11, 2008
    #4
  5. garfieldpbj

    garfieldpbj

    Joined:
    Oct 11, 2008
    Messages:
    5
    Likes Received:
    0
    why do they want to avoid many writes?

    do you know how I can make a tmp folder which uses the ssd free memory?

    /Peter
     
    garfieldpbj, Oct 11, 2008
    #5
  6. garfieldpbj

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Darn, you're right! I'm more familiar with other Linux distros and never realized that Acer has set a policy restricting the size of /tmp. I guess they did that to prevent the problem of something filling up /tmp until the whole drive fills up. Where they've set the this I'm not sure at the moment. That will take some looking around. I'm only familiar on how it is done when mounting a partition in fstab (usrquota), but in Linpus, /tmp isn't mounted in fstab. Maybe somewhere else they're doing it when the system initializes?

    Cheers.
     
    rbil, Oct 11, 2008
    #6
  7. garfieldpbj

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Then it would be mounted in fstab using the tmpfs, and isn't doing that. At least not on my system.

    Cheers.
     
    rbil, Oct 11, 2008
    #7
  8. garfieldpbj

    Japser

    Joined:
    Aug 28, 2008
    Messages:
    267
    Likes Received:
    0
    Sorry, I cannot elaborate, I don't -have- a One. :(
    I worked on a One for a week to get 3G working for my neighbour, installed Debian on it, learned a bit and went back to Linpus.

    --Japser.
     
    Japser, Oct 11, 2008
    #8
  9. garfieldpbj

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    I seem to recall reading that Linpus mounts /tmp at an earlier point during the boot process. Not running it so I can't check. cat /proc/mounts to see what's mounted (/etc/mtab may not be entirely reliable).

    Unmounting /tmp would mean that anything written to it goes to the SSD, but that could be tricky since there'll most likely be a bunch processes using it once you're logged in. You could try to comment out the part that mounts /tmp (wild guess would be rc.S or something called from there), but since I can't check I can't guarantee it won't break anything.

    Maybe switching to single-user mode would allow you to unmount it, and then switching back to whatever runlevel Linpus uses by default.

    Does the thingy you're trying to install need to use /tmp? Can't it be instructed to use some other dir?
    Does it use a predictable file/dir name when writing to /tmp? If so, maybe you could create a symlink to somewhere on the SSD?

    Oh, and the reason they mount /tmp on tmpfs is that writes are horribly slow on the SSD they included - and each bit on a SSD can only be written to a limited number of times. Restricting the size would be because that's half the RAM available ;).
     
    mh-, Oct 12, 2008
    #9
  10. garfieldpbj

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    You're so right! mount doesn't display the info, but your command does indeed show /tmp as a tmpfs filesystem. So they aren't using fstab to mount the /tmp like this, but doing it somewhere else. Is it possible it's done directly in the kernel somehow?

    Cheers.
     
    rbil, Oct 12, 2008
    #10
  11. garfieldpbj

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    I presume /tmp is mounted this way for (a) speed and (b) to reduce the number of writes on the SSD. Repeated rapid writes don't do much for the long term reliabilty of an SSD.

    If you just want a /tmp that is larger for some specific, temporary job, you ought to be able to mount another directory over the top of it. I doubt you'll be able to unmount it after boot, because there will be stuff open.

    sudo mkdir /someplace
    sudo chmod 777 /someplace
    sudo mount -o rebind /someplace /tmp

    Or something like that, anyway
     
    kevin, Oct 13, 2008
    #11
  12. garfieldpbj

    cpchan

    Joined:
    Sep 22, 2008
    Messages:
    201
    Likes Received:
    0
    Welcome to the rabbit hole called the Linpus init system. To answer your question, it is mounted in line 30 of /etc/rc.d/rc.S:

    Code:
    mount -v tmpfs /tmp -n -t tmpfs
     
    cpchan, Oct 14, 2008
    #12
  13. garfieldpbj

    garfieldpbj

    Joined:
    Oct 11, 2008
    Messages:
    5
    Likes Received:
    0
    I'll try that soon when I have the time..

    Thank you for the tip...

    How do I exactly unmount the folder, and rebind it to the original location (which I think is in the memory)?

    /Peter

     
    garfieldpbj, Oct 14, 2008
    #13
  14. garfieldpbj

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    You don't need to unmount the original /tmp. What `rebind' does is install another part of the filesystem at /tmp. Any files that were open in /tmp temporarily become invisible except to the apps that have them open. All new writes to /tmp go to the new location. rebind essentially grafts a directory on top of an existing one.

    You only want to do this as a temporary measure, because it can upset some apps if they open a file in /tmp, then find the file is no longer there (because you've grafted a new filesystem on top and hidden the file). But this can be a useful way to get around certain problems with filesystems not being large enough.
     
    kevin, Oct 15, 2008
    #14
  15. garfieldpbj

    garfieldpbj

    Joined:
    Oct 11, 2008
    Messages:
    5
    Likes Received:
    0
    What I meant was, how to "unmount the rebinding", that is tell the system to use the standard tmp folder after I have installed the program which requires the extra space.

    /Peter
     
    garfieldpbj, Oct 15, 2008
    #15
  16. garfieldpbj

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    sudo umount /tmp ?
     
    kevin, Oct 15, 2008
    #16
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.