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?