Linux – best ramdisk without swap on linux

linuxramdisktmpfs

I want a ramdisk on linux.

There is ramfs and tmpfs.

Tmpfs is what I want because it acts like a disk (size limits, etc.).
However, it uses swap which means it may touch disk if it gets full.

IF I don't have swap turned on, will it still work?

I don't want that mount to touch disk at all.

Best Answer

Tmpfs will still work without swap, since it just uses the normal Linux memory allocator. Do not worry, it won't create swap for you out of nothing just because it doesn't have it.