Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.