Re: Creating ramdisk at runtime

From: Hans-J. Ude (news_at_hajue-ude.de)
Date: 09/01/05


Date: Thu, 01 Sep 2005 07:40:06 +0200

Wed, 31 Aug 2005 13:37:15 +0200 Wolfgang Draxinger wrote:

> Hans-J. Ude wrote:
>
>> I'm porting a program from vxWorks to Linux right now. In the
>> given program there is a function which creates a ramdisk at
>> runtime and another one which deletes it. It's implemented as
>> createRamDev (char* name, int size_kb) using internal vxWorks
>> system functions. I thought there would be Linux system calls
>> as well which do the same or similiar things. I looked at
>> initrd functions but was rather unsuccessful up to now. Does
>> anyone here know some details about that subject? Is it
>> possible to create and delete ramdisks at runtime with Linux?
>> Any help appreciated.
>
> mkdir $mountpoint
> mount -t tmpfs -o size=20MB $mountpoint

Thanks for the info, Wolfgang. I'm looking more for some kernel functions
to perform that action programmaticly. I could do a call like
system("mount -t tmpfs -o size=20MB $mountpoint");
But I don't like that style of programming much.

Hans



Relevant Pages

  • Re: Unable to mount root fs on unknown-block(1,0)
    ... Sorry, the version of linux should be 2.6.15 for MPC8xx, which is included in ELDK. ... Load address: 0x100000 ... Image Name: ramdisk ... io scheduler anticipatory registered ...
    (Linux-Kernel)
  • Creating ramdisk at runtime
    ... I'm porting a program from vxWorks to Linux right now. ... Google finds many entries about ramdisk stuff but not what I'm looking for. ... I'm searching for something at programming level, ...
    (comp.os.linux.development.system)
  • Re: GB RAM-Disk unter Linux
    ... >>> desweiteren ist linux inteligenter, ... deine muehe kannst du ... also eine ramdisk ist total fuer die katz. ... server geeignet. ...
    (de.comp.os.unix.linux.misc)
  • Re: best distro to install on CF card?
    ... all the components I need and the plan is to install a Linux system onto ... the actual Linux files, not a ramdisk image that's loaded ... I would start off making everything in sight readonly except /tmp and /var/log using a disk, and gradually reconfiguring it and removing unwanted stuff till you get no errors...then transfer the moveable bits to ramdisk and the static bits to flash. ...
    (comp.os.linux.setup)
  • Re: GB RAM-Disk unter Linux
    ... >> desweiteren ist linux inteligenter, ... RAMDisk soll praktisch die Dateistruktur eines Windows-PC simuliert ... Next by Date: ...
    (de.comp.os.unix.linux.misc)