0

I'm creating ramdisks on MacOS following the usual procedure (ie: diskutil erasevolume HFS+ mydisk after hdiutil attach -nomount ram://SIZEINBLOCKS). They work, but they show up in Finder windows with the usual icon for external drives.

I'm using these ramdisks for development tasks (as disposable drives where I can try builds and easily discard them), so I'd prefer that they don't have a drive unit icon in Finder windows. Is that possible? How?

1 Answer 1

1

Try

chflags hidden "/Volumes/RamDisk"

And restart your finder with

killall Finder
5
  • One may also have to manually remove them from under Devices on the Sidebar in Finder. Commented Feb 20, 2020 at 11:48
  • It didn't work for me (Sierra 10.12.6). I tried both as user and as root, both with the quotation marks and without, but nothing... (and yes, I restarted Finder)
    – cesss
    Commented Feb 20, 2020 at 11:48
  • This does not remove existing ones from under Devices on the Sidebar in Finder, nor does it stop new ones from appearing on the Sidebar in Finder. They will still show on the Desktop if hidden files are allowed to show. Commented Feb 20, 2020 at 12:09
  • @user3439894 Is it possible to create the ramdisk already hidden from the beginning, rather than trying to hide it afterwards?
    – cesss
    Commented Feb 20, 2020 at 12:49
  • @cesss, There are two setting in Finder's preferences that you could uncheck to not have the RAM Disks show, however this also hides all other external disks. Finder > Preferences > General > Show these items on the desktop: > uncheck External disks and Finder > Preferences > Sidebar > Devices > uncheck External disks. Commented Feb 20, 2020 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .