#StackBounty: #linux #memory #ramdisk How to deallocate Linux ramdisk

Bounty: 250

I am having trouble to deallocate ramdisk in Linux.
I think that blockdev –flushbufs /dev/ram0 used to work in the past.

But now

cat /dev/urandom > /dev/ram0

md5sum /dev/ram0
c71df700969640324b201ae5f7a96c41  /dev/ram0

blockdev -v --flushbufs /dev/ram0
flush buffers succeeded.

md5sum /dev/ram0
c71df700969640324b201ae5f7a96c41  /dev/ram0

It did not wipe the ramdisk. I tested in recent Linux 4.14 and 5.4.
Am I missing something?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.