All Projects → mroth → ramdisk

mroth / ramdisk

Licence: MIT License
🐏 Convenience wrapper for managing RAM disks

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ramdisk

webpack-plugin-ramdisk
🐏 A webpack plugin for blazing fast builds on a RAM disk / drive
Stars: ✭ 118 (+257.58%)
Mutual labels:  ramdisk
Setup-Xcode-Derived-Data-RAM-Disk
Swift Script: Get the fastest build times in Xcode. This repository accompanies my article linked here:
Stars: ✭ 118 (+257.58%)
Mutual labels:  ramdisk
blackhole
🌌 A semi-temporary directory for Windows, macOS & Linux
Stars: ✭ 35 (+6.06%)
Mutual labels:  ramdisk
RamDisk
RamDisk is a library for create virtual disk drive on system memory
Stars: ✭ 39 (+18.18%)
Mutual labels:  ramdisk

ramdisk 🐏

Convenience wrapper for managing RAM disks across different operating systems with a consistent interface.

Usage

Help screen:

$ ramdisk -h
ramdisk 0.1.0 🐏

Usage:
  ramdisk [options] create [<mount-path>]
  ramdisk destroy <device-path>

Options:
  -h -help      Show this screen.
  -v            Verbose output.
  -size=<mb>    Size in megabytes [default: 32].

Creating a new ram disk with a specified size:

$ ramdisk -size=512 create
512MB ramdisk created as /dev/disk5, mounted at /tmp/ramdisk-401987900
To later remove do: `ramdisk destroy /dev/disk5`

Installation

  • 💾 Download a precompiled binary.
  • 🍺 Homebrew on macOS: brew install mroth/tap/ramdisk
  • 📦 Compile via Go toolchain: go install github.com/mroth/ramdisk/cmd/ramdisk@latest

Platform Support

macOS

Works great and does not require superuser access.

The basic steps followed are:

  • Create an unmounted but attached device in RAM that consists of the appropriate number of device blocks via hdiutil.
  • Format a new uniquely named HFS+ volume on that device via newfs_hfs.
  • Mounts the volume at a uniquely generated path within the /tmp filesystem, via mount.

This normally requires a sequence of arcane commands on the macOS command line which I can never remember, and thus was the primary reason I created this wrapper.

Linux

Things are quite simple and work great via tmpfs on Linux! (But note that most Linux implementations unfortunately requires sudo access to mount new volumes.)

If you prefer a sudo-less route, most modern Linux on kernel 2.6+ often _already_ has `/dev/shm` mounted, which is memory backed, so you can also just use that without any initialization at all.

Windows

This would be great, unfortunately there is no built-in support at the operating system level at current time. The standard solution seems to be to use ImDisk, but I haven't built support for that into this library yet because well, relying on third-party drivers to be installed on an end user system isn't going to work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].