Skip to main content

Missing photos

What is a missing photo?​

A photo that LibrePhotos knows, but whose file is no longer where it was. LibrePhotos still has its small picture, its date, its people and its albums, so it still shows in your photos. Only the file itself is gone. This happens when:

  1. you deleted, moved or renamed the file outside LibrePhotos, for example in File Explorer or the Finder, or
  2. the drive or network folder with your photos is not there, for example a network drive that dropped.

An external drive that you unplug does not make your photos missing in the Windows and Mac programs: see My external drive is unplugged.

Why does LibrePhotos keep missing photos?​

Because the file often comes back: a drive is plugged in again, or you put the photo back where it was. Until you remove a missing photo yourself, LibrePhotos keeps everything you did with it, such as ratings, captions, the names of the people in it and its albums. When the file comes back, even under another name or in another folder of your library, LibrePhotos finds it by its content and connects it again.

When is a photo marked missing?​

Does LibrePhotos notice deleted photos by itself?​

Not released yet (comes after 1.7.0) Yes, while new photos appear by themselves. This is on in the Windows and Mac programs. A photo you delete from your photo folder is marked missing a little later. Nothing is removed from your library by itself.

  • A photo you moved to another folder of your library is found at its new place and is not missing. While a big copy is still going on, a photo can show as missing for a while, until the copy is done.
  • While a drive is unplugged, or another drive took its place, nothing on it is marked missing.
  • When most of your photos look deleted at once, nothing is marked either. That is how it looks when a drive is not there, so LibrePhotos waits.

Up to 1.7.0 only a scan marked photos missing.

Does a scan mark them?​

Yes. Every scan of your whole library checks your photos, for example Look for new photos now or Scan on the Library page. Opening, viewing or downloading a photo whose file is gone does not mark it: you just get an error for that one photo.

How do I see which photos are missing?​

The badge on the Library page​

Open Library in the menu behind the round button with your initials. If any of your photos are missing, a red badge with their number, such as 1 Missing photos, is next to the Photos heading. Without missing photos there is no badge. Point at the badge to read how LibrePhotos marks photos as missing.

The Photos heading on the Library page with a red badge, 1 Missing photos. Below it, the text that shows when you point at the badge: LibrePhotos marks a photo as missing when its file is no longer where it was, and finds a moved file at its new place. Every scan checks this. While new photos appear by themselves, LibrePhotos also checks it by itself.

Caution

Clicking the badge opens Remove missing photos, which removes those photos from LibrePhotos for good. Only point at it, unless that is what you want.

In the photo's details​

A missing photo looks like any other photo in your photos and albums. Only its details show the difference: the file name says Unknown filename, and the folder it was in is not shown.

My external drive is unplugged. Are my photos gone?​

Not released yet (comes after 1.7.0) No. In the Windows and Mac program your photos can be on an external drive, and you can keep it in the drawer. While it is unplugged, its photos are not marked missing, and Remove missing photos keeps them. This is also so for a folder you used before: when you choose another folder and keep the photos of the old one, the drive with the old folder can stay unplugged. The photos on your other drives are checked as usual.

When a scan runs without the drive, it ends with a note such as "X:\ is not connected; nothing was marked missing there", and the Folders page says that the drive is not connected. Plug it in when you want to see the photos themselves or add new ones.

Another drive has the letter of my photo drive​

For example a USB stick that you plugged in first. LibrePhotos notices this and marks nothing missing. It says, for example, "E:\Photos looks like another drive, not the one with your photos; nothing was marked missing there. Plug in the drive with your photos and scan again." It does not read the other drive either: its pictures are not added to your photos, and the note says "nothing was scanned there".

LibrePhotos knows your drive by the number that Windows or macOS gave it when it was formatted, and by its name. It remembers them when a scan finds your photos on the drive. They stay in LibrePhotos on your computer, and nothing is written to the drive. So after you update, do one scan with the drive plugged in.

Some drives have no number that LibrePhotos can read, for example a USB stick with the FAT format on macOS 15. For such a drive, and for one it has not remembered yet, LibrePhotos looks for a few of your photos on it. If it finds none of them there, it counts as another drive. So when you delete every photo on such a drive yourself, they are only marked missing after an admin sets the Missing photos limit to 100% for one scan (see For administrators). The same helps when it is your drive all the same, for example because another program changed many of your photos before LibrePhotos knew the drive.

I copied my photos to a new drive​

