Sponsored Content
Full Discussion: Unix ramdisk?
Top Forums UNIX for Dummies Questions & Answers Unix ramdisk? Post 33044 by Perderabo on Saturday 14th of December 2002 10:15:46 AM
Old 12-14-2002
I'm not sure what is being discussed in this thread.

One possibility is a device like an ordinary scsi disk but with no moving parts. It would look to the kernel like a very fast disk drive. I don't have any experience with something like this. But if it is available, I would guess that it would only take a driver to get it work under unix.

The other possibility is a pseudo-driver that allocates a large chunk of system memory and makes it look like a very fast disk drive. Any data stored on a pseudo-disk like this is guaranteed to disappear at shutdown time. I do have experience with this sort of thing, so I will comment on this.

Every version on unix that I know of uses memory based filesystems. But mostly they are used when booting an install or a support media. With HP-UX, you can even use Ignite to create a bootable tape that will have a copy of your root filesystem. When you boot that tape, root will be in memory while the tape is running.

As far as using a memory disk while the system is running, SunOS comes close with its handling of /tmp, but that is not locked in core, instead it is virtual.

Unix is very aggressive about caching disk data. Blocks are read into core and most disk i/o is really to and from core anyway. When a file is being processing sequencially, unix will notice this and will read ahead. The combination of write-behind and read-ahead is so effective that most disk i/o never happens.
Quote:
On a typicall UNIX system, over 85 percent of the implied disk transfers can be skipped because the requested block already resides in the buffer cache.
That quote is from page 208 of The Design and Implementation of the 4.3BSD UNIX Operating System which was published in 1989. Today's system are much better than that, mostly due to very large memories. Today's read-ahead algorithms are also smarter. And we are moving away from block based filesystems to extent based filesystems like Veritas.

But don't take my word for it, try this...
program1 | program2
program1 > datafile ; program2 < datafile

You probably won't be able to measure the difference on a single cpu system. What good would it do to put datafile in a memory-based filesystem? Or maybe I really should say that memory-based filesystems are all that unix supports.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to create a ramdisk

Hi all, I wanted to make a ramdisk for a opensolaris distro. I have very little idea of how to create it? can anyone pls help me out? Is there any tutorial on creating it on the net??? Also can i make changes to the actual os itself by changing the scripts involved in ramdisk then use it to... (1 Reply)
Discussion started by: wrapster
1 Replies

2. Shell Programming and Scripting

how to modify ramdisk size,kinda urgent !!!

Hi all, I wanted to know how to modify the size of the ramdisk? I mean am manipulating a live cd ,for which the file am manipulating is within a ramdisk now due to size constraints i am unable to play around with some stuff.... currently the size of the ram disk is 64M... I would like to... (1 Reply)
Discussion started by: wrapster
1 Replies

3. Shell Programming and Scripting

Ramdisk already defined

I am trying to mount the ramdisk for sorting, and i get the message "ramdisk already defined." What exactly is /dev/ramdisk0 and is it safe to remove it? # command sudo -S mktd 60 <<EOF initiate EOF # block of code for mktd ... && { print "ramdisk already defined." ... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

4. Shell Programming and Scripting

Sorting in ramdisk

Hi, I have sort command that sorts in ramdisk created by a script 'mktd' and later unmounted by script 'rmtd'. The platform is AIX. # code sudo -E mktd 44 # create ramdisk of size 44GB sort ... -k1,1 -2,2 ... # sort a file using the ramdisk on keys 1 and 2 sudo -E rmtd # unmount... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

5. Ubuntu

initial ramdisk in ubuntu

hi everybody! i need your help! i have some problems with "initial ramdisk" (initrd). i did with instructions of the following link Linux initial RAM disk (initrd) overview but my initrd not run. after loading, it stopped,and failure notice : "ramdisk : compressed image found at block 0 no... (0 Replies)
Discussion started by: xikechamh
0 Replies

6. AIX

maximum size of a ramdisk on AIX 5.3

