Operating System - HP-UX
1820003 Members
3630 Online
109608 Solutions
New Discussion юеВ

How can I create a ramdrive?

 
SOLVED
Go to solution
Guy Blatt
Occasional Contributor

How can I create a ramdrive?

How can I create a ram drive under HP-UX 11? I want to use ram as disk space to increase disk I/O performance. This application needs to think it is writing and reading to/from a disk.
UNIX is the only OS
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: How can I create a ramdrive?

According to this TKB document there was no support for a RAM Disk in HP-UX 8.x, 9.x or 10.x so I seriously doubt there is support in 11.

http://us-support.external.hp.com/cki/bin/doc.pl/sid=9ff1a27e0c26d50b68/screen=ckiDisplayDocument?docId=200000024602486
Bill Hassell
Honored Contributor

Re: How can I create a ramdrive?

The ramdisk driver was designed to be used only with a boot/install kernel and is very limited in maximum size. It is undocumented because it is not stable from revision to revision. Changes to the underlying driver are not documented.

The buffer cache will accomplish most of what a ramdisk would provide.


Bill Hassell, sysadmin
Wodisch
Honored Contributor
Solution

Re: How can I create a ramdrive?

Hello Guy,

in case you still want to know how to do it, the way it
worked some years ago - I have not tried this for quite
some time: ("#" means a comment line)

0) # create a "make_tape_recovery" tape for your box!

1) #Modify your kernel to include the "ram" driver:
1) cd /stand/build
1) /usr/lbin/sysadm/system_prep -v -s system
1) vi /stand/build/system
1) # Edit the system file and add the "ram" driver
1) mk_kernel -s system
1) mv /stand/system /stand/system.good
1) cp /stand/vmunix /stand/vmunix.good
1) rm -rf /stand/vmunix/dlkm.good
1) mv /stand/dlkm /stand/dlkm.good
1) mv /stand/build/system /stand/system
1) kmupdate
1) shutdown -y -r 0

2) # set up the device files and mount the ramdisk:
2) # create the device files with major 9 (both b and c),
2) # and minor 0xVSSSSS, where "V" is the volume num,
2) # and "SSSSS" is the number of sectors in the ram
2) # disk, each sector is 256 bytes.
2) mknod /dev/rram1 c 9 0x101000
2) mknod /dev/ram1 b 9 0x101000 # that's 1MB
2) mkfs -F hfs /dev/rram1 # no point in VxFS here
2) mount /dev/ram1 /ramdisk

As everybody (especially Bill :-) pointed out:
THIS IS UNSUPPORTED, dangerous, and such...

HTH,
Wodisch
John P. Kole
Frequent Advisor

Re: How can I create a ramdrive?

I thought the minor number was actually of the form "0xVSSSSX", where:
"V" - is the volume num
"SSSS" - is the number of sectors
"X" - is defined as "bit flags":
0x0 - use a sector size of 1kb.
0x1 - use a secotr size of 64kb.
0x2 - don't use buffer cache.
What could possibly go wrong?