[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: starting qemu: shm problem



Bill Marcum wrote:
> On Fri, Nov 24, 2006 at 12:05:06PM +0100, Mirto Silvio Busico wrote:
>   
>> Hi all,
>> I'm trying to star qemu but I have problems.
>>
>> I'm using Etch and qemu 0.8.1-1
>>
>> When I try to start I receive an error message stating that I have not
>> enough shared memory.
>>
>> the mount command says:
>>     devshm on /dev/shm type tmpfs (rw)
>>
>> If I do what qemu suggest:
>>     umount /dev/shm
>>     mount -t tmpfs -o size=144m none /dev/shm
>>
>> the emulation starts correcty
>>
>> Here my questions:
>>
>>    1. is this the expected behaviour?
>>    2. where can I find documentation about shm device and temporary file
>>       systems?
>>     
>
> For a start, you can read the comments in /etc/init.d/mountvirtfs
>   
Well, in my /etc/init.d/ directory there is no such file.
A grep of shm in this directory says:
=============================================================
msb01:/etc/init.d# grep shm *
checkroot.sh:                                   domount tmpfs shmfs /tmp \
mountdevsubfs.sh:       # Mount a tmpfs on /dev/shm
mountdevsubfs.sh:       domount tmpfs shmfs /dev/shm
-onoexec,nosuid,nodev$SHM_OPT
mtab.sh:# /dev/pts and /dev/shm.
mtab.sh:        domtab tmpfs /dev/shm "devshm" $SHM_OPT
udev:  if mountpoint -q /dev/shm/; then
udev:    umount -n -l /dev/shm/
umountfs:                 /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys)
umountnfs.sh:             /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys)
msb01:/etc/init.d#

=============================================================

So, looking at mountdevsubfs.sh (there is no great comment inside) I see:
=============================================================
TMPFS_SIZE=
[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs

KERNEL="$(uname -s)"

. /lib/lsb/init-functions
. /lib/init/mount-functions.sh

do_start () {
        #
        # Mount a tmpfs on /dev/shm
        #
        SHM_OPT=
        [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT=",size=$SHM_SIZE"
        domount tmpfs shmfs /dev/shm -onoexec,nosuid,nodev$SHM_OPT

=============================================================

Looking at /etc/default/tmpfs I find a file containing:
=============================================================
# SHM_SIZE sets the maximum size (in bytes) that the /dev/shm tmpfs can use.
# If this is not set then the size defaults to the value of TMPFS_SIZE
# if that is set; otherwise to the kernel's default.
#
# The size will be rounded down to a multiple of the page size, 4096 bytes.
SHM_SIZE=
=============================================================

That explains the size determination.

>   
>>    3. how can I change the shm device?
>>
>>     
> Create an /etc/default/tmpfs containing the line 
> TMPFS_SIZE=144M 
>
> The default size is half of available memory, so I suppose your system 
> has 256M or less?
>   
Yes it have 256Mb

Thanks for your help

    Mirto
>
>   


-- 

__________________________________________________________
Mirto Silvio Busico 		ICT Consultant
Tel. +39 333 4562651
 



Reply to: