logo
background
 Home and Links
 Your PC and Security
 Server NAS
 Wargames
 Astronomy
 PhotoStory
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

Notes index links

Links to all my notes (includes mini-projects and source code etc)

(+) 0001 How do I change the Pi System partition size ?

(+) 0100 Device tree settings

(+) 0201 Power over Ethernet - (PoE)

(+) 0202 Solar Power - (with WiFi)

(+) 0203 Power Bank pass through

(+) 0400 Accessing the SDHC card system image

(+) 0401 Accessing PC shares from the Pi

(+) 0402 Installing samba - (the Pi as a Network Share on your PC)

(+) 0900 Can this approach be scaled up to a PC UPS ?

(+) 1001 Pandora Spotify on the Pi

(+) 1002 Playing movies on the Pi

(+) 1003 Getting VGA from the HDMI socket

(+) 1004 Using the RCA socket

(+) 1005 Using the Pi RS232 serial links

(+) 1006 Using the GPIO pins

(+) 1007 Controlling the Pi Zero ACT LED

(+) 1200 List of standard camera modes

(+) 1300 Auto file names

(+) 6500 How to make the System partition read only ?

(+) 6501 Minimising SDHC corruption on power down

(+) 9000 diode switch

(+) 9001 Auto shut down

(+) 9001 MOSFET switch

(+) C201 High speed photos

(+) Dec 1969 (no desc)

(+) a000 Display setup - (for PhotoFrame)

(+) a001 go photoframe - (how it works)

(+) a002 set photo - (select for display)

(+) a003 go button script - (photoframe pause control)

(+) a005 get photos - (fetch resize)

(+) a00x Other display utilities

(+) c000 CCTV UPS requirements

(+) c001 countering low speed motion detect

(+) c002 Pi Overclocking



(-) c203 Pi ram disk - (tmpfs)


Using a RAM disk

Jessie already has a number of RAM disks (use the df command and note the 'tmpfs' = RAM disk entries).

The good thing about tmpfs is that it 'auto allocates' the space up to the maximum allowed - so the fact that by Jessie already has 3 RAM disks of 200Mb each is irrelevant - that's the max. not the actual used

As with everything *nix, creating a RAM disk is 'non-intuitive' but 'easy when you know how'. You start by defining a 'folder name' - for example 'ram-disk'. This is best placed at 'root' (/) so it's easy to find, however I placed mine within a folder I 'shared' with my PC :-

sudo mkdir /my-folder-for-PC/ram-disk

by default, it's going to be 'read only', so you will have to 'sudo' when you want to write it (and you won't be able to do that from the PC). Instead, chmod :-
sudo chmod +777 /my-folder-for-PC/ram-disk

Next you 'link' the just created folder to the RAM-disk driver tmpfs in the 'file system definitions table', fstab :-

sudo nano /etc/fstab

to define a RAM disk that can expand to 125Mb (10s test at 5fps = 50 jpeg photos allowing 2.5Mb ea.), add the line :-
tmpfs /my-folder-for-PC/ram-disk tmpfs nodev,nosuid,size=125M 0 0 

then 'output' (Ctrl o) the file and 'exit' (Ctrl x) the edit

To 'mount' the RAM-disk (without rebooting the Pi), type :-

sudo mount -a

To check all is OK, use the df command

To change the size, you need to un-mount the folder (sudo unmount -l /my-folder-for-PC/ram-disk = yes, that's umount not unmount), edit fstab and remount

This note last modified: 17th Nov 2017 17:30.

[top]

(+) c901 iR illumination

(+) c902 Viewing a video stream

(+) c905 Image anotation

(+) Dec 1969 (no desc)

(+) raspicamdocs.txt (no desc)

(+) s010 Elevation sensing

Next subject :- index

[top]