Why are Lightroom catalogs so hard to delete from the Trash?

  • 1
  • Question
  • Updated 6 months ago
This is purely idle curiosity, but does anyone know why the trash (on MacOS) takes so long to empty after you put a Lightroom catalog in it?

I just put 3 catalogs (+ associated .lrdata "files") in the trash. While they were large, they weren't that big—perhaps 200,000 photos in them total. Emptying the trash then took about 25 minutes, on a relatively speedy iMac.

I could see progress by looking at the .Trash folder in the terminal:
$ sudo ls -R .Trashes | wc  
311507  684711 14200647
Because of formatting, I can't be sure of exactly how many files were in the trash at that time, but I estimate fewer than 200,000. It took at least 15 minutes more to delete these. Normally I can flush 100,000 files in a matter of seconds.

This all just seems "weird", and I'd love to use this as a learning moment to figure out a little more about how MacOS acts in "real life."
Photo of Alan Harper

Alan Harper

  • 440 Posts
  • 86 Reply Likes
  • idly curious

Posted 6 months ago

  • 1
Photo of Johan Elzenga

Johan Elzenga, Champion

  • 1600 Posts
  • 648 Reply Likes
The .lradata 'files' aren't really files, they are so-called 'packages'. A package is a folder, that behaves like a file in the Finder and can be double-clicked to launch an application. If you are curious: you can look inside a package by right-clicking (or Ctrl-clicking) on it and choosing 'Show package contents'. The preview.lrdata 'file' contains a huge number of small files, that's why it takes a while to delete it.
Photo of Simon Chen

Simon Chen, Principal Computer Scientist

  • 1499 Posts
  • 480 Reply Likes
.lrdata package is where Lr stores all the JPEG previews.
Photo of Alan Harper

Alan Harper

  • 440 Posts
  • 86 Reply Likes
Hi. I knew that they were packages, but it still seems very slow. It took about 1,000 or 2,000 seconds to delete 100,000 or 200,000 files, which is much slower than it normally takes to empty the trash.

I just put 8,000 copies of an .lrprev file in the trash, and it took less than 1 second to empty it.

I won't worry about it, but I do have to remember that just because the "emptying trash" dialog is showing for a while, and not showing any progress, my computer hasn't crashed.

Thanks
(Edited)