You are not logged in.

#1 2012-09-20 19:46:18

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

[Solved] fstab -- using a partition as /tmp

Is it safe to mount /tmp as a partition on the hard drive, I've done it before, but I'm not sure if it's healthy for the drive in question.  I started doing that because I was tired of having to constantly be emptying out /tmp every time I installed something big like WINE from the AUR.  Checked the wiki regarding fstab, but it doesn't mention using a partition as /tmp or how to make that partition act as a truely temporary partition.

Last edited by lspci (2012-09-21 15:27:14)


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#2 2012-09-20 20:23:11

kvanberendonck
Member
Registered: 2012-08-17
Posts: 45

Re: [Solved] fstab -- using a partition as /tmp

If you make sure to use the partition type tmpfs in your fstab for /tmp then it should be a ramdisk and it should clear out when you turn off your computer or the power cuts.

Offline

#3 2012-09-20 21:06:33

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [Solved] fstab -- using a partition as /tmp

kvanberendonck wrote:

If you make sure to use the partition type tmpfs in your fstab for /tmp then it should be a ramdisk and it should clear out when you turn off your computer or the power cuts.

Yeah, but then I max out my 8 gigs of RAM on a regular basis.  I'd like to keep my RAM usage down.


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#4 2012-09-20 21:11:27

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] fstab -- using a partition as /tmp

Wow, you really max out 8G on a regular basis? Do you have a swap partition? You can set how much memory tmpfs uses before it hits swap:

ArchWiki wrote:

By default, a tmpfs partition has its maximum size set to half your total RAM, but this can be customized. Note that the actual memory/swap consumption depends on how much you fill it up, as tmpfs partitions do not consume any memory until it is actually needed.

I don't really understand this question

Is it safe to mount /tmp as a partition on the hard drive, I've done it before, but I'm not sure if it's healthy for the drive in question.

Why would it not be "safe" or "healthy for the drive in question" ?

Last edited by 2ManyDogs (2012-09-20 21:13:18)

Offline

#5 2012-09-20 21:45:28

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [Solved] fstab -- using a partition as /tmp

2ManyDogs wrote:

Wow, you really max out 8G on a regular basis? Do you have a swap partition? You can set how much memory tmpfs uses before it hits swap:

ArchWiki wrote:

By default, a tmpfs partition has its maximum size set to half your total RAM, but this can be customized. Note that the actual memory/swap consumption depends on how much you fill it up, as tmpfs partitions do not consume any memory until it is actually needed.

I don't really understand this question

Is it safe to mount /tmp as a partition on the hard drive, I've done it before, but I'm not sure if it's healthy for the drive in question.

Why would it not be "safe" or "healthy for the drive in question" ?

'Cause uhh... the tmp partition is always changing?  o.O I dunno.  I remember reading it somewhere that it wasn't safe to do that to /var so I figured that the same would go for /tmp... guess not. 

Yep, I generally reach about 90% RAM usage by the end of the day.  Right now I'm only at 19%, but I'm in class so I haven't really been doing much of anything.  Most days though I'm like browsing through the AUR and other repos and the internet looking for packages I might like.  tongue


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#6 2012-09-20 21:52:12

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] fstab -- using a partition as /tmp

Well, you have 8G of memory, so you might as well use it smile I understand the feeling though -- I have 4G and if I get over 1G used I get anxious... I suppose if I was making full use of the memory I would want to get to 90% used. It's there, why not use it? Otherwise it's just wasted...

Offline

#7 2012-09-20 22:08:14

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [Solved] fstab -- using a partition as /tmp

lspci wrote:

Is it safe to mount /tmp as a partition on the hard drive, I've done it before, but I'm not sure if it's healthy for the drive in question.  I started doing that because I was tired of having to constantly be emptying out /tmp every time I installed something big like WINE from the AUR.  Checked the wiki regarding fstab, but it doesn't mention using a partition as /tmp or how to make that partition act as a truely temporary partition.

