Make /tmp ext4

Archived topics about LMDE 1 and LMDE 2
Locked
jan_goyvaerts

Make /tmp ext4

Post by jan_goyvaerts »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: Make /tmp ext4

Post by xenopeek »

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
jan_goyvaerts

Re: Make /tmp ext4

Post by jan_goyvaerts »

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

Re: Make /tmp ext4

Post by jan_goyvaerts »

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 ?
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: Make /tmp ext4

Post by xenopeek »

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
jan_goyvaerts

Re: Make /tmp ext4

Post by jan_goyvaerts »

OK thanks a lot ! :-)
Locked

Return to “LMDE Archive”