<p>I am trying to save data from <strong>jupyter</strong> lab to AWS S3 in Kubenretes.</p>
<p>Once jupyter lab comes up I can see data from S3 bucket &quot;testml1&quot; perfect.</p>
<p>However if I open a <strong>terminal</strong> in jupyter notebook and create some
<strong>file</strong> this is NOT visible:</p>
<ol>
<li>visible in left sidebar at jupyter</li>
<li>nor in S3</li>
</ol>
<pre><code>    extraConfig: |-
      c.ServerProxy.host_whitelist = [&quot;localhost&quot;, &quot;127.0.0.1&quot;, &quot;rapidsai-scheduler&quot;]
      from s3contents import S3ContentsManager
      
      from hybridcontents import HybridContentsManager
      from notebook.services.contents.largefilemanager import LargeFileManager
      c = get_config()
    
      c.NotebookApp.contents_manager_class = HybridContentsManager
      
      c.HybridContentsManager.manager_classes = {
          # Associate the root directory with an S3ContentsManager.
          # This manager will receive all requests that don&quot;t fall under any of the
          # other managers.
          &quot;&quot;: S3ContentsManager,
          # Associate /directory with a LargeFileManager.
      }
      
      c.HybridContentsManager.manager_kwargs = {
          # Args for root S3ContentsManager.
          &quot;&quot;: {
              &quot;access_key_id&quot;: &quot;...&quot;,
              &quot;secret_access_key&quot;: &quot;...&quot;,
              &quot;bucket&quot;: &quot;testml1&quot;,
              # &quot;root_dir&quot;: &quot;/home/jovyan&quot;,
          },
      } 
</code></pre>
<p>it almost feels like terminal and the storage it is using, is totally separated from the one which is used by <strong>HybridContentsManager</strong>. and <strong>S3ContentsManager</strong></p>

user2156115
<p>Try associating the mapped S3 bucket to the Notebook working directory by uncommenting the <code># &quot;root_dir&quot;: &quot;/home/jovyan&quot;,</code> line. That should make all your contents being mapped to S3, where new notebooks or files created in that context to be added to your bucket.</p>
<p>If you need multiple directories (e.g. S3 buckets, etc) you could use additional storage volumes that are supported by JupyterHub and documented in the <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/customizing/user-storage.html" rel="nofollow noreferrer">Z2JH readthedocs</a>.</p>