You can use a regular partition as backing for /tmp without problems. It will be cleared on boot and hence appear to be truly temporary (assuming that's what you meant).

However, I think from a performance point of view you'd be bettor off just adding that space as swap. This will allow your /tmp to be bigger, but won't write to the partition unless you need to due to lack of ram, hence saving your hardware by keeping writes down and speeding things up (at least in some cases: http://www.toofishes.net/blog/mysql-and-tmp-tmpfs/ ).

Offline

#8 2012-09-20 23:30:57

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] fstab -- using a partition as /tmp

I think the real solution here is not to build packages in /tmp.

Offline

#9 2012-09-21 01:24:31

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [Solved] fstab -- using a partition as /tmp

2ManyDogs wrote:

Well, you have 8G of memory, so you might as well use it smile I understand the feeling though -- I have 4G and if I get over 1G used I get anxious... I suppose if I was making full use of the memory I would want to get to 90% used. It's there, why not use it? Otherwise it's just wasted...

You know, I really like that.  smile  I mean, you're absolutely right, why have extra RAM and then not use it?  I should be grateful for the extra RAM and try to take advantage of its benefits as much as possible.  smile

tomegun wrote:
lspci wrote:

Is it safe to mount /tmp as a partition on the hard drive, I've done it before, but I'm not sure if it's healthy for the drive in question.  I started doing that because I was tired of having to constantly be emptying out /tmp every time I installed something big like WINE from the AUR.  Checked the wiki regarding fstab, but it doesn't mention using a partition as /tmp or how to make that partition act as a truely temporary partition.

You can use a regular partition as backing for /tmp without problems. It will be cleared on boot and hence appear to be truly temporary (assuming that's what you meant).

However, I think from a performance point of view you'd be bettor off just adding that space as swap. This will allow your /tmp to be bigger, but won't write to the partition unless you need to due to lack of ram, hence saving your hardware by keeping writes down and speeding things up (at least in some cases: http://www.toofishes.net/blog/mysql-and-tmp-tmpfs/ ).

Okay, then I'll set up my tmpfs to be like 10 gigs or something like that... I think that my swap space is like 10 gigs

 $ lsblk
...
|-sda6        8:6    0   9.8G  0 part [SWAP]
...

yep, it's like 10 gigs, lol.  I've got a feeling that maybe 10 gigs is a bit overkill, but since I just figured that the more the merrier I went ahead and devoted 10 gigs to swap space anyway.

falconindy wrote:

I think the real solution here is not to build packages in /tmp.

Aww, but I like building packages in /tmp.  tongue  (And indeed, I intend to continue doing so.)

Last edited by lspci (2012-09-21 01:29:20)


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#10 2012-09-21 02:56:55

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] fstab -- using a partition as /tmp

lspci wrote:

I was tired of having to constantly be emptying out /tmp every time I installed something big like WINE from the AUR

lspci wrote:

Aww, but I like building packages in /tmp.  tongue  (And indeed, I intend to continue doing so.)

This makes my head hurt. Really. Stop building in /tmp.

Offline

#11 2012-09-21 04:29:34

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [Solved] fstab -- using a partition as /tmp

falconindy wrote:
lspci wrote:

I was tired of having to constantly be emptying out /tmp every time I installed something big like WINE from the AUR

lspci wrote:

Aww, but I like building packages in /tmp.  tongue  (And indeed, I intend to continue doing so.)

This makes my head hurt. Really. Stop building in /tmp.


You serious?


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#12 2012-09-21 04:47:36

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,022

Re: [Solved] fstab -- using a partition as /tmp

but as  I know pacaur, packer, yaourt use /tmp for building thing

if not /tmp was is the "best place" for build?

Last edited by Jristz (2012-09-21 04:47:58)


Well, I suppose that this is somekind of signature, no?

Offline

#13 2012-09-21 06:15:48

ploub
Member
Registered: 2007-05-16
Posts: 132

Re: [Solved] fstab -- using a partition as /tmp

AFAIK yaourt deletes all the build files in /tmp after the package has been built and installed. I build AUR packages in ~/build, keeps the place tidy and the packages are available if I need to re-install them.

Offline

#14 2012-09-21 14:20:54

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [Solved] fstab -- using a partition as /tmp

ploub wrote:

AFAIK yaourt deletes all the build files in /tmp after the package has been built and installed. I build AUR packages in ~/build, keeps the place tidy and the packages are available if I need to re-install them.

I didn't even know that you could tell packer to build things in anywhere else but /tmp.  What's the problem with building them in /tmp, though?  Is it just messy, unhealthy for the device, what?


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#15 2012-09-21 14:52:13

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,904
Website

Re: [Solved] fstab -- using a partition as /tmp

I don't think there's anything wrong with building inside a tmpfs -- I have a 15GB tmpfs which I compile/package in all the time -- unless a] you're building something that needs more space than your tmpfs allows (which will cause the build to fail once it hits a "no space left on device" error), or b] you go on to ask how to change your /tmp to a partition because you keep filling it with files from compiling things. tongue

Why not compile in another directory, and clear that using tmpfiles.d?

It will cause more wear-and-tear on your HDD, but it won't fill up your tmpfs (which is only half your available RAM by default, btw).

see also: Building in a Clean Chroot/devtools


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB