Every now and then I’ll be connected to a server on my Mac with a very specific volume mounted, but then it doesn’t appear anywhere in Finder. When I try to reconnect to it, it’s grayed out, as if I was connected after all.
For a while, the only way I knew how to fix it was to restart, but that’s obviously most inconvenient.
Turns out, there is quite a simple solution, and that is to unmount the volume via the command line.
Open up Terminal and type in the following:
sudo umount -f "/Volumes/NameOfVolume
Replacing “NameOfVolume” with your volume’s name. After you hit ENTER, type in your Mac’s password when prompted.
Once that’s done, reconnect to the server in Finder (COMMAND + K), select the volume that was previously grayed out, mount it, and now it’ll be in Finder again for you to browse.
I use VirtualBox on my Mac to have other operating systems at my disposal. One of my appliances contains a copy of Windows 7 with a fixed, 25GB disk. I’ve run out space and was looking for an easy way to increase it.
I came across the
modifyhd command, which in theory let’s you increase the disk space, but it only works on dynamic disks. I opted for performance (fixed disk) when I set up the appliance, and this minor inconvenience is the price.
There are several tutorials out there, but many of them require third-party applications, either on the Mac or in Windows side. The thing is, even without those utilities, it’s fairly easy to increase your disk space.
What we’ll do is create a bigger disk, clone the contents from the small disk to the big disk, and then increase our Windows partition.
This is mainly for my own reference, but here it goes.
1. Share a folder on the host OS
- In VirtualBox, click your OS on the left and click on Settings.
- Click on the Shared Folders tab.
- Click on the folder with the plus on the right.
- Browse to a folder of your choice in the folder path.
- Enter a folder name with no spaces e.g. “Share”.
- Check Auto-mount and Make Permanent, if available.
- Click on OK.
2. Mount the folder in the guest OS
- Create a folder in your guest OS that you want to share.
- Open up Terminal.
- Type in
id and press ENTER— remember that ID.
- Switch to the
root user using
sudo su and enter your password.
- Browse to the
etc folder using
- Edit the
rc.local file using
- Move your cursor right above
exit 0 and press the letter “i” on your keyboard to insert text.
- Type in the following:
sudo mount -t vboxsf -o uid=1000,gid=1000 Share /home/username/Documents/Share
- 1000 should match the ID you noted down earlier.
- Share should match the folder name from step 1.
- username should match your Linux username.
- /Documents/Share should be the absolute path of the new folder you created.
- Now hit “ESC”, type
:wq and hit ENTER to save and quit the file editing.
After you restart the guest OS, your shared folder will be automatically mounted.