简体   繁体   中英

Ejecting a hidden volume

I was having a problem with the script that creates my installer for macosx not working and I discovered it was because it was creating a folder called /Volumes/myinstaller 1 instead of /Volumes/myinstaller. While investigating this issue I found that I have a hidden volume called /Volumes/myinstaller with all the relevant files inside but I cannot rmdir the directory because it contains many layers of files. Is there someway to eject a hidden volume through the terminal or to see the hidden volume in the finder?

In general, to dismount volumes, hidden or otherwise, you want to use diskutil unmount (or hdiutil detach ) and not umount , thanks to OSX's diskarbitrationd :

$ sudo umount /Volumes/NAME/
Password:
umount: unmount(/Volumes/NAME): Resource busy
$ diskutil unmount /Volumes/NAME/
Volume NAME  on disk3s1 unmounted

It is also possible to use diskutil to return information about mounted volumes in a structured way (a plist) for scripting. See the man pages for diskutil and hdiutil for more info.

Heh heh rm -r worked. Oh well duh.

Yeah, rm worked here to. Here is the command siquence I used.

cd /volumes && sudo rm -rf [name of invisible volume]

worked like a charm here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM