Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Download RAM – Using Google Drive for Swap (twitter.com/tjhorner)
2 points by magicalhippo on Dec 30, 2021 | hide | past | favorite | 2 comments



Impressive, but wait, there's more... One could create 100TB of ram locally out of thin air. This VM only has 16GB ram. disclaimer dont do this

  mkdir -p /dev/shm/insane;mount -t tmpfs -o size=100T tmpfs /dev/shm/insane;df -Ph /dev/shm/insane

  Filesystem      Size  Used Avail Use% Mounted on
  tmpfs           100T     0  100T   0% /dev/shm/insane
But on a more serious note if one does not mind incredible latency to swap then get a SSD USB3 drive and use it for swap. You might not have the drive plugged in and as such add it to fstab with the "noauto" option using the swapon command to activate it, or use the user-space autofs mounter instead i.e. /etc/auto.master

Swap is an extension of memory and as such you are putting unencrypted memory contents into your swap device. This could be PGP/GPG keys, LastPass, KeePass keys and passwords, PII and more. Putting this into the cloud adds some risk. One can encrypt swap to partially mitigate this risk.


Why waste good 'RAM' on swap? Why not set up Google Drive for ALL your filesystems?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: