Raspbian uses dphys-swapfile, which is a swap-file based solution instead of the "standard" swap-partition based solution. It is much easier to change the size of the swap.
The configuration file is:
The content is very simple. By default my Raspbian has 100MB of swap:
If you want to change the size, you need to ...
Do not do this at all.
You should not enable swap on the Raspberry Pi.
Although it is possible, it is not useful.
Even on a class 10 SDHC card, it is just too slow. Also you will reduce the lifespan of the SD card.
On any flash-based storage device (SD card, SDD, USB thumb drives) you are also likely to see system-wide pauses while a large group of flash ...
Yes, it should be safe to remove the X server. I haven't actually tried this on the Raspberry Pi (as I don't yet have one), but I expect that removing the X server, with sudo apt-get remove xserver-xorg will work just fine.
On Debian and most other sensible Linux distributions, the X client packages do not have dependencies on an X server, precisely so that ...
I was wondering if there was any way to allow more ram
Not more physical RAM, but you can increase the amount of system memory by using swap, which is a region of secondary storage. Traditionally on linux this is done with a small dedicated partition on a hard disk. Current Raspbian uses something similar, a swap file, which is just a normal file that's ...
To avoid an error on startup regarding dphys service, try to disable swap on this way:
sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt purge dphys-swapfile
IMHO, the swap was enabled by default because without the swap when you run out of the memory you'll get a kernel panic and/or the application killed, that might be avoided using swap. With the swap actually active, the performance might be really bad, but the execution still continues. Since nobody could possibly know in advance how the particular RasPi ...
The 8GB is only the guideline size of a card. Because of the nature of flash memory and management of dead cells there are slight variations in actual usable space.
This usable space will also decrease as the card gets older and older. With SSD's and SD cards like this it is a good idea to leave a small amount of space that is unused. I would say about 1% ...
It is a pity that the Raspberry Pis do not have GigaBit Ethernet but it is at least theoretically possible to have swap space on a network device - the Linux Terminal Server Project can offer it from the server to the clients according to this item on their wiki.
I found a Foundation Forum topic "Tip: Swap over nfs" that shows how someone who already had ...
Raspbmc uses /etc/init/swap.conf to configure swap via /swap file. It first checks for presence of /home/pi/.enable_swap.
If you delete /home/pi/.enable_swap then swap file is not created, and then just recreate it with touch /home/pi/.enable_swap if you need swap turned on and reboot.
Most likely because at some point previous to this swap was needed. Moving data into swap is a priority when free memory is low, but moving it out is not a priority when free memory is available. The justification for this is pretty sound if you think about it for a bit.
Stuff that gets swapped out in the first place is stuff that isn't being accessed ...
Network swap is a bad idea. The whole purpose of swap is to replace memory, but it's only feasible if this is done locally.
I believe you're going through some premature optimization. I'd put my time into getting everything working, then doing actual tests to see if you do run into any issues or not. If you're running into severe issues, that's the time to ...
I'm the developer of Raspbmc, and I provided a simple method for installing swap (although it's disabled by default, and not recommended for 512MB Pis).
Simply run this via SSH:
You will now have a swap file created at /swap.
Short answer: This is a bad idea overall. And a terrible idea in terms of stability.
Memory swapping is something like a last resort measure when your system will run out of RAM available to load all the programs and their data.
How well the Operating System manages the swapping pages will be a determinant to how fast your system will perform....
How could I get some extra space on my RPI?
The clear and obvious answer is get a bigger SD card. 8 GB isn't really that large.
Short of migrating:
You could look into removing any development packages you're not using.
Run the command sudo apt autoremove to remove packages that are no longer being used.
Your memory isn't "almost fully used" in the sense you think.
Total: The amount of memory available to the system.
Used: The amount of memory containing information tracked by the system.
Cached: The amount of memory in use as a page cache by the system. Basically, this is stuff that was read off disk (or whatever storage) into memory for some useful ...
If you're concerned about SD corruption, then I'd say leave swap on the NAS. Spinning disk is much better at handling constant read/write/rewrite operations than SD cards and the WD Red series is designed to act in a NAS system. That being said, SD cards are getting better at handling the larger number of IO operations, provided the SD card is of good ...
It's a system service. You can systemctl disable dphys-swapfile if you want, and list a swap partition in fstab instead (or whatever you normally do, or not use any swap). You can delete the swap file too since (pretty certain) its a dphys-swapfile exclusive thing.
I'm not sure why it is not fixing the OOM kills
Is your swap partition exactly the same ...
The first line of df isn't saying the root directory is using all that space, that's the root mount point, containing every directory which isn't covered by one of the other mount points.
I suspect the transmission directory isn't on the USB stick as you intend but actually on the SD card.
You can use the du command to examine where space is being used. (...
.*.swp files are created by the vi editor to log changes so that the undo command can work.
They are created with the same permissions as the file they are logging in the same directory. Because the name starts with a period they are hidden.
If you've used sudo vi /etc/rc.local and created /etc/.rc.local.swp you'll need to use sudo rm /etc/.rc.local.swp to ...
I would recommend enabling swap in the form of zram, which should give you much more graceful degradation than you're seeing. My guess is that the kernel is trying to keep you from oomkiller by repeatedly paging out text segments, which then have to be brought back in to execute. Better to execute at all than kill things, in the kernel's opinion.
Swap is only used if you run out of memory.
The Pi normally uses a swapfile, which if not used has no penalty, but if required is slow.
Without swap the OS will terminate low priority processes or crash. The choice is yours.
There are a few issues since the current version of bash is not interpreting zram.sh properly.
You can test wether bash interpretes your zram.sh well by executing (as root) following script -no impact! just see! The instructions modprobe and swapoff are disabled-:
# modprobe zram num_devices=$cores
That's the default size of the swap file, 100 megabytes.
If you want to make it smaller edit /etc/dphys-swapfile and change 100 to some other number.
Use the following commands to put the resize into affect.
Use the following command to permanently remove the swap file.
sudo update-rc.d ...
Are you sure you really want to have swap on an external disk like that, over USB? It seems a little unusual, and might not be all that fast, so you might want to double check that requirement...
Assuming you do want to do that, the easiest way to have swap enabled at boot is via fstab. This would require the disk always be there, but if you can manage that,...