Where your files live, and when they move
Almost every storage question — “why is my server so slow to start?”, “where did my file go?”, “can you get it back?” — has the same root: what is stored where, and when it gets copied somewhere else. This page maps that for both deployment models.
👩🎓 Participants: the five-line summary at the bottom is probably all you need. The rest explains why those five lines are true.
👩🏫 Owners / Coaches: read the model that applies to your course, then the Limits table — it is written to be quoted to a class.
The one difference that explains the rest
| Isolated deployment | Fleet deployment | |
|---|---|---|
| Your home is… | live — a network drive mounted straight from Azure | a copy — the real home lives centrally, the pod works on a copy |
| Saving a file | writes to Azure at that moment | writes to the node; reaches Azure within about 10 minutes |
| Starting a server | copies nothing | copies your whole home in first |
Nearly every fleet-specific limit on this page follows from that second column.
Which model is my course on? If your course has its own Azure subscription and its own cluster, it is isolated. If it runs on the shared multi-region platform (your own hub URL, but notebooks may be placed in another region), it is fleet. Ask ZI if you are not sure — the storage behaviour differs enough to matter. See Deployment Models.
Five kinds of storage
Colour in the diagrams below means durability, not component type.
| Kind | What it means | |
|---|---|---|
| 🟦 | Canonical | The real copy in Azure. Survives the pod, the node, and the cluster. The only thing that is ever recoverable. |
| 🟩 | Read-only source | Course materials you publish. Participants read them, never write them. Never flows back. |
| 🟪 | Streamed | Fleet only, and only for courses that ask for it. A large dataset mounted live and read-only from Azure — never copied to the node, never in anyone’s home. Read Large datasets below. |
| 🟧 | Working copy | Fleet only. Lives on the node’s disk while the server runs, synced back on a schedule. Not a backup. |
| ⬜ | Scratch | /tmp, /dev/shm, and on isolated deployments /scratch. Never copied anywhere. Gone the moment the server stops, in both models. |
Isolated deployment
One cluster for your course. The home is a live network mount, and the only scheduled copy is the daily backup.
The home and the shared materials are mounted, not copied — so a save is instantly durable, and a newly uploaded dataset shows up in a session that is already running.
What happens on which occasion
| Occasion | What moves | Result |
|---|---|---|
| Server starts | Nothing is copied | Start time does not depend on how big the home is |
| You save a file | Written straight to Azure | Durable at once |
| You upload course material | Nothing — the mount is live | Visible in running sessions right away |
| Server stops or crashes | Nothing to copy back | No data-loss window at all |
| Daily, 07:30 (Zurich time) | Both containers → backup account | Up to 24 h old; deletions are not propagated |
Recovering a deleted file. Because the backup never deletes, a file that existed at the last morning run is still in the backup account, which also keeps versions and an 8-day undelete window. Ask ZI to restore it. A file created and deleted between two morning runs was never backed up.
Fleet deployment
One central store holds every home. The notebook works on a copy, on the disk of whichever member cluster it was placed on.
Everything the participant sees is on the node. What makes it survive is the pair of copy arrows — one at start, one on a ten-minute timer — and both are proportional to how big the home is. That is why a large home makes starts slow, and why the disk of the node, not the size of the central store, is the binding limit.
One session, end to end
The only occasions on which anything is copied are the four marked here. There is no continuous write-through, so “I saved it” and “it is safe” are two different moments, up to about ten minutes apart.
What happens on which occasion
| Occasion | What moves | Result |
|---|---|---|
| Server starts | Whole home hub → node, blocking | Start time grows with home size |
| You save a file | Nothing yet — it is on the node | Safe within about 10 minutes |
| About every 10 minutes | Changes node → hub, deletions included | Durable |
| Clean stop / idle-cull | Final copy back | Nothing lost |
| Node loss, OOM kill, disk eviction | Whatever was not yet synced is gone | Up to about 10 minutes lost |
| You upload course material | Nothing until the next server start | Participants must restart to see it |
Deleting is copied too. The periodic sync makes the central store match the pod, so a file deleted in the session is deleted centrally within about ten minutes. Recovery is not a backup restore — the store keeps the previous content of every overwritten file for 30 days and lets a deleted file be undeleted for 7. If a whole home or many files went wrong at once, ZI can roll the home (or the course’s homes) back to a point in time within the last 6 days. That is a recovery window, not an archive, and it lives in the same account: it does not protect against losing the account itself.
Large datasets: streamed, not copied
Fleet only, and on request — your course has this only if ZI set it up for you.
Everything above says the fleet works on copies. That is fine for a home and for a folder of notebooks, and it falls apart the moment a course has one genuinely large file. The cost of a copy is paid per participant, per node, every single start: a 100 GB microscopy movie in a home or in the shared materials is 100 GB of a node’s ~220 GiB disk for each participant who opens it, so two people fill a node — and each of them waits out the copy before the notebook even appears.
So large datasets are not copied at all. They get their own container, which is mounted live and read-only at /srv/data, exactly like a network drive:
Shared materials — /srv/shared | Large dataset — /srv/data | |
|---|---|---|
| How it gets there | Copied to the node at start | Mounted live; nothing is copied |
| Effect on start time | Grows with its size | None |
| Node disk used | Its full size, per participant | None |
| New upload visible | At the next server start | Without a restart (allow a few minutes) |
| Good for | Notebooks, slides, small samples | One big file; a few big files |
| Writable? | No | No |
Why two folders and not one. They are two different mechanisms, not two names for the same thing.
/srv/sharedis copied, so it must stay small;/srv/datais streamed, so its size costs nothing per participant. A course can use both, and most do.
Working with a streamed dataset
- Read from it, write next to it.
/srv/datais read-only for everyone, including course owners. Write your results into your home (~/), never beside the source. - It behaves like a slow disk, not like a local file. Opening the file and seeking around in it is what it is built for — a movie reader that jumps to frame 40 000 works well. Reading the same bytes over and over does not.
- Do not copy it into your home.
cp /srv/data/movie.nd2 ~/recreates the whole problem the mount exists to avoid: it fills your node’s disk, makes every future start slow, and gets copied back to central storage on a ten-minute timer. - Extract, then work small. The usual shape is one pass over the big file that writes something orders of magnitude smaller into
~/, and everything after that runs against the extract. - Thousands of small files is the wrong shape for it. This is the exact inverse of the home: streaming is excellent for one huge file and poor for many tiny ones. If your data is 50 000 small files, tell ZI — a single archive read from
/srv/datais usually better. - Batch jobs see it too. A batch job gets the same
/srv/data, read-only, at the same path — so a notebook that reads from it in your server runs unchanged as a job. (/srv/sharedis not in a job; see What the job sees.)
/scratch: caches, venvs and models (isolated)
On an isolated deployment every server gets a /scratch folder on the local disk of the node it runs on. It exists because the home is network storage, which is slow for many small files (see Limits). Anything that is many small files, or that can be fetched again, is kept here instead of in your home.
| What | Where on /scratch | Set by |
|---|---|---|
Hugging Face models and datasets (transformers, datasets, huggingface_hub) | /scratch/huggingface (models in …/hub) | HF_HOME, HF_HUB_CACHE |
| PyTorch hub and torchvision pretrained weights | /scratch/torch | TORCH_HOME |
| Your venv kernels, unpacked | /scratch/venvs | VENV_LOCAL |
The uv package cache, Python bytecode, other caches | /scratch/uv, /scratch/pycache, /scratch/xdg | UV_CACHE_DIR, PYTHONPYCACHEPREFIX, XDG_CACHE_HOME |
How big it is. The limit depends on the profile you started:
| Profile | /scratch limit |
|---|---|
| CPU | 20 GiB |
| GPU shared | 20 GiB |
| GPU dedicated | 64 GiB |
Your venvs may use at most 16 GiB of that. The venv tool enforces this limit itself and tells you when you reach it. The model caches have no such check, so they share the rest with everything else.
Going over the limit stops your server, without a clear message. The limit is not a full disk that makes a write fail: when
/scratchgrows past it, Kubernetes evicts the server. Everything in memory is lost (running kernels, unsaved notebook changes) and so is/scratch. The hub only notices that the server stopped, so in the browser you see errors such as424or403(“XSRF”), not “disk full”. Two Hugging Face models of a few billion parameters each are enough to fill 20 GiB.
What to know about it:
dfdoes not show the limit.df -h /scratchshows the whole node disk, which is much bigger. To see how much you are using, rundu -sh /scratch/*.- It is wiped when the server stops. A model is downloaded again on the next start. Your venvs are not lost: the venv tool keeps one archive of each in your home and unpacks it again.
- Clean up while you work. Each downloaded model is one folder,
/scratch/huggingface/hub/models--<org>--<name>. Deleting the folders of models you are done with frees the space right away. - Never point a cache at your home to get more room. That makes everything slow (see above) and fills the shared home storage.
On a fleet deployment your server has no /scratch (yet); only batch jobs get one. The same libraries put their caches under ~/.cache instead, which is part of the home’s working copy. They count towards the size of your home and slow down every server start, and they are copied back to central storage about every ten minutes like everything else in the home. Delete a model from ~/.cache/huggingface when you no longer need it.
Batch job results are a one-way street
Fleet only. Results flow from the central store down into your session, and never back up. That asymmetry is deliberate.
Why the exclusion exists: the periodic writeback makes the central store match the pod, so without it a job finishing after your session started would have its results deleted again on the next periodic sync — silently, on a timer. Excluding the folder is what keeps results safe, and the price is that you cannot edit them in place.
See Batch Jobs for how to submit and track one.
Treat
~/jobs/as read-only. To work on a result, copy it out first —cp -r ~/jobs/<notebook>-<job-id>/result.ipynb ~/— and edit the copy. Anything written directly inside~/jobs/disappears at the next start.
Limits, and why they exist
| Limit | Where | Roughly | Why it exists |
|---|---|---|---|
| Home size drives start time | Fleet | seconds → minutes | The whole home is copied in before the notebook opens. A 10 GiB home is copied on every start; a 300 MiB one is not noticed. |
| Home size eats node disk | Fleet | ~220 GiB per node | Every home on a node is a full copy on that node’s disk. Reserve too much per user and few fit; reserve too little and a big home evicts the pod. Disk, not memory, becomes the binding constraint. |
| Up to 10 minutes of work at risk | Fleet | 600 s | The working copy is synced back on a timer. A clean stop loses nothing; an abrupt node loss loses what happened since the last tick. |
| New materials need a restart | Fleet | — | Shared materials are copied in at start only. Upload before class, not during it. On isolated the mount is live and they appear at once. |
| Anything large must be streamed, not copied | Fleet | from ~10 GiB | A copied dataset costs its full size per participant per node, and is copied again on every start. Past roughly 10 GiB that stops being affordable, and a streamed /srv/data container is the answer. Ask ZI — it is set up per course. |
| Streaming is fast for big files, slow for many small ones | Fleet | — | The inverse of the home. One 100 GB file read with seeks is what /srv/data is for; 50 000 small files are better shipped as a single archive. |
~/jobs/ is not writable in practice | Fleet | — | Deliberately excluded from the writeback so a running session cannot delete a batch result it never saw. |
| No per-user disk quota | Both | — | All homes share one container. One participant with a 200 GiB dataset is everyone’s problem, and the only control is a conversation. |
| Home storage is slow for many small files | Isolated | ~2.5 ms per file operation | It is network storage: cost scales with the number of files, not their size. Importing from a virtualenv in the home can take 40 s instead of 2 s. |
| Don’t build environments in the home | Both | — | A conda/venv tree is tens of thousands of tiny files — slow to mount on isolated, slow to copy on fleet. A venv with its own PyTorch and CUDA is 8–10 GB and ~100 000 files, copied again at every fleet start. Install GPU add-ons on top of the image’s torch instead, or ask ZI for a custom image. See Big frameworks. |
| Hard links do not work | Isolated | — | Azure’s NFS home mount does not support them, so some tools fail with an unhelpful error. Symlinks are fine. |
/scratch is small, and overflowing it stops the server | Isolated | 20 GiB; 64 GiB on GPU dedicated | Node disk is shared by every server on the node, so each gets a fixed share. Going past it gets the server evicted, not a “disk full” error. Model caches live here. See /scratch. |
/tmp is not storage | Both | — | Cleared when the server stops, never backed up, and it counts against the node’s disk budget. Perfect for scratch, wrong for results. |
/dev/shm is small and costs memory | Both | 4 GiB / 64 MiB | PyTorch DataLoader workers use it. Isolated raises it to 4 GiB — but capped at the pod’s memory limit, and charged against it, so a 2 GiB profile gets 2 GiB. Fleet pods currently get the 64 MiB container default. |
| Recovery window, not an archive | Both | 7–30 days | Fleet: overwrites recoverable 30 days, deletes 7, a whole home rolled back up to 6 days. Isolated: a separate backup account, up to 24 h behind, with an 8-day undelete window. Neither is a long-term archive — final work belongs in a Git repository or on a personal drive. |
Course owner & TA tasks
Publish course materials
- Upload into the course’s shared container from the UZH network — the storage account accepts nothing else.
- Isolated: appears at
/home/shared(and as~/shared) immediately, even in running sessions. - Fleet: appears at
/srv/shared— note the different path — at the participant’s next server start. - It is read-only on purpose. Anything participants must edit should be copied into their own home by them, not published as writable. For distributing notebooks that participants will modify, nbgitpuller is usually the better tool.
Publish a large dataset (fleet)
For anything too big to copy onto a node — roughly 10 GiB and up, and certainly the 50–100 GB range. It goes into its own container, data-<course>, and reaches participants streamed at /srv/data.
- Ask ZI first. The container exists for every fleet course, but the mount is wired up per course; it does not appear until that is done.
- Upload from the UZH network, like the shared materials — the storage account accepts nothing else. For files this size use
azcopyor Azure Storage Explorer rather than the portal’s browser upload, and expect the upload itself to take a while. - No restart needed. Unlike shared materials, a newly uploaded dataset reaches sessions that are already running — there is nothing to copy in. Allow a few minutes before it shows up, though: the mount caches directory listings, so a new file is not necessarily visible the second it finishes uploading. Upload before class if you can.
- Nobody can write to it, including you. That is deliberate: one copy is shared by every participant, so an accidental edit would hit the whole class at once. Re-upload to change it.
- Prefer few large files. One
.nd2/.zarr/.tarreads far better than thousands of small files. If your data is naturally many small files, pack it. - Tell participants where to write. The single most common mistake is
cp /srv/data/… ~/— it undoes the whole point and slows every one of that participant’s future starts.
Plan for large models (GPU courses)
By default a model downloaded with from_pretrained(...) or torch.hub.load(...) is cached on /scratch (isolated) or in the home (fleet). On isolated that is 20 GiB on the CPU and GPU-shared profiles and 64 GiB on GPU dedicated. If it overflows, the server is evicted. So before the course starts:
- Add up what one participant downloads in one session: the model weights, plus any dataset loaded through
datasets. Also count models from earlier exercises that are still cached. More than about 10 GB does not belong on a 20 GiB/scratch(CPU and GPU shared): venvs and other caches need the rest. Use one of the options below. - Use GPU dedicated for big models. Its 64 GiB is there for work with several large models. GPU shared stays at 20 GiB because four participants share one node’s disk. This applies to the interactive server only: a batch job gets its own 20 GiB
/scratch, even when started from a GPU dedicated session. A notebook that runs with a 30 GB model in the session is evicted when it runs as a job. - Publish a pre-downloaded copy instead of a download. Put the model folder into the shared materials (
/home/sharedon isolated,/srv/sharedon fleet) and have the notebooks load it by path, e.g.AutoModel.from_pretrained("/home/shared/models/<name>"). Loading by path reads the files in place and puts nothing on/scratch. On fleet, anything this large belongs in a streamed dataset instead, because the shared materials are copied to the node at every start. -
Point the cache somewhere else only on purpose. The libraries read
HF_HOME,HF_HUB_CACHEandTORCH_HOMEwhen they are imported, so a notebook can override them in its first cell, before anyimport transformers/import torch:%env HF_HOME=<path> %env HF_HUB_CACHE=<path>/hub %env TORCH_HOME=<path>/torchSet
HF_HUB_CACHEtoo, not onlyHF_HOME. On isolated deploymentsHF_HUB_CACHEis set explicitly to/scratch/huggingface/hub, and the Hugging Face libraries use it before they look atHF_HOME. If you change onlyHF_HOME, models are still downloaded to/scratchand the server can still be evicted.Never point them at the home: model files there are slow on isolated, fill the storage every participant shares, and on fleet slow down every server start. To change the default for the whole course, for example to a pre-filled cache, ask ZI. It is a deployment setting, not something a notebook should do, and ZI changes
HF_HUB_CACHEalong withHF_HOME. That setting reaches your servers, not batch jobs: a job keeps its own cache paths on its/scratch. Setting the variables in the notebook’s first cell works in a job too.
Get a lost file back
- Ask ZI with the username, the file path, and roughly when it was lost — all the windows are short.
- Fleet: an overwritten file is recoverable for 30 days, a deleted one for 7. A whole home can be rolled back to a point in time within the last 6 days.
- Isolated: restored from the backup account, but only up to the last morning run (07:30).
- Nothing recovers work that a crashed fleet session never synced. That is the ten-minute window.
See who is using the space
- Homes sit one folder per user in the course’s homes container; ZI or an owner with access can size them in the Azure portal.
- Do this before a fleet course starts: there, one oversized home slows that user’s every start and squeezes the node everyone else shares.
- Ask participants to run
du -sh ~/and clear out old datasets.
Five lines for participants
| Path | What it is | Kept? |
|---|---|---|
/home/jovyan | Your files. Everything you want to keep goes here. | ✅ Yes |
/home/shared or /srv/shared | Course materials from your teachers. Read-only. | 📖 Read-only |
~/jobs/ | Batch job results (fleet). Copy them out before editing. | 📖 Read-only in practice |
/tmp | Scratch space. Fast, roomy, wiped every time the server stops. | ❌ No |
/dev/shm | Shared memory for things like PyTorch data loaders. | ❌ No |
/scratch | Isolated only: downloaded models, venvs, caches. Has a limit; going over it stops your server. | ❌ No |
Some fleet courses have a sixth: /srv/data, a large dataset streamed live rather than copied. Read from it, write your results into ~/, and never cp it into your home.
And the one habit worth teaching: stop your server from the menu rather than closing the tab. On fleet that triggers the final copy back; on both models it stops the clock on your quota.
Figures on this page reflect current defaults: fleet sync every 600 s, version retention 30 days, soft-delete 7 days, point-in-time restore 6 days; isolated backup daily at 07:30 Zurich time with an 8-day undelete window. Several are per-deployment settings — check with ZI before quoting an exact number to a class.