How to mount partition with spaces in path

fstab has its own syntax. To use spaces as part of a directory name, you have to specify its code point as a zero-padded 3-digit octal number, preceded by a backslash (escape character).

In ASCII, the space character's code point is 32 or 40 in octal, so you can use:

/dev/sda4               /home/max/VirtualBox\040VMs  ext4    defaults        0 0

Note that, while code points are supported for other characters as well, the support is rather flaky. On my machine, you can write \127 instead of W, but not \070 instead of 8...


Use quote marks.

/dev/sda4 "/home/max/VirtualBox VMs" ext4 defaults 0 0

Tags:

Linux

Mount