Share, , Google Plus, Pinterest,

Print

Posted in:

FSTAB: Mount Point With Space in Dir Name

Today i was re-organizing my desktop computer running Fedora 20. Actually i installed a new SSD drive in it and been throwing data around to organize/create new partitions and filesystems – just the way i like it! 🙂
Since i decided to put my VirtualBox machine files on a separated partition i ran into the following problem.

FSTAB: Mount Point With Space in Dir Name
FSTAB: Mount Point With Space in Dir Name

Problem – FSTAB Mount Point With Space in Dir Name:

VirtualBox “by default” saves your virtual machine files (vm configuration, disks, snapshots, …) to your home directory, where it creates a new directory called “VirtualBox VMs“. I am not sure why exactly VirtualBox creates a directory with a “space” in it’s name – this is the “Windows way of thinking” – but i did not have the time nor will to search for other possible solutions to this problem.

The solution is quite simple and straightforward. When putting the mount line to /etc/fstab we must replace the “space” in the directory with the escaped ASCII octal code of the “space” character which is “040”. Fstab swallows the new line without any problems and mounts the desired mount point to the directory with “space” in it’s name.

Solution – FSTAB Mount Point With Space in Dir Name:

Replace the “space” with “40”. So if the original name of mount point you want to add to /etc/fstab is:

/home/geekpeek/VirtualBox VMs

Replace the “space” with “40” like this:

/home/geekpeek/VirtualBox40VMs

My solution was adding the following line to /etc/fstab:

/dev/mapper/harddisk-vbox /home/geekpeek/VirtualBox40VMs ext4 defaults 1 2

This way the partition is successfully mounted via /etc/fstab!