Hi,
I need a single ramdisk which is a real block device (unlike tmpfs), so I found the ramdisk_size kernel boot parameter. However, after invoking "MAKEDEV ram" I get hundreds of 16mb large ramdisks, instead of a single 4GB large:
dd if=/dev/zero of=/dev/ram0 bs=1024k count=2048 dd: error writing ‘/dev/ram0’: No space left on device 17+0 records in 16+0 records out 16777216 bytes (17 MB) copied, 0.032487 s, 516 MB/s
Any idea how to get a single ramdisk instead, I am using Fedora20 on x86_64 btw.
Thank you in advance, Clemens
On 06/18/2014 06:52 AM, Clemens Eisserer wrote:
Hi,
I need a single ramdisk which is a real block device (unlike tmpfs), so I found the ramdisk_size kernel boot parameter. However, after invoking "MAKEDEV ram" I get hundreds of 16mb large ramdisks, instead of a single 4GB large:
dd if=/dev/zero of=/dev/ram0 bs=1024k count=2048 dd: error writing ‘/dev/ram0’: No space left on device 17+0 records in 16+0 records out 16777216 bytes (17 MB) copied, 0.032487 s, 516 MB/s
Any idea how to get a single ramdisk instead, I am using Fedora20 on x86_64 btw.
Thank you in advance, Clemens
Just talking symbolically here, and not having done it before, would the following work?
dd if=/dev/zero of=/dev/ram0 bs=4096000k count=1
If the above is not possible try adding oflag=nonblock to your original command and see if that works. From my understanding of dd what you are seeing it doing is what you told it to do. Although having said this, how do you know you are getting lots of 16MB ram disks rather than a single contiguous block of memory that is being written 16MB at a time?
regards, Steve
On 06/18/2014 06:52 AM, Clemens Eisserer wrote:
I need a single ramdisk which is a real block device (unlike tmpfs), so I found the ramdisk_size kernel boot parameter. However, after invoking "MAKEDEV ram" I get hundreds of 16mb large ramdisks, instead of a single 4GB large:
Following up to a reply (sorry, missed original message), but I'm not sure that's possible. IIRC the original ramdisk block device was kind of screwy, and I don't think it'll support that much space.
One hack I could think of to get a 4G, in-memory, block device (untested but should work I believe):
- mount a tmpfs a little larger (don't know how much overhead there is so 4100m is a guess): mkdir /srv/foo mount -t tmpfs -o size=4100m tmpfs /srv/foo - create a 4G backing file: dd if=/dev/zero bs=1M count=4K of=/srv/foo/backing.img - attach it to a loopback device: losetup -f --show /srv/foo/backing.img