If the new drive has the letter of the old one, run a scan. The new drive is taken when all your photos are found on it. If some are not there, for example because the copy is older, nothing is marked missing and LibrePhotos keeps waiting for the old drive. To use the new drive without them, set the Missing photos limit to 100%, run a scan, and set the limit back. The photos that are not on the new drive are then marked missing.

The drive is gone for good​

And you want its photos gone too:

  1. Plug in your other drives with photos. The next steps also remove the photos of every drive that is not there.
  2. If your photo folder was on the lost drive, choose another folder first, in Settings under Account and photo folder. The photos of the old folder stay. For someone else's folder: Admin area > Users > Modify, and keep the photos when you are asked. Without a folder that is there, a scan does not start.
  3. In Admin area > Site settings, set the Missing photos limit to 100%.
  4. Run a scan, then remove the missing photos.
  5. Set the limit back to 50%.

How do I get missing photos back?​

Put the files back​

Move or copy the files back into your photo folder, where they were or into any other folder of your library. While new photos appear by themselves, that is all. Otherwise click Look for new photos now or Scan on the Library page.

Photos I moved to another folder​

If the new folder is inside your photo folder, LibrePhotos finds the photos there with their ratings, people and albums. If you moved them out of your photo folder, they are missing: move them back, or have the new place added to your library.

Photos I deleted by mistake​

Take them out of the Recycle Bin of Windows or the Trash of your Mac. They are found again like any file you put back. If you wanted them gone, remove the missing photos. The trash of LibrePhotos itself is something else: see Trash.

How LibrePhotos finds them again​

Every scan, and every look LibrePhotos takes by itself, compares new files with your missing photos by their content. A file with the same content connects to the missing photo, also under another name or in another folder of your library. Everything you did with the photo stays.

How do I remove missing photos for good?​

Only when you are sure the files will not come back:

  1. Open Library in the menu behind the round button with your initials.
  2. Click the red badge with the number of missing photos next to the Photos heading. It is only there when you have missing photos.
  3. Remove missing photos says how many photos it deletes. Check that number, then click Confirm.

This removes the photos from LibrePhotos for good, with their details, small pictures, faces, album places, ratings and captions. It cannot be undone. The same is in the search box (Ctrl+K) as Delete missing photos.

Caution

Is your drive only unplugged? Then its photos are not missing and stay. Photos on a network drive that dropped can look missing, though: check that it is back before you remove anything.

  • Trash: the trash of LibrePhotos.
  • Job System: long jobs such as "Delete missing photos", and how to follow them.
  • New photos by themselves: what LibrePhotos notices in your folders, and scanning on a schedule.

For administrators​

What a scan checks​

The missing-file check runs at the end of a scan when the scan is a full scan (a rescan of the whole library), or covers the user's scan directory without a list of files. It is skipped for scans of some files or a single folder, such as an upload, a rescan of some photos or a scan of files a watcher reported, unless that scan is a full scan. It is also skipped when the scan had to skip a folder it could not read. It looks at the user's own photos and marks each one whose file can no longer be found on disk.

Not released yet (comes after 1.7.0) When new photos appear by themselves, photos whose files are deleted are marked by themselves too, folder by folder, with the same checks. The missing-photo count changes after such a check, or after a scan.

Photos made of several files​

A photo made of several files counts as missing only when no file of its own is left: a sidecar (.xmp) alone does not keep it. New in 1.7.0 When the main file of a RAW+JPEG pair, or of a Live Photo, is gone but the other file is still there, that file takes its place, and the photo is not missing. This also happens when the file is deleted from your Nextcloud server, and the next missing-file check or Remove missing photos does it for a photo an earlier version marked missing. An edit is rendered again from the file that takes over; a Live Photo whose video takes over loses its edit, because videos cannot be edited. If the main file comes back, the next scan makes it the main file again, and a Live Photo shows as a photo rather than a video again. Up to 1.6.0, such a photo was removed by the second Remove missing photos, and a photo with only a sidecar left took two runs to remove.

When a scan asks "Is the library mounted?"​

New in 1.4.0 If the disk, network share or Docker bind mount that holds the photos is gone but its folder still exists, the scan directory looks empty, and every photo would be marked missing. LibrePhotos refuses to do that. The scan job fails, and nothing is changed, when:

  • the scan directory does not exist or cannot be read,
  • the scan directory is empty while the user has photos in it, or
  • the missing-file check finds that more than the Missing photos limit (in Site settings, 50% by default) of the user's photos, and more than 100 photos, would lose all their files. The job's error says how many, for example "4,812 of 5,003 photos would be marked missing. Nothing was changed. Is the library mounted?".

