You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a Samba server running in a container that serves out files to many users in an enterprise setting. This system has been running for a bit more than a year now, so it already has a few million files in its persistent storage, owned by ~30 distinct UIDs and ~200 distinct GIDs. I am now looking to migrate this container from rootful to rootless, which means I need to perform some ownership mapping of the persistent data.
Basically, I need to perform ownership conversion using the following mapping:
# Assuming my rootless user has UID 1000 and GID 1000
0 -> 1000
10000-60000 -> 100000-150000
Although it's true that I can write a custom conversion script, I imagine I must not be the first person to have this demand. So I'd like to ask, is there an existing tool for this?
P.s.
You may have noticed that my source IDs in the mapping start at 10000 instead of 1000. This is because, very fortunately for me, I had the lucky foresight to set UID_MIN and GID_MIN to 10000 in /etc/login.defs when I initially set up the container. I did this at the very beginning of the deployment, so all persistent data have UIDs and GIDs in this range.
With the ID range pre and post mapping being completely disjointed, I think I can perform the mapping in-place without critically depending on a particular order of operation. Maybe this detail opens up a wider variety of options, IDK.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've got a Samba server running in a container that serves out files to many users in an enterprise setting. This system has been running for a bit more than a year now, so it already has a few million files in its persistent storage, owned by ~30 distinct UIDs and ~200 distinct GIDs. I am now looking to migrate this container from rootful to rootless, which means I need to perform some ownership mapping of the persistent data.
Basically, I need to perform ownership conversion using the following mapping:
Although it's true that I can write a custom conversion script, I imagine I must not be the first person to have this demand. So I'd like to ask, is there an existing tool for this?
P.s.
You may have noticed that my source IDs in the mapping start at
10000
instead of1000
. This is because, very fortunately for me, I had the lucky foresight to setUID_MIN
andGID_MIN
to10000
in/etc/login.defs
when I initially set up the container. I did this at the very beginning of the deployment, so all persistent data have UIDs and GIDs in this range.With the ID range pre and post mapping being completely disjointed, I think I can perform the mapping in-place without critically depending on a particular order of operation. Maybe this detail opens up a wider variety of options, IDK.
Beta Was this translation helpful? Give feedback.
All reactions