OpenVZ Forum


Home » General » Support » Set a directory in tmpfs in a VE
Set a directory in tmpfs in a VE [message #20517] Wed, 19 September 2007 18:21 Go to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
Hi,

I'm attempting to set a MailScanner VE.

Usually, on a MailScanner system, we put /tmp and /var/spool/MailScanner/incoming on tmpfs (in-memory filesystem) to increase processing speed (don't worry, there is no possibility of e-mail loss).

My question is... can I do the same thing for a VE?

For example, if my VE is 101, can I put /vz/private/101/tmp on tmpfs on the host node? (or should I use /vz/root/101/tmp)

Thanks,

Ugo


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Set a directory in tmpfs in a VE [message #20553 is a reply to message #20517] Thu, 20 September 2007 18:01 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
From in the VE context, try this:

mount -t tmpfs -o noexec,nosuid tmpfs /tmp/




-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Set a directory in tmpfs in a VE [message #20554 is a reply to message #20553] Thu, 20 September 2007 18:04 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
So you're saying that it should work right?

Oh, from within the VE?


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page

[Updated on: Thu, 20 September 2007 18:07]

Report message to a moderator

Re: Set a directory in tmpfs in a VE [message #20555 is a reply to message #20554] Thu, 20 September 2007 18:09 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
[root@vz01 ~]# mount -t tmpfs -o noexec,nosuid tmpfs /tmp/
[root@vz01 ~]# mount
simfs on / type simfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,noexec)


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Set a directory in tmpfs in a VE [message #21560 is a reply to message #20553] Thu, 11 October 2007 02:26 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
It looks like it works:

[root@server mail]# mount
simfs on / type simfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /var/spool/MailScanner/incoming type tmpfs (rw)
tmpfs on /tmp type tmpfs (rw)

How can I make sure it is held in memory?

Thanks,


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Set a directory in tmpfs in a VE [message #21802 is a reply to message #20553] Tue, 16 October 2007 12:36 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
rickb wrote on Thu, 20 September 2007 14:01

From in the VE context, try this:

mount -t tmpfs -o noexec,nosuid tmpfs /tmp/



I tried it but some configuration files kept on falling back to their default configuration, so I removed all this.

Really weird. While I had /var/spool/MailScanner/incoming and /tmp on tmpfs, the file /etc/MailScanner/mailscanner-mrtg was modified, and saved.

A few hours later, the modifications I've made are not there anymore.

I removed the tmpfs configuration and now working on the filesystem directly. Is this a bug? Could I do it safely on the HN, I have access?

Regards,
Ugo


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Set a directory in tmpfs in a VE [message #22831 is a reply to message #21802] Mon, 05 November 2007 21:37 Go to previous message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
ugob wrote on Tue, 16 October 2007 08:36

rickb wrote on Thu, 20 September 2007 14:01

From in the VE context, try this:

mount -t tmpfs -o noexec,nosuid tmpfs /tmp/



I tried it but some configuration files kept on falling back to their default configuration, so I removed all this.

Really weird. While I had /var/spool/MailScanner/incoming and /tmp on tmpfs, the file /etc/MailScanner/mailscanner-mrtg was modified, and saved.

A few hours later, the modifications I've made are not there anymore.

I removed the tmpfs configuration and now working on the filesystem directly. Is this a bug? Could I do it safely on the HN, I have access?

Regards,
Ugo


Nevermind. The file is synced from another server. I'll re-enable the config.


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Previous Topic: URL
Next Topic: ioprior question
Goto Forum:
  


Current Time: Mon Oct 14 01:59:05 GMT 2024

Total time taken to generate the page: 0.09146 seconds