You are not logged in.
Pages: 1
I'm having some difficulty with the default swap file that was created during BL installation.
The swap file was working perfectly as I constantly monitored this via `htop`. However, the swap was consistently maxed out as it simply wasn't large enough (around 700mb).
I should note that this BL installation is actually an Oracle VirtualBox VM image and not a physical machine, although it may be relevant to physical systems configured in the same way.
As the original swap (created by the LVM) was not large enough, I decided to add a new disk to the VM which would be completely dedicated to swap. I added the new disk in the VirtualBox settings, and configured this to be a swap partition on the disk using GParted. I also added this new disk (and its swap partition) to /etc/fstab by replacing the orignal entry:
from:
/dev/mapper/bunsen--vm--vg-swap_1 none swap sw 0 0
to:
UUID=dba74b07-1670-1bd8-b0b3-2b6faa25bd00 none swap sw 0 0
I then tried to configure this using `swapon`, and then monitoring the new usage via `htop`. I could see that the "Swap" counter in htop had recognised the new virtual disk as the swap, because the size of the available swap had increased from 700M to 8010M (the size of the virtual disk). However, it seemed that the swap was never being utilised, always at 0/8010M.
As a test, I decided to revert back to the original swap file, reversing my changes but it also seems that this original swap file cannot be found.
I've tried to enable it with `swapon -a` but I receive:
swapon: stat failed /dev/mapper/bunsen--vm--vg-swap_1: No such file or directory
However, the file seems to exist (as a symlink):
ls -la /dev/mapper/bunsen--dev--vm--vg-swap_1
lrwxrwxrwx 1 root root 7 Nov 14 09:28 /dev/mapper/bunsen--dev--vm--vg-swap_1 -> ../dm-1
And as an actual file, dm-1:
brw-rw---- 1 root disk 254, 1 Nov 14 09:28 /dev/dm-1
Also trying:
grep -i --color swap /proc/meminfo
gives:
SwapCached: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
And htop now shows 0/0M
Am I missing a step in re-enabling this swap file? Is it a case of simply adding looser permissions to the dm-1 file?
Last edited by jimjamz (2017-11-23 09:18:28)
Offline
Think it's something you'd have more luck taking up with google/etc. Have read about it but always tend to prefer a dedicated swap partition, equal to the amount of physical memory (slightly larger). So as yet never even bothered with a swap-file. Always tend to have 2 sometimes 3 gnu/Linux os's, they all share the swap vs a a swap-file, which can likely be shared too, dunno. Reason for posting though is if you're seeing much by way of swap acitivity, then you may want to lower swappiness on that VM or other install(s.)
On any system, even really memory constrained one's my goal is always seeing none or lil swap activity, up till physical memory get's close to being exhausted. RAM is much faster and disk i/o in general tend to think of as bad for performance and responsiveness. VM=virtual memory is cool for sure, though it's mostly a hang-over from days when computers were really limited in amount of RAM. Was a stroke of genius at the time, default of swappiness 60, still too often seen today is kinda nuts in my views on the subject.
Last edited by BLizgreat! (2017-12-03 02:43:37)
Offline
Pages: 1