My problem was that all the computers that were going to use that CD were very old, and had few ram...
So far so good... But two ramdisks of the same size? There was a ram limitation, so I couldn't use two.
So I had to find a solution. This is what I did to fix it:
echo "Creating ext2fs on $dev_ram..."
/sbin/mke2fs -m 0 -i 1024 -q $dev_ram > /dev/null 2>&1
# MOUNT THE RAM DISK
echo "Mounting ramdisk on $dir_ramdisk..."
mount -n $dev_ram $dir_ramdisk -t ext2
# COPY FILES TO THE RAM DISK
echo "Copying files to ramdisk..."
cp -a $dir_needwrite/* $dir_ramdisk > /dev/null 2>&1
mount -n $dev_ram $dir_needwrite
umount -n $dir_ramdisk
The trick is this: What I do is to mount the same ramdisk in two places and then umount the old location. And because one is already mounted when you mount it again in the other location you don't have data lost.