public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ramdisk size clarification
@ 2001-12-17 20:41 Padraig Brady
  2001-12-17 21:14 ` Mike Castle
  0 siblings, 1 reply; 3+ messages in thread
From: Padraig Brady @ 2001-12-17 20:41 UTC (permalink / raw)
  To: linux-kernel

It's not at all obvious to me what the {ramdisk,ramdisk_size,rd_size}
parameters for ramdisks do from reading ramdisk.txt (note rd_size
is used when using the ramdisk as a module).

I think they only set the size to be reported, for e.g. mke2fs does
the following to determine the size of a ramdisk:

open("/dev/ram0", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, BLKGETSIZE, 0xbffff81c)        = 0
close(3)                                = 0

However there is no actual RAM allocated until it's required,
and also there is no upper limit on the amount of RAM used,
so the following will kill your system (well it did for me):
dd if=/dev/zero of=/dev/ram0

can this be clarified in the ramdisk.txt file please.

As a side note there is a lovely "trivial ramdisk" module
written by Andrw tridgell @:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gkernel/ext3/tools/trd/
that does static allocation and (hence) doesn't grow beyond the
specified size.

thanks,
Padraig.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ramdisk size clarification
  2001-12-17 20:41 ramdisk size clarification Padraig Brady
@ 2001-12-17 21:14 ` Mike Castle
  2001-12-18 12:46   ` Padraig Brady
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Castle @ 2001-12-17 21:14 UTC (permalink / raw)
  To: Padraig Brady; +Cc: linux-kernel

On Mon, Dec 17, 2001 at 08:41:32PM +0000, Padraig Brady wrote:
> and also there is no upper limit on the amount of RAM used,
> so the following will kill your system (well it did for me):
> dd if=/dev/zero of=/dev/ram0

Bug in recent 2.4.*.  It *should* stop.  One line patch has been
posted to the linux-kernel list a couple of times.  Check the archive.
It's probably in the recent pre-release kernels as well.

As a work around, try the following:

count=`blockdev --getsize /dev/ram0`
bsize=`blockdev --getss /dev/ram0`
dd if=/dev/zero of=/dev/ram0 count=${count} bs=${bsize}

-- 
     Mike Castle      dalgoda@ix.netcom.com      www.netcom.com/~dalgoda/
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ramdisk size clarification
  2001-12-17 21:14 ` Mike Castle
@ 2001-12-18 12:46   ` Padraig Brady
  0 siblings, 0 replies; 3+ messages in thread
From: Padraig Brady @ 2001-12-18 12:46 UTC (permalink / raw)
  To: Mike Castle; +Cc: linux-kernel

Mike Castle wrote:

> On Mon, Dec 17, 2001 at 08:41:32PM +0000, Padraig Brady wrote:
> 
>>and also there is no upper limit on the amount of RAM used,
>>so the following will kill your system (well it did for me):
>>dd if=/dev/zero of=/dev/ram0
>>
> 
> Bug in recent 2.4.*.  It *should* stop.  One line patch has been
> posted to the linux-kernel list a couple of times.  Check the archive.
> It's probably in the recent pre-release kernels as well.
> 

Great thanks!
http://marc.theaimsgroup.com/?l=linux-kernel&m=100797607432139&w=2

Padraig.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-18 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-17 20:41 ramdisk size clarification Padraig Brady
2001-12-17 21:14 ` Mike Castle
2001-12-18 12:46   ` Padraig Brady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox