Question about bind mounts

mshorey

Member
Dec 24, 2021
18
0
6
43
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!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!