Mount the library again and run the scan once more. If most of the photos really were deleted on purpose, raise the Missing photos limit to the share the error names, or to 100% (which turns the check off), scan, and set it back. Not released yet (comes after 1.7.0) The error says which value is enough, for example "... set the missing photos limit in Site settings to 97% or more and scan again"; for an empty scan directory only 100% does it.

Deleting photos on purpose works as before: files deleted from a folder that is still there, even every file of a folder or of the whole library while other files (such as a notes.txt) are left, are marked missing, up to the Missing photos limit.

When a share in the library drops​

Not released yet (comes after 1.7.0)

A library may hold several disks or network shares, for example a folder of its own and a NAS share mounted below it (/data/local and /data/nas). When one of them drops, the files on it look deleted, though they are still on the share. LibrePhotos tells the two apart by the mounts: each missing-file check remembers which disks and shares are mounted in the library, and what each one is (its device and file system type, such as nfs4 or cifs). A share it remembers is left alone when it:

  • is not mounted now,
  • is mounted, but is something else: with Docker, a share that was not mounted on the host when the container started shows up as the host's own folder (often with a placeholder such as .mountpoint or @eaDir, or a few stray files, in it), on another device and file system; or the share's server exports another folder,
  • cannot be read, or reads empty while photos are in it.

A file that cannot be read because of an error other than "no such file" (for example a network share that timed out) is never marked missing either.

Nothing on such a share is marked missing, the rest of the library is checked as usual, and the job ends with a warning for each such folder, for example "/data/nas looks unmounted; nothing was marked missing there", "/data/nas is mounted from 8:1 ext4 /dev/sda1 now, not from 0:52 nfs4 nas:/photos; nothing was marked missing there" or "/data/nas: files that could not be read were not marked missing". It shows on the job's page (Account menu > My jobs), and for an admin in the Worker logs table of the Admin area. The check also notices a share that drops while it runs: it asks about the mounts again after it has looked at the files.

Remove missing photos makes the same check before each batch and keeps the photos on such a share, with a warning "... looks unmounted; nothing was removed there". It also keeps a photo whose main file, or an exact copy of it, is back on disk. Telling LibrePhotos about deleted files answers with a 409 instead.

LibrePhotos learns the disks and shares on the first missing-file check after updating to 1.8.0. Make sure every share is mounted for the first scan after the update. A share that is down then, behind a folder that does not look empty, is taken as it is, and only the Missing photos limit guards it. When a share comes back as another device (an NFS share mounted again, a USB disk plugged into another port), LibrePhotos learns it again when a scan finds more than half of the photos it already knew there on it (a share mounted inside it counts for itself). Files that appeared there since, or a few files that happen to be in an empty mount-point folder, do not count. A share that had no photos yet takes its new identity at once.

What to do:

  • Mount the share again and run the scan once more. The photos are found where they were, and nothing was lost.
  • If the warning says the share is mounted from somewhere else and it is the same share mounted again, run a normal scan with it mounted: it is recognised once more than half of the photos there are found. If most of those photos were deleted while the share was down, it cannot be recognised that way and stays held until one scan runs with the Missing photos limit at 100%.
  • If the warning says the share is mounted from somewhere else and that is really another disk now (the photos moved to another disk at the same place), set the Missing photos limit to 100%, run a scan, and set the limit back. That scan accepts the new disk.
  • If the share is gone for good and its photos should go too, set the Missing photos limit to 100%, run a scan, and set the limit back. That scan forgets the share, so its photos are marked missing, and Remove missing photos removes them afterwards.

Up to 1.7.0 the scan directory was only checked when the job started, so a share that dropped during the check, or a share mounted below the scan directory, got its photos marked missing, and Remove missing photos then deleted them.

Docker and network storage​

The drive was not mounted when LibrePhotos started​

Mount the drive on the host, then restart the LibrePhotos container, so it sees the drive and not the empty folder below it. The photos are found again; nothing was lost.

The Docker mount points changed​

When the photo paths in the container no longer match, either mount the photos at the old place again, or move the photos to match the new mount point. Restart LibrePhotos and run a scan from the Library page.

Checking the storage​

  1. Check that external drives are mounted on the host.
  2. Check the volume mounts in your Docker configuration.
  3. Check that network storage can be reached.
  4. Restart LibrePhotos after a fix.
  5. Run a scan from the Library page, so LibrePhotos checks and connects the files that are back.