RAM disk on Linux and macOS
- Mount a temporary ram partition
- Makes a partition in ram which is useful if you need a temporary working space as read/write access is fast.
- Be aware that anything saved in this partition will be gone after your computer is turned off.
Linux :
mount -t tmpfs tmpfs /mnt -o size=1024m
macOS :
512 : block size
1024 : 1024 ?
1024*1024 : 1048576 = 1024Mo = 1Go
diskutil erasevolume HFS+ /mnt\
`hdiutil attach -nomount ram://$((1024*512*1024*1024))`