Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm playing with Ubuntu 11.10 launched in a chroot environment under Android 3.2.1. Most of the software works fine except PostgreSQL. When installed or initdb launched it's saying:

FATAL: could not create shared memory segment: Function not implemented.
DETAIL: Failed Failed system call was shmget(key=1, size=1908736, 03600).

Is there any specific tuning of shared memory/PostgreSQL in a chroot? Perhaps some kind of mount the android ashmem to chrooted shm? I'm a novice in Linux.

share|improve this question

ashmem uses the /dev/ashmem device node. You need to create it in the chroot's /dev, either by using mknod with the apropriate numbers, or by doing a bind mount:

touch chroot/dev/ashmem
mount --bind /dev/ashmem chroot/dev/ashmem

(You might need Busybox or Ubuntu's mount for this.)

share|improve this answer
Thanks. Mount failed with error "Not a directory". Have tried ln /dev/ashmem $chroot/dev/ashmem - failed cross-device link. Tried mknod, but still same error. Have also experimented with creating $chroot/dev/shm device with no success. – Stan Oct 25 '11 at 16:55
@Stan: 1) apparently the Linux version used by Android does not yet support file bindmounts; 2) obvious; 3) impossible, as mknod does not create links -- but a different error message might occur; 4) ashmem, not shm. – grawity Oct 25 '11 at 19:42
The commands above wont work because touch creates a file rather than a directory. You need to do the bind mount from Android shell before you chroot into your Ubuntu chroot. mkdir chroot/dev; mount -o bind /dev /chroot/dev works fine for me in lollipop. However, having /dev/ashmem accessible in your Ubuntu chroot isn't going to help. PostgresSQL is looking for Posix shared memory (/dev/shm). – Jonathan Ben-Avraham Jun 3 at 15:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.