distrobox icon indicating copy to clipboard operation
distrobox copied to clipboard

[Suggestion]Possibility to mount a volume from inside the container after been created.

Open marcello-pietrobon opened this issue 1 year ago • 3 comments

Hello,

from the documentation

Mount additional volumes in a distrobox distrobox create supports the use of the --volume flag, as specified in the usage HERE Simply use: distrobox create --name test --image your-chosen-image:tag --volume /your/custom/volume/path

I see that I can mount a volume only at the time of the creation of the container.

Is it possible to mount a volume after the container has been created? I couldn't find an answer to this question. If the answer is not, it would be great to have this possibility. If the answer is yes, could this be explained in the useful_tips page?

Thank you.

marcello-pietrobon avatar Oct 18 '23 10:10 marcello-pietrobon

I have maybe to specify that I'm using an image for which something strange happens:

[me@Resolve_Centos_7_root ~]$ sudo mount | grep sda
/dev/sda1 on /run/host/mnt/dskw type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

but:

[mar@Resolve_Centos_7_root ~]$ ls -l /mnt/dskw/
total 0

while with all the others containers I have they see files and dirs inside such volume, and when I do

$ sudo mount | grep sda

in them, I get exactly the same result, that is the volume is successfully mounted and in the same way.


The feature request is still valid though, if volumes cannot be mounted after the container's creation.

marcello-pietrobon avatar Oct 18 '23 10:10 marcello-pietrobon

Actually I realize now that the problem persists. even with the command:

distrobox create --root --name Resolve_Centos_7_root --image quay.io/centos/centos:7 --volume /mnt/dskw/

Unfortunately I cannot use a different version of Cent-OS, because it's the only distro supported by the software I need.

Maybe I should make a separate question for this, s.v.p. let me know.

marcello-pietrobon avatar Oct 18 '23 10:10 marcello-pietrobon

I have no idea if this could be related to the enhancement asked in #1019 as I don't understand what for /nix is really meant there.

marcello-pietrobon avatar Oct 23 '23 12:10 marcello-pietrobon

The mounts are available on host's /run/host/mnt/

89luca89 avatar Jun 20 '24 14:06 89luca89