Storage locations

Choose where file contents are kept. Different spaces can use different locations.

On this page
  1. Types
  2. Where the files are
  3. Adding a location
  4. Moving a space to another location
  5. Copying everything to another location
  6. Replicas: the same files on several locations
  7. Folder spaces: a folder on the server as a space
  8. Checking what a location holds
  9. Storage usage and performance
  10. When a location is offline

Types

TypeUse it for
Local folderThe storage folder, or any other folder mounted into the container, such as a NAS
S3-compatibleAWS S3, Cloudflare R2, Backblaze B2, Wasabi, RustFS and others
SFTPA server you reach with a password or a private key (Ed25519 keys are recommended over RSA)
FTP / FTPSOlder file servers

Where the files are

On the storage folder and on every Local folder location, each space is an ordinary folder, and its files are ordinary files with their own names. You can open /storage (the storage folder next to compose.yaml) and find everything there:

/storage/company/…              the company space "All files"
/storage/teams/<space name>/…   team spaces
/storage/users/<user name>/…    each user's "My files"

A space gets its folder when it is created, in the folder of the storage location it is created on, usually the default one (or /nas/teams/…, say, when it is created on a NAS added as a Local folder location). These are folder spaces: files copied into them by other programs, over SMB or by a scanner, show up in ThirtyFile, and changes made on the web are made in the folder.

Adding a location

  1. Open Control panel › Storage locations and click Add storage location.
  2. Choose the type and fill in the address and the login details.
  3. Click Test connection. It writes, reads back and deletes a small file. The location can be saved once the test succeeds. Keys or accounts that may write but not delete files fail it: ThirtyFile could never remove deleted files there. For a Local folder, saving creates the folder when it isn't there yet (see Disks and shares that aren't mounted). For S3, SFTP and FTP, saving puts a small .thirtyfile-location file there (see One place, one location).
  4. Make it the default if new spaces should be created on it.

When you edit a location later, the saved password or key is kept as long as the server, account, bucket, SFTP host key and certificate check stay the same. Change one of them, or reset the host key, and enter the password or key again.

The default only decides where new spaces go: users' "My files", team spaces and, on a new server, "All files". When creating a team space you can choose another location, and new users' "My files" can have a location of their own (see Personal spaces). Each space stays on the location it was created on, so changing the default doesn't move any existing space, and their new files keep going where their older ones are. Only moving a space changes its location.

What the list shows

A location can't be deleted while a space is on it, while a space is being moved to or from it, or while its content store still keeps files. A folder space an administrator made from a folder of their choice (below) isn't on any location.

Provider notes

Connections without encryption (plain FTP, or S3 over http) are only accepted for addresses inside your own network.

Moving a space to another location

Under Control panel › Spaces, select a space and choose Move to another location…. Any space can go to any other location: between content stores, from a folder into a content store, and into a folder. The dialog shows where the space is now and how big it is, and lists the other locations, with the free space of those on this server's disks. When the chosen location doesn't have enough room for the space, the dialog says so and the move can't start. A move that is resumed needs room only for what it hasn't copied yet, and a folder moved to its new place on the same disk needs none.

The move runs in the background, in three steps (here for a space in the content store; folder spaces and moves into a folder work alike, with the differences below):

  1. Copy. Every file of the space, its earlier versions and the items in its trash are copied to the new location, and each copy is checked against the file's SHA-256 fingerprint. The space stays in use meanwhile: files uploaded or changed during the move are copied too.
  2. Switch. Once everything is there, the space switches to the new location in one step. Its new files go there from then on.
  3. Clean up. The old copies are deleted a minute later, so downloads that are reading them can finish.

Until the switch, the space is where it was: a move that stops or is cancelled changes nothing for the people using it. A file whose content is the same as another file's is kept only once in the whole system, so content a space shares with spaces elsewhere moves with it, and those spaces read it from the new location too.

Moving a folder space into S3, SFTP or FTP

A folder space (a space on the storage folder or a Local folder location, or a folder you chose) can be moved into the content store of an S3, SFTP or FTP location. Its files become content-store files there, with the same names, folders, share links, permissions, trash and earlier versions.

Moving a space into a folder

A space moved to the storage folder or a Local folder location (a NAS, say) becomes a folder space there: it gets a folder of its own, named as a new space's would be (company, teams/<name> or users/<user name>, with a number when that is taken), and is read-only while its files are copied.

Cancelling a move into a folder removes the folder it made, with what was copied into it.

Several spaces, or everything on a location

The free space of the location they go to is checked for all of them together, when it is a disk of this server.

Following moves

Control panel › Moves lists the moves that aren't finished, then the earlier ones. For each: the space (a user's "My files" is named after the user), where it moves from and to, how many files and bytes are copied, the speed and the time left, and its state. The page refreshes by itself while a move runs.

A space being moved can't be deleted, and neither can the user whose "My files" it is, until the move is finished or cancelled.

Copying everything to another location

Copy everything to…, in the … menu of a location under Control panel › Storage locations, copies all the spaces on that location to another location, and leaves the source as it is: no file is removed, the spaces stay where they are, and the default location doesn't change. Use it for an extra copy on a NAS, an off-site bucket or a disk you take away. For snapshots made again and again, and kept for a time, see Backups of files to another location; they are kept the same way, and restored the same way.

What is copied

Where the copy goes

Each copy gets a folder of its own on the other location, .thirtyfile-backups/<id>, which nothing else in ThirtyFile writes to. Nothing already there is replaced, and copies never mix. In it:

So the files can also be found without ThirtyFile: each line of the manifest names a file's path and the object holding its content.

The other location may be on the same disk or storage service as the source; the dialog then says that the copy doesn't survive a failure of it. Locations in the same place, or one inside the other, are refused. For FTP without encryption, the dialog says that the files travel unencrypted. On a disk of this server, the copy is refused when there isn't enough free space for it; for S3, SFTP and FTP, room left can't be told.

Files that change during the copy

The spaces stay usable while they are copied. The copy shows them as they were when their list of files was made (As of): files changed or deleted after that are copied as they were, since their content is kept from deletion until it is copied. Files of folder spaces are read one at a time and checked not to have changed while they were read; one that changed is read again. The folder is checked for changes made by other programs first. Each file of a folder space is whole and as the index had it, but files other programs changed at different times aren't one instant together.

Following, pausing and errors

Control panel › Backups lists the copies, what each is doing, and how far it got. Copies run in the background, one job at a time, and go on when the page is closed.

A location holding a copy can't be deleted, nor its folder changed, until the copy is deleted. Removing unused content and deleting files for good never look in .thirtyfile-backups, so they never remove a copy, and Browse doesn't open it (its manifests name the files of personal spaces). The activity log records when copies are made, restored from, checked and deleted.

Restoring from a copy

Select a copy and choose Restore…, then the space to restore. It goes into a new folder, Restored <space> <date>, at the top of the space itself, or of another company or team space you choose; nothing already there is replaced. Content the space's location still holds isn't copied again.

Replicas: the same files on several locations

A replica policy keeps the files of the spaces on one location on other locations too, checks them there, and reads them from there when the location fails. When the location is lost for good, one of the others can be promoted: the spaces then read and write there. Only administrators see and manage replicas, under Control panel › Replicas.

Replicas aren't backups. A replica holds the files as they are now: a file deleted or overwritten is deleted or overwritten on the replicas too, shortly after. To bring back what was deleted or changed by mistake, keep a backup as well. Replicas keep files readable when a disk, NAS or bucket fails; backups keep earlier states.

Making replicas

Choose New replicas… (or Replicate… in the … menu of a storage location), then:

Each content is copied once per location, also when several files or spaces share it. Files, earlier versions and the trash are copied. On the other location the copies are kept where it keeps content (ab/cd/<sha256>), whatever kind of space they come from.

Folder spaces

Folder spaces (every space on the storage folder and on Local folder locations) are replicated too. Their files are read from the folder and checked while they are read: a file that changes meanwhile is read again. A file another program keeps writing (a log, a mailbox) doesn't make the sync fail: it is copied as it was last read whole, and the sync's details list it as changed while copied (a file never read whole has no copy yet and is listed the same way; files of personal spaces are listed without their names). The next sync reads it again. Changes made on the web are copied a few seconds later. Changes other programs make in the folder (over SMB, a scanner) are copied once ThirtyFile has seen them: about 12 seconds later on a disk of the server, and at the next regular check for changes on NFS or SMB mounts (every 15 minutes unless set otherwise). Each sync checks the folder for changes first.

How copies are kept

When the primary fails

When the content of a file can't be read from the primary (the location is offline, the content is missing there, or a folder space's folder isn't there), it is read from a checked copy on another location instead, if the policy allows reading from copies. The copy is the same content, named by its SHA-256, so it is never an older version of the file than ThirtyFile knows. For a folder space, that is the file as the index last had it: a change another program made in the last seconds before the disk failed, which ThirtyFile hadn't seen, isn't in the copy. Each time is noted in the server log, and in the activity log at most every 10 minutes per location (Read from a replica).

Only reading falls back. While the primary is offline, uploads and changes to its spaces wait, as described under When a location is offline: a change is never written only to a replica.

Promoting a location

When the primary is lost for good, or is being retired, choose Promote… and the location to promote. Promotion is never done by itself. Before anything happens, the dialog says whether both locations can be reached, how far the chosen one is behind, how many contents move and which spaces, and how many contents aren't there.

After a promotion, check the policy's list of locations: the promoted one is no longer in it, so add another location if you want as many copies as before.

Removing a location or a policy

Removing a location from the list, keeping fewer copies, or deleting a policy stops new copies, but the copies already made stay, and are kept from deletion. Control panel › Replicas then shows how many copies on each location no policy wants, with Remove them…. Each is checked again right before it is deleted: a copy a policy still wants, content that is the original there, and copies of the files of a folder space whose location can't be reached now stay. A location that holds replicas, or that a policy copies from or to, can't be deleted until then.

Folder spaces: a folder on the server as a space

Every space on the storage folder or a Local folder location is a folder space (see Where the files are). You can also show an existing folder on the server, such as a NAS share, as a space. Its files stay where they are, as ordinary files, and can also be changed there, for example over SMB or by a scanner.

  1. Mount the folder into the container, for example -v /srv/shared:/mnt/shared.
  2. Under Control panel › Spaces, click New folder space and enter the path inside the container, /mnt/shared.
  3. Add members as for any team space.

ThirtyFile finds changes made in the folder when someone opens it (not again within a few seconds, not while a change to the space is being made, such as copying a large folder into it, and not in watched spaces, see below: the list then shows what ThirtyFile knows), and checks every folder space every 15 minutes (change this under Control panel › General), or right away with Check for changes (a check of a large folder shows its progress in the list and in a message at the bottom, and goes on if you leave the page). Files and folders moved or renamed in the folder keep their share links and permissions. Files and folders a check finds have no uploader (the Uploaded by column and Created by in the details pane show —) and aren't in anyone's Recent, unless they open or edit them; items found by earlier versions of ThirtyFile keep the space's owner as their uploader. ThirtyFile tells a moved item from a new one by when the disk says it was created. Where the disk doesn't record that (some network shares), a moved file is still recognised by its size and date, but a moved folder counts as removed and added again, and loses its share links and permissions.

On a supported local Linux file system, changes show up by themselves about 12 seconds after they are made: ThirtyFile watches the folders for changes. Those spaces get the regular check only a quarter as often (every hour with the usual 15 minutes), for what watching can miss. NFS, SMB, 9P and FUSE/virtiofs mounts, including host folders shared by Docker Desktop, may not report external changes. Unrecognized file systems also use the safer fallback: opening a folder checks it again (at most once every five seconds), and scheduled checks keep their normal interval. No probe file is written to infer that host events work. With very many folders, Linux's limit on watched folders (fs.inotify.max_user_watches, often 8,192 or more) can be reached; the log then says so, and refresh-on-open and regular checks find the rest. Raise it on the host with sysctl fs.inotify.max_user_watches=524288. Every folder counts, in all spaces together (every user has a space of their own).

Docker Desktop on Windows and macOS. Changes made in the host's shared folder are found when its folder is opened or refreshed in ThirtyFile, and by the regular check; they need not appear instantly. A file still being written appears once it settles. Renames or deletions can start a background check to distinguish a move elsewhere in the space from a deletion. Control panel › Spaces shows whether changes appear within seconds or are checked when opened, with the actual scheduled interval. Setting the interval to zero turns off scheduled checks, but opening a folder still checks it when watching is unavailable. Check for changes remains available for a full check at any time.

While a large folder space is being checked, Control panel › Spaces shows how far it got, and the log says how long reading the folder and updating the index took when it took more than 10 seconds. As a guide, on an SSD the first check of a folder with 200,000 files takes about half a second to read and 25 seconds to index; checking it again when nothing changed takes a second or two. Network mounts are slower to read, since every file's size and date are asked for over the network: keep the regular check at 15 minutes or more for large NFS or SMB folders.

Everything done on the web changes the folder itself: uploading, creating folders, renaming, moving, copying, editing and deleting. Moving to a space on another disk, or to a space that isn't a folder space, copies the files, checks them, then removes the originals; a file changed in the folder meanwhile stays there, and the next check for changes shows it. A message at the bottom of the page shows how far a long move or copy got; it goes on on the server even if the page is closed.

Checking what a location holds

The … menu of each location under Control panel › Storage locations has three more actions. Only administrators have them.

Test step by step

Runs every step files go through and lists each one with how long it took:

  1. Connect to the location.
  2. Write a small file, then read it back and compare.
  3. Upload a larger file (24 MB) the way uploads are stored, which on S3 is an upload in parts, then download it and compare. Both show their speed in MB/s.
  4. Delete the test files and check that they are gone.

The test files go in a .thirtyfile-check folder and are deleted afterwards, also when a step fails. The test takes at most two minutes: on a slow connection the larger file is skipped rather than left half done. A failed step says why, for example that the keys can't delete files.

Browse

Shows what the location holds, one folder at a time and 200 items per page, with sizes and dates. Nothing can be changed here. Single files can be downloaded as they are stored, except content waiting to be deleted and copies still being written.

Find unused content

Looks through the content store of the location for content that no file, earlier version or item in the trash uses, for example content left behind when a server stopped halfway through an upload. It runs in the background and lists what it found, with the total size. Content written in the last 24 hours is left alone, since uploads store their content before recording it, and so is content already waiting to be deleted.

Remove N items deletes exactly the content on the list, after you confirm. Each item is checked again right before it is deleted: one that was used or written again in the meantime is kept. The removal is recorded in the activity log.

On S3, SFTP and FTP, searching and removing are refused when the place's .thirtyfile-location file names another location or another ThirtyFile installation: that content isn't unused, it belongs to them.

One place, one location

Two locations in the same place would each take the other's files for unused content. So a location can't be added, or changed, to a place another location already uses: the same bucket and prefix on the same service, or the same folder on the same SFTP or FTP server (a relative folder counts per account).

The place of an S3, SFTP or FTP location also holds a small .thirtyfile-location file: the location's id on the first line, the ThirtyFile installation's id on the second. It is written when the location is added. A location added before these files existed gets its file at its next successful connection check. A place whose file names another location, or another installation of ThirtyFile, can't be added, and its content isn't searched or removed. Deleting a location removes its file.

Storage usage and performance

Control panel › Storage usage shows how much is stored, how that changes over time, and how storage operations go. Only administrators see it. At the top are the totals by kind of space, the trash and earlier versions. Below them, each location has a card, and so does the data folder.

What the figures mean

FigureWhat it counts
FilesThe files of the spaces on the location as people see them, not counting the trash. This is what quotas count. Two files with the same content count twice. The trash and earlier versions are shown under it.
Stored by ThirtyFileWhat ThirtyFile actually keeps there: the content store, where identical content is kept once, plus the files of folder spaces (with their trash) and the earlier versions kept in their folders. It can be smaller than Files because of that sharing, and larger because of the trash and versions.
DiskThe whole disk, as the system reports it, whatever else is on it. For the storage folder and Local folder locations only. Two locations on the same disk say so, and the disk is counted once.
Capacity unknownS3, SFTP and FTP don't report how much room is left, and a disk that doesn't answer within 3 seconds isn't measured. No percentage or time to full is shown then: unknown is not zero.
BackupsThe copies and backups kept on the location: each content once per copy or backup. Only locations holding some show it.
ReplicasThe replicas kept on the location of content whose original is on another location. Only locations holding some show it.
Waiting to be deletedContents whose deletion failed (a location that was offline, say) or old copies after a move, which are retried in the background. Their size isn't known any more.
Data folderThe database, thumbnails and uploads in progress, and the disk they are on. It also lists moves, running tasks and deletions that are waiting.

Files changed in a folder space by other programs are counted after the next check for changes.

Operations

Every read, write, delete, listing and connection check on a location is timed and counted, and so are the files of folder spaces that are read or uploaded. Renaming, deleting and scanning inside folder spaces aren't measured. The counting happens in memory and is written once every five minutes, so it doesn't slow down file operations. Up to five minutes of counts are lost when the server stops.

History

Choose a location (or all of them), a range and a kind of work. Every chart states its unit and the period each point stands for. Pointing at a chart, or moving along it with the arrow keys, shows the values of one period. Show as a table lists them all. Download CSV saves what is shown.

RangeEach point isKept for
Last 6 hours, last 2 days5 minutes (operations), 15 minutes (capacity)2 days
Last 30 daysan hour45 days
Last yeara day, counted in UTC400 days

Capacity is measured every 15 minutes and shortly after the start. The last measurement of an hour or a day stands for it. Operations are added up per hour and day, so the history stays small. Times are shown in your browser's time zone. A card whose latest measurement is more than 30 minutes old is marked Out of date.

Time to full draws a straight line through the disk's use over the last 30 days. It is only shown for a disk whose size is known, with at least 3 days of measurements, while the disk is filling up at a steady pace. Otherwise the page says why it isn't shown.

Alerts

Under Alert thresholds, choose when the page raises an alert: when a disk is fuller than a percentage (90% at first), or when more than a percentage of a location's operations failed or timed out in the last hour (5% at first). The failure alert needs at least 20 operations in that hour. Enter 0 to turn one off. Offline locations and measurements that are out of date raise an alert too. Alerts are shown at the top of the page, and they aren't sent by email.

When a location is offline

Browsing, searching and organising folders keep working. Opening, downloading and uploading are paused, and resume by themselves when the location is back. Files with a checked replica can still be opened and downloaded. The space is marked as offline in the meantime. In a folder space, whose folders are on the disk, organising folders is paused too.

Disks and shares that aren't mounted

A Local folder location is often a disk or a network share mounted on the server, such as /mnt/nas/thirtyfile. When it isn't mounted, its folder is missing or is an empty folder on the server's own disk. ThirtyFile never writes there: files would land on the wrong disk and be hidden once the share is mounted again.

The storage folder (/storage in Docker, set with THIRTYFILE_STORAGE) gets the same file, holding local, at the first start of a new server: when the folder is new or empty. Items a disk or NAS makes by itself (lost+found, #recycle, @eaDir, .DS_Store, System Volume Information, $RECYCLE.BIN) don't count. Once files or spaces are on it, a missing or empty storage folder is never taken again: ThirtyFile doesn't start and says the volume may not be mounted. If the storage folder has files in it but no .thirtyfile-location, or one of another location, ThirtyFile doesn't start either: it may be a different disk than the one it used. Check the volume or mount. When it really is the right folder, create the file with the word local in it.