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.

I'm creating ram block devices on a linux machine for a project we're working on. I don't want to use tmpfs.

When I use module brd to create a ramdisk I run the command

modprobe brd rd_size=1048576

This creates 16 devices -> /dev/ram[0-15] (all of size 1 GB)

But now I want to create two ramdisks of different sizes, say 1Gb and 2Gb.

I also understand I might be able to use lvm to "merge" two devices together and create a new 2GB device from two 1GB devices.

But I want the module to create ramdisks of different sizes without having to do the merging.

I've looked around for a method to do this, but it just seems that there is no way.

Does anyone know if there is a way to do this?

share|improve this question
    
Why don't you want to use tmpfs? Tmpfs solves your problem. –  mailq Sep 16 '11 at 0:17
    
If I want to format it with a different filesystem like ext3 or something. I want a block device. –  loosebazooka Sep 19 '11 at 21:16

1 Answer 1

I'd been looking for similar information on RAM disks (in my case, planned RAM disk as part of RAID 1 array). For a partial answer, as I'm not sure how to create RAM disks of differing sizes:

Try: modprobe brd rd_nr=1 rd_size=1048576 max_part=0

Which should create one, 1GB RAM disk. Perhaps tailor rd_nr=1 to rd_nr=3? That should give three 1G RAM disks, leaving assembling them to 2GB perhaps to LVM?

Referenced solution, and pardon the necro-post answer (there remains very lacking documentation on this subject): http://forums.debian.net/viewtopic.php?f=5&t=114458

share|improve this answer

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.