Make /tmp ext4

Questions about applications and software
Forum rules
Before you post please read this

Make /tmp ext4

Postby jan_goyvaerts on Fri May 25, 2012 5:56 am

IF I'm not mistaken, LMDE uses tmpfs for the storage of /tmp. Which is an in-memory file system.
Code: Select all
/etc $ df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                   19G  4.6G   14G  27% /
udev                                                    3.9G     0  3.9G   0% /dev
/dev/disk/by-uuid/82a6cda5-e38c-4833-8f8a-983463fbb592   19G  4.6G   14G  27% /
tmpfs                                                   800M  952K  799M   1% /var/run
tmpfs                                                   5.0M     0  5.0M   0% /var/run/lock
tmpfs                                                   1.6G  115M  1.5G   8% /tmp
tmpfs                                                   1.6G  1.6M  1.6G   1% /var/run/shm
/dev/sda6                                                19G   12G  6.5G  64% /home
/dev/sda7                                               188G   38G  142G  21% /opt


Unfortunately I'm a bit low on memory and doing extensive temporary I/O in huge amounts. So, I'd rather not have /tmp be in memory.

Can somebody give me a hint how I can do this ? Safely that is. I would probably end up wrecking my installation. :-)

TIA - Jan
jan_goyvaerts
Level 2
Level 2
 
Posts: 57
Joined: Tue Nov 29, 2011 4:53 am

Linux Mint is funded by ads and donations.
 

Re: Make /tmp ext4

Postby xenopeek on Fri May 25, 2012 7:24 am

Sure, there is a line in the configuration file /etc/fstab for that. Should look something like:
Code: Select all
tmpfs /tmp tmpfs nosuid,nodev 0 0

Edit the file ("sudo nano /etc/fstab") and put a # (hash) character in front of that line. Save and close the file.

Then log out, go to the virtual terminal (Ctrl+Alt+F2), log in there, and shutdown the X server ("sudo /etc/init.d/mdm stop", or whichever display manager you use). You should now be able to unmount /tmp ("sudo umount /tmp"). Then create a new /tmp folder with:
Code: Select all
sudo mkdir --mode=1777 /tmp

All done! Restart your X server, or reboot to continue.

Or do you want it as a separate partition?
Image
Linux Mint 14 Nadia / 64-bit / Cinnamon
User avatar
xenopeek
Level 20
Level 20
 
Posts: 10477
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Make /tmp ext4

Postby jan_goyvaerts on Fri May 25, 2012 7:36 am

No no, no separate file system. Unless to encrypt it ? You never know who's looking ! :-p

I also thought /etc/fstab would show this. But that's not the case. I've got no entry about /tmp.

Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc   /proc   proc   defaults   0   0
# /dev/sda1
UUID=82a6cda5-e38c-4833-8f8a-983463fbb592   /   ext4   rw,errors=remount-ro   0   1
# /dev/sda5
UUID=fc988766-e3a6-4c90-bc23-1170f1311926   swap   swap   sw   0   0
# /dev/sda6
UUID=2e3b316d-181d-4f35-bfaf-8728ec95ba2d   /home   ext4   rw,errors=remount-ro   0   0
# /dev/sda7
UUID=430a6464-a4ef-493d-938b-786377e1864e   /opt   ext4   rw,errors=remount-ro   0   0
jan_goyvaerts
Level 2
Level 2
 
Posts: 57
Joined: Tue Nov 29, 2011 4:53 am

Re: Make /tmp ext4

Postby jan_goyvaerts on Fri May 25, 2012 8:11 am

Good... Did some digging and came up with this. It *looks* like it is working, but I have no clue of the long-term effects. :-)

    1) In /etc/default/tmpfs set RAMTMP from yes to no.
    2) Log out.
    3) Go to character session (ctrl-alt-f1).
    4) sudo /etc/init.d/mdm stop
    5) Kill the processes using /tmp with lsof | grep "/tmp".
    6) sudo umount /tmp
    7) reboot
It seems /tmp is created automatically once the original tmpfs has been unmounted.

Is that okay do you think ?
jan_goyvaerts
Level 2
Level 2
 
Posts: 57
Joined: Tue Nov 29, 2011 4:53 am

Re: Make /tmp ext4

Postby xenopeek on Fri May 25, 2012 8:35 am

Sounds good :D Thanks for sharing the steps you used.

I would think this has the exact effect as my steps, though as you wrote there was nothing in /etc/fstab to remove but in this other file. You should be fine with this, I don't foresee long-term effects.
Image
Linux Mint 14 Nadia / 64-bit / Cinnamon
User avatar
xenopeek
Level 20
Level 20
 
Posts: 10477
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Make /tmp ext4

Postby jan_goyvaerts on Fri May 25, 2012 8:36 am

OK thanks a lot ! :-)
jan_goyvaerts
Level 2
Level 2
 
Posts: 57
Joined: Tue Nov 29, 2011 4:53 am


Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 5 guests