6

The following commands are how I create a RAMDisk on Ubuntu 12.04 LTS:

sudo mkdir -p /media/ramdisk
sudo mount -t tmpfs -o size=1024M tmpfs /media/ramdisk

But now I have no idea to eject it.

These commands are what I've tried but not work:

sudo eject /media/ramdisk
sudo umount /media/ramdisk

How to eject RAMDisk properly?

Kevin Dong
  • 1,135

1 Answers1

16

The inverse of sudo mount -t tmpfs tmpfs /media/ramdisk is sudo umount /media/ramdisk.

The last command will only succeed if no application is using /media/ramdisk though. You can use sudo lsof -n /media/ramdisk to find out which programs are blocking the mount point.

Lekensteyn
  • 178,446