~~~~~~~~~~~~~~
Hello all.
Nothing beats a ramdisk for speedy copy and save operations, even in this
age of fast hard disks and USB drives.
As the name of the archive suggests, the creation script takes 2/3 of your
free RAM and creates a ramdisk out of it. "2/3 of free RAM" means that
your apps should still have lots of room to run after /mnt/ram1 is created.
Edit 11 Dec. 2018 --
Actually this has been reduced to 11/20ths, to avoid any snafus. Please
use the main script below. Do download this package, but please replace
the RAMdisk creating script with the one below.
Thanks.
-- End of edit
It is strongly recommended that YOU DO NOT USE THESE SCRIPTS
if you have less than 3 Gb's of RAM on your machine. Use
Pizza'sGood original script instead (URL below). Are we clear about this?
The attached pet archive includes 4 ramdisk bash scripts to
create,
fill,
check and
back-up /mnt/ram1.
The creation and filling at boot-up, and the back-up at shutdown are
automatic. The checking is up to you (but you don't normally need to).
The back-up script is located in /etc/init.d. It uses a shut-down technique
developed by BarryK, as I understand it. It copies (aka back-up) the
contents of an active ramdisk at /mnt/ram1 to /mnt/home/ramdisk.
Conversely, at boot-up, if there is some content in /mnt/home/ramdisk,
the zzz-ramdisk script in /root/Startup creates /mnt/ram1 and copies that
content there.
The Start-up filler script checks the size of the contents vs the capacity of
the ramdisk. If the contents' overall size is too big to fit on the ramdisk,
nothing is copied. In such a case you will have to choose what to copy to
your ramdisk manually. But normally you don't have to do this.
Reserve directory /mnt/home/ramdisk only to the shuttle with /mnt/ram1.
Don't put anything else in it.
Basically, I made it to run so that you, the user, don't have to worry
about it. The ramdisk's content is saved at boot-down and re-copied at
boot-up.
If for some reason, you need to recycle X or your window manager, it
just displays a 5-seconds message that the ramdisk is there; it doesn't
reformat or destroy anything in an existing ramdisk during your session.
Please note that hard shut-downs are not protected, meaning: if you
ever need to do an emergency shut-down with your computer's reset
button, your ramdisk contents will be lost.
But with regular power-offs and re-boots, you should find the contents of
your ramdisk in /mnt/ram1 from one session to the next.
Inspired by Pizza's Good original script and a discussion with Smithy
on that thread. Thanks to both of them.
I tested it extensively, and I decided to make it a permanent feature of
my current and future Pups -- because it's so handy. But please test it too
and get back to me if it needs improvements. I'll try to accommodate.
Enjoy.
~~~~~~~~~~
PS. The tree of the pet archive is as follows:
[4.0K] ./etc
[4.0K] ./etc/init.d
[ 431] ./etc/init.d/stop_ramdisk-0.1
[4.0K] ./opt
[4.0K] ./opt/local
[4.0K] ./opt/local/bin
[1.6K] ./opt/local/bin/ramdisk_2thirds.sh
[ 834] ./opt/local/bin/ramdisk_check.sh
[ 610] ./opt/local/bin/ramdisk_cp.sh
[ 158] ./pet.specs
[4.0K] ./root
[4.0K] ./root/Startup
[ 33] ./root/Startup/zzz_ramdisk.sh -> /opt/local/bin/ramdisk_2thirds.sh
7 directories, 6 files