• Please review our updated Terms and Rules here

Volatile USB RAM disk?

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
44,227
Location
Pacific Northwest, USA
I've got a bit of an unusual problem.

I need a USB (or other) RAMdrive that will persist across boots (e.g. rebooting operating systems) but not across power cycles.

In other words, I need assurance that once power is off, the data is gone. (I've got some paranoid customers)

Does anyone know of such a beast? Ideally, it would be something like a USB flash drive but with volatile RAM instead of flash.

I know that a few years ago, Super Talent marketed a RAM cache USB drive, but the only used specimens available are being scalped for stupid dollars (50-100x original cost)
 
Last edited:
Maybe, will it survive across booting? But SATA is out of the question (can't go into why)

I need perhaps 150MB tops. I wonder if I could take a cheap RPi or some such and configure it to work as a USB device rather than a host.
 
I've got a bit of an unusual problem.

I need a USB (or other) RAMdrive that will persist across boots (e.g. rebooting operating systems) but not across power cycles.
IOW, a RAMdrive that will still contain the data after a warm boot, e.g., a 'Restart' from the Shut Down menu but not after a cold boot.
 
So, it will contain data if I start with Win98SE and switch to Linux on reboot? Clearly, if there are special device drivers involved, this is a non-starter.
 
Hey, slow down... I haven't even found a RAMdrive that survives a warm boot let alone one that doesn't use a device driver, either. :) :) :)

It seems that you need a piece of semi-volatile hardware, whatever that is.

Otherwise, a script would work for you.
 
Build a cheapo widget out of a PIC which will generate a random number on powerup and report it via (or something). Then use that as the key for an encrypted drive. When the power goes out, the key gets lost, and the data on the drive is inaccessible.

It's possible that something like a Yubikey will already have this functionality.
 
You can easily do it with any SoC board that supports peripheral mode USB. Pi, Pi Zero, PCM, Intel compute stick, chromecast, etc, etc. You just need to power it externally from the host system you have it plugged into in-case the host system drops power periodically during the boot process (as drivers initialize/reinitialize). Linux has a gadget driver for USB mass storage class. You just point it to a file to use as a block device. That file can be one created on a tmpfs file system (RAM disk). Would be pretty trivial to do it on any Pi.
 
How would it work on the Win98SE side? Use the mass storage update to see the usb device?
 
Last edited:
Maybe, will it survive across booting? But SATA is out of the question (can't go into why)

I need perhaps 150MB tops. I wonder if I could take a cheap RPi or some such and configure it to work as a USB device rather than a host.

add on a usb/sata converter? it's a bit of a kludge, but should work.
 
You can easily do it with any SoC board that supports peripheral mode USB. Pi, Pi Zero, PCM, Intel compute stick, chromecast, etc, etc. You just need to power it externally from the host system you have it plugged into in-case the host system drops power periodically during the boot process (as drivers initialize/reinitialize). Linux has a gadget driver for USB mass storage class. You just point it to a file to use as a block device. That file can be one created on a tmpfs file system (RAM disk). Would be pretty trivial to do it on any Pi.

That's my thought. An Orange Pi (maybe even a Pi Zero) should do the trick, but I have to find out if it's trivial to get the USB port to act as a device. A OP has between 512MB and 1GB of DRAM, which should be more than enough for my purposes.
 
You also have to hope you never run into the Raspberry Pi's USB data corruption problem which has never been totally solved.
 
The Pi Zero emulating a flash drive is a good thought...and set it up to store the data file in ramdrive space (/run/shm). Only question is if powering it on and off improperly, such as would likely be the case with something like this, would corrupt the on-board SD card. I guess there is also the question of whether the customer would trust something like that which has an SD card on board, even though it's not writing the data to it...

I know Arduinos can be configured to pretend to be USB HID devices...I wonder if there's any way to make one of them be a flash drive? Trick would be somehow connecting DRAM or the like to it. Probably a long shot...just thinking out loud.

Wesley
 
One can easily avoid sd card corruption by mounting the root partition read only. I'm using minibian/jessie for an IDE emulator using a Pi zero. I remount root read/write manually whenever I want to update a package or similar need then sync/reboot cleanly when done. I keep 1GB of my SD card reserved for root and the rest an ext4 partition that has the IDE drive images to serve up.
 
So, it will contain data if I start with Win98SE and switch to Linux on reboot? Clearly, if there are special device drivers involved, this is a non-starter.

The Gigabyte i-RAM is a PCI card, but it only uses the slot for power. It has a single SATA150 port for the data interface and doesn't require drivers other than for the SATA controller on the motherboard.

But RAM isn't as volatile as you may think. It's been demonstrated that memory modules can retain significant portions of uncorrupted data for several minutes after power is removed.
 
I know that--I remember testing 16Kb DRAMs. The Intel 2117s would hold data for milliseconds with no refresh; the NEC uPD416s go for for half a minute. It was remarkable.

In this case, we're more concerned about days after power-down. I simply need to assure the customer that no permanent record of the data is retained. He's unwilling to accept over-writing.
 
Back
Top