LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Changing the size of "/dev/shm" in openSUSE 10.1 (https://www.linuxquestions.org/questions/linux-general-1/changing-the-size-of-dev-shm-in-opensuse-10-1-a-549040/)

g4j31a5 04-25-2007 07:52 PM

Changing the size of "/dev/shm" in openSUSE 10.1
 
Hi, like the title implies, I want to ask how to change the size of
"/dev/shm" in openSUSE 10.1? I searched the "/etc/sysconfig/kernel" but there's no
"SHMFS_SIZE" line. I tried "mount -o remount,size=$NEWSIZE /dev/shm" but
it said there's no "/dev/shm" in fstab / mtab. What should I do?

Thanks in advance.

osor 04-25-2007 08:55 PM

How about using the kernel parameters kernel.shmmax, kernel.shmall, and kernel.shmmax? If you don’t want to pass these to your bootloader, use sysctl.

g4j31a5 04-26-2007 10:55 AM

I've tried that but didn't work. I've tried changing the kernel.shmall & kernel.shmmax to 2 gigs and 4 gigs and rebooted the comp. Then I tried copying 300 megs of files to "/dev/shm" and it said insufficient disk space.

osor 04-26-2007 11:13 AM

Quote:

Originally Posted by g4j31a5
I've tried changing the kernel.shmall & kernel.shmmax to 2 gigs and 4 gigs and rebooted the comp.

If you changed with sysctl, then rebooted, your changes would be lost… Try changing with sysctl then copying. If you want “permanent” changes, either modify /etc/sysctl.conf or your bootloader’s config file.

michaelk 04-26-2007 12:18 PM

Shared memory (/dev/shm) is not used very much so you might not have an entry in fstab. I'm not a memory expert and do not know how shmmax relates to POSIX shared memory or Sys V shared memory but AFAIK tmpfs is dynamic i.e. it will use as much memory as needed until you max out your RAM and swap if a max size not specified. AFAIK /dev/shm is for sharing memory between applications and not used as virtual storage. However you can mount say /tmp as tmpfs.

To specify a max size
tmpfs /dev/shm tmpfs defaults,size=8G 0 0

virtual /tmp directory:
tmpfs /tmp tmpfs defaults 0 0

So what are you trying to accomplish?


All times are GMT -5. The time now is 01:26 AM.