http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html

One caveat however. Do not use /dev/shm. /dev/shm is meant to be used for
POSIX IPC shared memory. So it'd probably work just fine, but using tmpfs
is much better, and the directory used can be placed anywhere in a file
system( within reason ).

So, at the command line: mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk

Or, in /etc/fstab: tmpfs       /mnt/ramdisk tmpfs   nodev,nosuid,noexec,
nodiratime,size=1024M   0 0


Also keep in mind, again, that the file / directory can be placed any where
in the systems directory structure. So if you wanted a file somewhere in
your home directory called "somefile" . . .


$ mkdir ~/test
$ mount -t tmpfs -o size=256m tmpfs /home/john/test
$ touch ~/test/somefile

One additional note I would like to leave on. I've used as much as 256m for
a "ramdisk" on the beaglebone, so that does work. You can perhaps make it
slightly bigger, but I would not push it. Typically though for a large
single application, I've found that the beagelbone will use only up to
around 120m. it really depends on what the beaglebone is doing.

On Fri, Apr 8, 2016 at 3:52 PM, John Baker <johnba...@ieee.org> wrote:

> William,
> No, I did not know about writing to the tmpfs directory. That's a great
> idea. I don't know how to do it so will search for info on it.
>
> I decided that I don't need to write these particular files but can simply
> save the data to RAM. However, I will need to write a log file to a USB
> memory stick, so the tmpfs directory should fit the bill exactly to
> temporarily save the data before writing to USB.
>
> Thanks very much for the suggestion.
> John
> johnbakeree.blogspot.com
>
>
> On 4/8/2016 1:38 PM, William Hermans wrote:
>
> *Now after all that I've decided not to write anything to the eMMC,
>> fearing that I'll cause some hiccup with the writes.*
>
> *John*
>
> Eh ? What do you mean ? You do realize that you can create a tmpfs
> directory, that is located in memory, where you could then create files
> that are also placed in memory ?
>
>
> On Thu, Apr 7, 2016 at 4:59 PM, John Baker <bakerengineerin...@gmail.com>
> wrote:
>
>> Now after all that I've decided not to write anything to the eMMC,
>> fearing that I'll cause some hiccup with the writes.
>> John
>> johnbakeree.blogspot.com
>>
>> On Wednesday, April 6, 2016 at 11:24:18 AM UTC-7, John Baker wrote:
>>>
>>> Gosh, how did I miss that, that the mode is a string. Well it had to be
>>> something simple like that. Quoting the w and r fixed the problem. Very
>>> embarrassing.
>>> :-[
>>> Thanks,
>>> John
>>>
>>> On 4/5/2016 7:21 PM, Dennis Lee Bieber wrote:
>>> > On Tue, 5 Apr 2016 13:43:47 -0700 (PDT), John Baker
>>> > <bakerengi...@gmail.com> declaimed the
>>> > following:
>>> >
>>> >> I want to store a little data on the eMMC from my Python code. My
>>> program
>>> >> is not getting errors when I try to write a very short data file but
>>> it
>>> >> doesn't actually seem to write it as I cannot read it back. I am
>>> using
>>> >> f = open('MyFile.txt', w)
>>> >>
>>> >         First problem -- the mode is a string...
>>> >
>>> > f = open("MyFile.txt", "w")
>>> >
>>> >> or
>>> >> f = open('/home/debian/Desktop/MyFile.txt', w)
>>> >>
>>> >> or
>>> >> f = open('MyFile.txt', r)
>>> >>
>>> >> or
>>> >> f = open('/home/debian/Desktop/MyFile.txt', r)
>>> >>
>>> >> to open the file and am not getting any errors but Python is not
>>> finding
>>> >> the file and I cannot find the file with a  search from WinSCP.
>>> >>
>>> >         Did you ever write anything to the file, and did you close the
>>> file?
>>> >
>>> >         f.write("Some junk\n")
>>> >         f.close()
>>> >
>>> >
>>> >         The first open should create the file in whatever your current
>>> working
>>> > directory is. Without connecting my BBB I can't confirm if the second
>>> is a
>>> > valid path.
>>> >
>>> >         And last -- how are you running it? SSH to a command line?
>>> >
>>>
>>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to beagleboard+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/4eMyTYs_lnw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> beagleboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to