Community discussions

MikroTik App
 
RyperX
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Thu May 21, 2015 11:14 am

Container - Any way to edit files in Mount?

Sun Aug 18, 2024 1:21 pm

Hey,

i looked for this when container was released and also found some topics
viewtopic.php?t=201961
viewtopic.php?t=189481

Is there still no way to edit a file in a container mount or access these files?
As long the container itself has a backup feature it is fine. In the moment i need to edit files in the container BEFORE i can start the container, it will be a mess.

I really love the idea to run some containers directly on the mikrotik, but not able to edit files or BACKUP files while the container is crashing/not running is a mess.
 
optio
Forum Guru
Forum Guru
Posts: 1066
Joined: Mon Dec 26, 2022 2:57 pm

Re: Container - Any way to edit files in Mount?  [SOLVED]

Sun Aug 18, 2024 2:19 pm

There is a way, my post viewtopic.php?t=201961#p1039274 is obsolete (depends on used ROS version) since from some recent ROS version (not sure which) mounted non-"container store" directories are r/w from ROS and container, for eg. you can download file from mounted dir using Winbox, edit it and upload/overwrite again with Winbox.
To get content of mounted directory visible (listed in ROS files), directory must not be with type "container store" (directory that contains .type file in its root), either mount existing directory before running container because when container is started mount directory is created by default with "container store" type if not exists; or delete .type file in mounted directory from container shell when container is started.
Note: files/dirs with . name prefix are not listed by ROS, they can be only manipulated from external system (file share from ROS by some available protocol, direct mount,...) or from container.
 
RyperX
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Thu May 21, 2015 11:14 am

Re: Container - Any way to edit files in Mount?

Sun Aug 18, 2024 8:53 pm

Thanks for the update!
I tested it now with SMB and it did work. (except SMB is killing the router with wrong settings :lol: viewtopic.php?p=1092083#p1092083)
 
optio
Forum Guru
Forum Guru
Posts: 1066
Joined: Mon Dec 26, 2022 2:57 pm

Re: Container - Any way to edit files in Mount?

Sun Aug 18, 2024 9:03 pm

You can use SFTP, enable SSH on router and over SFTP client you can access mounts, "container store" dirs are also accesibile in r/w (container root dir too).
It is possible then over SFTP to directly edit files over client (FileZilla for eg. have such feature), manage POSIX files/dirs permissions without need to set them over container shell, etc...
 
RyperX
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Thu May 21, 2015 11:14 am

Re: Container - Any way to edit files in Mount?

Sun Aug 18, 2024 9:28 pm

Thanks, this was strange.
I couldnt access SFTP in the first place, after router reboot this was possible.

Much more convenient then SMB.