Category Archives: RedHat Linux

Configuring RamDisk on RedHat Linux

What is a RamDisk?
A RamDisk is a portion of memory that you allocate to use as a partition. Or, in other words, you are taking memory, pretending to treat it as a hard drive, and you are saving your files to it. Why would you want to use a RamDisk? Well, if you know that certain files you have are constantly going to be used, putting the files into memory will increase the performance of your computer since your memory is faster than your hard drive. Things like web servers with lots of data can be sped up this way

How to use RamDisk
First of all, the default installation of RedHat comes with ramdisk support. All you have to do is format a ramdisk and then mount it to a directory. To find out all the ramdisks you have available, do a “ls -al /dev/ram*”. This gives you the preset ramdisks available to your liking. These ramdisks don’t actually grab memory until you use them somehow (like formatting them). Here is a very simple example of how to use a ramdisk.
# create a mount point:
mkdir /tmp/ramdisk0
# create a filesystem:
mke2fs /dev/ram0
# mount the ramdisk:
mount /dev/ram0 /tmp/ramdisk0

Those three commands will make a directory for the ramdisk , format the ramdisk (create a filesystem), and mount the ramdisk to the directory “/tmp/ramdisk0”. Now you can treat that directory as a pretend partition! Go ahead and use it like any other directory or as any other partition.
If the formatting of the ramdisk faild then you might have no support for ramdisk compiled into the Kernel. The Kernel configuration option for ramdisk is CONFIG_BLK_DEV_RAM .
The default size of the ramdisk is 4Mb=4096 blocks. You saw what ramdisk size you got while you were running mke2fs. mke2fs /dev/ram0 should have produced a message like this:

mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
Linux ext2 filesystem format
Filesystem label=
1024 inodes, 4096 blocks
204 blocks (4.98%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1 block group
8192 blocks per group, 8192 fragments per group
1024 inodes per group

Running df -k /dev/ram0 tells you how much of that you can really use (The filesystem takes also some space):

>df -k /dev/ram0
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/ram0 3963 13 3746 0% /tmp/ramdisk0

Changing the size of the ramdisks
Lilo:
Add this line to your lilo.conf file:
ramdisk_size=10000 (or ramdisk=10000 for old kernels)
and it will make the default ramdisks 10 megs after you type the “lilo” command and reboot the computer. Here is an example of my /etc/lilo.conf file.

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz
label=linux
root=/dev/hda2
read-only
ramdisk_size=10000

Grub:
Add the following to /etc/grub.conf so that it looks like the following:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,4)
# kernel /vmlinuz-version ro root=/dev/hda8
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,4)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,4)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

title DOS
rootnoverify (hd0,0)
chainloader +1

title Linux RAMDISK
root (hd0,4)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ ramdisk_size=10000
initrd /initrd-2.4.20-8.img

Reboot the server for the Ramdisks size to take effect.

DishNet DSL, Aztech DSL Turbo 100U and RedHat Linux

Aztech 100U DSL USB modem is widely used in India by DishNET DSL to provide DSL connectivity. In order to use their DSL service on Linux, two steps are required:
1) Installing/configuring the driver to work under linux
2) To make the DSL modem connect to the provider.

OS Configuration: RedHat linux 8.0

1) Installing/configuring the driver
a. download the driver from http://eciadsl.flashtux.org/eciadsl-usermode-cvs.tar.gz
b. untar it and run the configuration script (refer README/INSTALL for more details.
c. provide the following details when prompted:
Vid1/Pid1 : 0509 / 0801
Vid2/Pid2 : 0915 / 0802
VPI/VCI : 0/32
d. run the startmodem script. If configured properly, you would be seeing the modem working.