Hi, Do you know what is the maximum size I can use to create a ramdisk on AIX 5.3? I m pretty sure i've seen somewhere i can use more than 2 Gb but I can't remember where. I need to do some recommandations for one of my customer and they'll need to create a ramdisk of 20 Gb. Can this be done? ... (1 Reply)
Discussion started by: cedric hanquez
1 Replies

7. UNIX for Advanced & Expert Users

How to view Ramdisk Initialization Process

Dear all, I read some articles about initrd, but how to view this process in my computer :(? Is there anyway to display to the screen or write to the log file? (3 Replies)
Discussion started by: Hannibal2010
3 Replies
SD(4)							   BSD Kernel Interfaces Manual 						     SD(4)

NAME
sd -- SCSI and ATAPI disk driver SYNOPSIS
sd* at scsibus? target ? lun ? sd3 at scsibus0 target 3 lun 0 sd* at atapibus? drive ? flags 0x0000 DESCRIPTION
The sd driver provides support for SCSI bus and Advanced Technology Attachment Packet Interface (ATAPI) disks. It allows the disk to be divided up into a set of pseudo devices called partitions. In general the interfaces are similar to those described by wd(4). Where the wd(4) device has a fairly low level interface to the system, SCSI devices have a much higher level interface and talk to the system via a SCSI host adapter (e.g., ahc(4)). A SCSI adapter must also be separately configured into the system before a SCSI disk can be config- ured. When the SCSI adapter is probed during boot, the SCSI bus is scanned for devices. Any devices found which answer as 'Direct' type devices will be attached to the sd driver. For the use of flags with ATAPI devices, see wd(4). PARTITIONING
On many systems disklabel(8) is used to partition the drive into filesystems. On some systems the NetBSD portion of the disk resides within a native partition, and another program is used to create the NetBSD portion. For example, the i386 port uses fdisk(8) to partition the disk into a BIOS level partition. This allows sharing the disk with other operat- ing systems. CONFIGURATION OPTIONS
The following config(1) options may be applied to SCSI disks as well as to other disks. SDRETRIES Set the number of retries that will be performed for operations it makes sense to retry (e.g., normal reads and writes). The default is four (4). SD_IO_TIMEOUT Set amount of time, in milliseconds, a normal read or write is expected to take. The defaults is sixty seconds (60000 mil- liseconds). This is used to set watchdog timers in the SCSI HBA driver to catch commands that might have died on the device. IOCTLS
The following ioctl(2) calls apply to SCSI disks as well as to other disks. They are defined in the header file <disklabel.h>. DIOCGDINFO Read, from the kernel, the in-core copy of the disklabel for the drive. This may be a fictitious disklabel if the drive has never been initialized, in which case it will contain information read from the SCSI inquiry commands. DIOCSDINFO Give the driver a new disklabel to use. The driver will not write the new disklabel to the disk. DIOCKLABEL Keep or drop the in-core disklabel on the last close. DIOCWLABEL Enable or disable the driver's software write protect of the disklabel on the disk. DIOCWDINFO Give the driver a new disklabel to use. The driver will write the new disklabel to the disk. DIOCLOCK Lock the media cartridge into the device, or unlock a cartridge previously locked. Used to prevent user and software eject while the media is in use. DIOCEJECT Eject the media cartridge from a removable device. In addition, the scsi(4) general ioctl() commands may be used with the sd driver, but only against the 'c' (whole disk) partition. NOTES
If a removable device is attached to the sd driver, then the act of changing the media will invalidate the disklabel and information held within the kernel. To avoid corruption, all accesses to the device will be discarded until there are no more open file descriptors referenc- ing the device. During this period, all new open attempts will be rejected. When no more open file descriptors reference the device, the first next open will load a new set of parameters (including disklabel) for the drive. FILES
/dev/sdup block mode SCSI disk unit u, partition p /dev/rsdup raw mode SCSI disk unit u, partition p DIAGNOSTICS
None. SEE ALSO
ioctl(2), intro(4), scsi(4), wd(4), disklabel(5), disklabel(8), fdisk(8), scsictl(8) HISTORY
The sd driver was originally written for Mach 2.5, and was ported to FreeBSD by Julian Elischer. It was later ported to NetBSD. BSD
January 18, 1996 BSD
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy