i want to create a tmpfs file system for one of my vm to run on,using XEN Server.

On the host machine i tried this but is not working,.

xe sr-create device-config:device=/dev/shm name-label="RAM" type=tmpfs

Is it possible to make a tmpfs file system using xe command and make the vm run on it rather on HDD.This VM should not be slowed down by waiting for disks(This is what required).Can this be achieved using XEN server.Is there a better way of doing it? This host is having only a single HDD and can not afford to add extra storage.


I'm guessing here, but tmpfs generates a filesystem. SR's are block devices. You could probably create an empty file on the tmpfs, run losetup on it, and use that as your block device on tmpfs.

Edit: I just did a quick test:

dd if=/dev/zero out=/dev/shm/testing bs=4M count=100
losetup /dev/loop0 /dev/shm/testing
parted /dev/loop0 mklabel msdos
parted /dev/loop0 mkpart 1 primary ext2 0% 100%
pvcreate /dev/loop0

At this moment you can make it into a part of your LVM, so you should be able to put images on it.

  • this is the best ever answer i have ever got from questions i have asked in server fault.i thought i will not get an answer for this question.I couldnt believe my eyes when i see a local storage named RAM in my storage.Thank you very much. to add a few.. parted command was not there,used fdisk instead. – Kevin Parker Aug 15 '12 at 13:57

Full steps

dd if=/dev/zero out=/dev/shm/testing bs=4M count=100

losetup /dev/loop0 /dev/shm/testing

fdisk /dev/loop0

mkfs.ext4 /dev/loop0

pvcreate /dev/loop0

xe sr-create device-config:device=/dev/loop0 name-label="RAM" type=ext4

go to xen-centre and refresh storage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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