Topic: ramdisk configuration?

I would like to setup a small ramdisk (~1mb) on the chumby that I can use for sensor data storage without constantly writing to the internal sd card or a usb flash drive.  I was hoping someone could point me towards information on how to configure this for the chumby, what I have found so far involves the grub.conf file.  But that looks to be fore a different linux distro.  Thanks!

Re: ramdisk configuration?

Just use /tmp - it's in RAM and will expand as necessary.

Re: ramdisk configuration?

Can you tell me if my chumby is really using RAM for the tmpfs file system?
When I looked at the fstab file it looks like it CAN be configured that way, but that
it isn't by default.  Is that true?  here is my fstab:  Notice the Pound sign before the /dev/shm line?

chumby-:/etc # cat fstab
rootfs          /               rootfs      rw                  0 0
/dev/root       /               ext3        ro                  0 0
none            /proc           proc        rw                  0 0
none            /sys            sysfs       rw                  0 0
#none            /dev/shm        tmpfs       defaults            0 0
none            /mnt            tmpfs       size=32m            0 0
none            /var            tmpfs       size=32m            0 0
none            /dev            tmpfs       size=32m            0 0
none            /dev/pts        devpts      defaults            0 0
none            /proc/bus/usb   usbfs       defaults            0 0
/dev/mmcblk0p5  /psp            ext3        rw,data=journal,noatime     0 0
/dev/mmcblk0p6  /mnt/storage    auto        rw,noatime          0 0


Is that # line in there as information to help you understand that the tmpfs
file system is handled in RAM by the kernel, or is there an option to remove
that pound sign to convert over to RAMDISK for tmpfs?

Thanks,  Barry Mead

Re: ramdisk configuration?

Type "mount"

The /tmp mount is created elsewhere.

5 (edited by BarryMead 2011-03-20 03:58:23)

Re: ramdisk configuration?

The way I am using my chumby hackerboard, it wanders in and out of different WiFi access points constantly.
Is there any way to make the     "/etc/resolv.conf"     file appear in the tmpfs tree, where it will be rw, and not write to the flash card every time it changes AccessPoints?  I know that the entire /etc directory cannot be
moved over there, but is there a way to force only that file in the etc directory to move over there?  I already tried a symbolic
link, and that didn't work, because the dhclient does a rename (mv) of resolv.conf as part of the network resolution process.
I suppose I could modify the source code for dhclient and tell it to save the file in such a way as to preserve the
symbolic link.

I have been searching for a couple of hours.  Do you happen to know which source module contains the dhclient.c source?

  Thanks,  Barry Mead

6 (edited by Materdaddy 2011-03-20 10:32:31)

Re: ramdisk configuration?

The way the rootfs on a chumby classic is setup, /etc/resolve.conf is a symlink to /tmp/resolve.conf.  If your rootfs isn't setup that way, you can do that once, so you aren't constantly writing to the rootfs.

Just run:
mv /etc/resolve.conf /tmp; ln -s /tmp/resolve.conf /etc/resolve.conf

Linux Guy - Occasional Chumby Hacker

Re: ramdisk configuration?

I had already tried that technique, and while it may work properly on the Chumby Classic, it doesn't seem to work on the Chumby Hackerboard.  With that configuration in-place dhclient eth0 yields this group of error messages:

[   44.720000] eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[   44.950000] eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
/sbin/dhclient-script: line 31: /etc/resolv.conf.dhclient: Read-only file system
chmod: /etc/resolv.conf.dhclient: No such file or directory
/sbin/dhclient-script: line 42: /etc/resolv.conf.dhclient: Read-only file system
/sbin/dhclient-script: line 42: /etc/resolv.conf.dhclient: Read-only file system
mv: can't rename '/etc/resolv.conf.dhclient': No such file or directory

I am going to look into the /sbin/dhclient-script (script) and see if something can be changed in there that will
solve this issue.  Thanks for the input.

8 (edited by BarryMead 2011-03-21 10:04:59)

Re: ramdisk configuration?

I Solved the issue.  All I had to do was to edit the /sbin/dhclient-script file and replace all of the references to
/etc/resolv.conf, and /etc/resolv.conf.dhclient, and /etc/resolv.conf.dhclient6 with /tmp/resolv.conf, and /tmp/resolv.conf.dhclient, and /tmp/resolv.conf.dhclient6    Now the symbolic link from /etc/reslov.conf to /tmp/resolv.conf

Works like a charm.  Thanks for setting me back on the right track.   Barry Mead