Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

For benchmarking purposes I need to format and mount variable sized ram-backed block devices with Ext4 and Btrfs. Unfortunately the only solution I have come across uses ramdisks which seem to be inflexible (they are all the same size).

The only other solution I have thought of is to mount a loopback file in tmpfs using and then format this file with Ext4 or Btrfs.

Are there any other ram-backed block devices other than the ancient ramdisk?

share|improve this question
Why do you need this? It may help provide some context. What is wrong with tmpfs? – Zoredache Feb 23 '12 at 19:10
tmpfs will work if it supports the user_xattr mount option. I guess I should test that real quick :) – Noah Watkins Feb 23 '12 at 20:28
Yeh, doesn't look like tmpfs supports user_xattr mount option. – Noah Watkins Feb 23 '12 at 20:32

You can try zram. It's compressed in-memory block device, which can free unused blocks of ext4 filesystem or any other filesystem which supports trim/discard.

But zram is on staging area in kernel, so probably your default distro kernel doesn't have it. Also, discard support for zram is relatively new and I'm not sure if it is intergated to some released kernel version.

And, of course there'll be some cpu overhead for compression/decompression, so it may not meet your testing requirements.

share|improve this answer

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.