Question about bind mounts

mshorey

Member
Dec 24, 2021
18
2
8
44
I apologize ahead of time if this has already been covered somewhere else that I can't find but. I'm attempting to bind mount some NFS shares from my host to a container. The NFS share has spaces in the directory name as will the bind mount point. I've tried using single quotes, double quotes and even 040 in the lxc config to represent the spaces as I do in the NFS mount in /etc/fstab on the host...no dice. I understand spaces in folder names is not ideal but hoping I can get this working without renaming in a ton of locations.

mp7:/mnt/"CHRISTMAS MOVIES",mp=/mnt/"CHRISTMAS MOVIES"
or
mp7:/mnt/'CHRISTMAS MOVIES',mp=/mnt/'CHRISTMAS MOVIES'
or
mp7:/mnt/CHRISTMAS\040MOVIES,mp=/mnt/CHRISTMAS\040MOVIES

Any help would be greatly appreciated. Thank you.
 
Last edited:
Hi,
I think you don't need to use any quoting or escaping at all. For me, the following worked (of course I need quotes for passing along the command argument correctly in the shell):
Code:
pct set 113 -mp2 "/s p a c e y/,mp=/other space"
ends up as
Code:
mp2: /s p a c e y/,mp=/other space
in the configuration file (and bind-mounts correctly).
 
  • Like
Reactions: mshorey
Hi,
I think you don't need to use any quoting or escaping at all. For me, the following worked (of course I need quotes for passing along the command argument correctly in the shell):
Code:
pct set 113 -mp2 "/s p a c e y/,mp=/other space"
ends up as
Code:
mp2: /s p a c e y/,mp=/other space
in the configuration file (and bind-mounts correctly).
Wow. Leave it to me to overcomplicate things. Lol. Thank you so much for your help. This worked perfectly!