fli4l - floppy-isdn4linux                                   ramdisk.txt 2.0.7
-------------------------------------------------------------------------------


Package Ramdisk - A generic Ramdisk
===================================

Why?
	I wanted to keep the bookmarks of my browers in a central place. This way I can
	access it from different PCs. But the harddrive in my router needs a few seconds to startup.
	This leads to the idea to keep that file in a ramdisk.
	With the OPT_TCFROMTO you can save the contents of the ramdisk onto the harddrive.

Requirements:
	Enough RAM.
	A harddrive to save the files in the ramdisk (optional)

Configuration:
	Just a very few settings:
	OPT_RAMDISK='yes'			# use a ramdisk: yes or no
	RAMDISK_SIZE='8000'			# size of the ramdisk in KByte
	MOUNT_RAMDISK='/var/sandbox'		# mount point

How is it working?
	It is based on an example script which I tweaked into an Opt package.

	------------------------------------------------------------------
	eval ram='$RAMDISK_SIZE'
	eval ramdisk='$next_rd'
	eval path='$MOUNT_RAMDISK'

	if [ "$ramdisk" -le 7 ]
	then                                                                    # ramdisk available? yes
	    /bin/dd if=/dev/zero of=/dev/ram"$ramdisk" bs=1k count=$ram  >/dev/null       # create ramdisk
	    /sbin/mke2fs -q -vm0 /dev/ram"$ramdisk" $ram  >/dev/null                      # format ramdisk
	    mkdir -p $path                                                      # create dir
	    /bin/mount /dev/ram"$ramdisk" $path                                 # mount ramdisk
	    next_rd=`/usr/bin/expr $ramdisk + 1`                                # set ramdisk + 1
	else                                                                    # ramdisk available? no
	    /usr/local/bin/colecho "*** ERROR: no generic ramdisk available ! ***" br x br
	    sleep 10
	fi
	------------------------------------------------------------------

Usefull:
	The OPT_TCFROMTO can save the contents of the ramdisk.
	Below is my configuration of this opt. Perhaps it helps you understanding the details.
	------------------------------------------------------------------
	OPT_TCFROMTO='yes'
	TCFROMTO_N='1'				# Number of files to copy

	TCFROMTO_1_NAME='opera6.adr'		# Filename to copy
	TCFROMTO_1_DIR=''			# Empty if file copy
	TCFROMTO_1_FROM='var/sandbox'		# Source directory
	TCFROMTO_1_TO='/usr/local/data/sandbox_' # Destination directory on mounted device !!!
	TCFROMTO_1_MODE='2'			# '0' only backup
						# '1' only restore
						# '2' backup and restore
	TCFROMTO_1_BACK='0'			#        : '0' no backup -> overwriting
						# backup : '1' backup of existing
						#        : '2' multiple backups with date and time

	TCFROMTO_1_REST='2'			#         : '0' no backup -> overwriting
						# restore : '1' backup of existing
						#         : '2' multiple backups with date and time
	------------------------------------------------------------------

Legal disclaimer:
	You use this opt on your own personal risk. I take now responsibility of any kind.

Bugs and improvments:
	Please contact me at fauthd@web.de
	I do not answer any questions beyond the scope of this opt.
	I'm not a Linux guru.
-eof-
