Using plocate to Find Files in an Inaccessible Filesystem

Abstract: Resolve Input/output errors when searching inaccessible Linux filesystems by querying the pre-built plocate database instead of traversing the live directory structure.

Created: 2026-07-30 by

Use the plocate command to search for files within a mounted but inaccessible filesystem by leveraging its database-driven approach, which bypasses real-time directory traversal. Since plocate queries a pre-built index rather than scanning the live file tree, it can retrieve results even when the underlying filesystem is read-only, corrupted, or otherwise blocked from standard access methods.

Understanding Why Standard Search Fails

When a Linux filesystem becomes inaccessible, common commands like find, ls, or grep often fail with errors such as "Input/output error" or "Permission denied." This happens because these tools attempt to traverse the directory structure in real-time. They require direct, read-access permissions to open directories and list their contents. If the filesystem is mounted in a state where metadata cannot be read—perhaps due to corruption, a locked volume, or specific mount flags—these traditional tools hit a hard wall immediately. In contrast, plocate operates differently. It does not scan the disk at runtime. Instead, it queries a static database file (typically located at /var/lib/plocate/plocate.db) that was created during the last update of the locate database. This database contains a snapshot of all file paths indexed on the system. Because plocate reads only this database file, it does not need to interact with the potentially problematic filesystem directly during the search operation. As long as the database exists and includes entries for the inaccessible partition, plocate can return results without ever touching the broken mount point.

Prerequisites and Database Status

Before attempting to use plocate for this workaround, you must ensure that the locate database has been populated while the filesystem was still accessible. If the filesystem was never mounted or if the database has not been updated since the issue arose, plocate will have no data to query regarding those specific files. You can check the age of the database using the locate command with the -d flag or by checking the modification time of /var/lib/plocate/plocate.db. If the database is outdated, you may need to run sudo plocate -u to rebuild it, but this step requires the filesystem to be readable. Therefore, this method is primarily effective for finding files that were previously indexed. For new files added after the filesystem became inaccessible, this technique will not work unless you can temporarily restore read access to update the index. For related troubleshooting on storage issues, see Fixing External Storage Mounting Issues in Linux: A Guide to Using 'force' and 'fsck' Commands.

Executing the Search Command

The core advantage of plocate is its speed and low resource usage compared to older mlocate implementations. To search for a specific file or pattern within an inaccessible filesystem, simply run:
plocate filename_pattern
This command searches the entire database. If you know the file resides in a specific path prefix, you can filter the output using standard Unix tools. For example, to find files in a mounted but unreadable drive typically assigned to /mnt/broken_drive, you might pipe the output through grep:
plocate filename | grep /mnt/broken_drive
Note that plocate does not support complex regular expressions out of the box in the same way grep does; it uses simple globbing patterns. If you need advanced pattern matching, consider combining plocate with grep for post-processing, similar to how one might Find File Names with Grep Command for more complex text-based searches.

Handling Large Results and Performance

Because plocate searches the entire index, queries can return thousands of matches, especially if the pattern is generic. This can make the terminal sluggish or difficult to parse. To mitigate this, always use specific filenames or extensions. For instance, searching for .log will yield vastly different results than searching for config. If the database is extremely large, plocate remains significantly faster than find because it avoids I/O waits associated with reading directory structures. However, if the database itself is corrupted or too fragmented, you might encounter errors. In such cases, rebuilding the database is necessary, though this again requires temporary access to the filesystem. For scenarios involving monitoring changes or syncing data before a crash occurs, reviewing Sync Filesystem: Wait Done - Export Logs to USB Drive can provide insights into maintaining data integrity during unexpected failures.

Limitations and Risks

While plocate offers a clever workaround, it is not a repair tool. It cannot help you copy, move, or delete files from the inaccessible filesystem because those operations require actual filesystem interaction. It is purely a discovery mechanism based on historical data. Additionally, if the filesystem was formatted or heavily modified after the last database update, any information about those changes will be missing. Always verify critical file existence by restoring read-only access if possible, rather than relying solely on the index.

Frequently Asked Questions

Can plocate find files that were added after the filesystem became inaccessible?

No, plocate can only report on files that were present in the database at the time of the last update. If new files were created after the filesystem failed, they will not appear in the search results until the database is rebuilt with access restored.

Is plocate faster than find on a healthy system?

Yes, plocate is generally much faster than find because it queries a static database file instead of traversing the directory hierarchy. This makes it ideal for quick lookups, though it lacks the real-time accuracy of find.

What should I do if plocate returns no results for a known file?

First, check if the database is up to date by running sudo plocate -u. If the database is current and the file is still not found, it may have been deleted or moved outside the indexed paths, or the filesystem containing it was never included in the locate index configuration.

Can I use plocate to recover lost data?

No, plocate is a search utility, not a data recovery tool. It helps you identify the location of files based on existing records but cannot reconstruct deleted data or fix corrupted filesystem structures.

How do I exclude certain directories from plocate searches?

You can configure plocate to ignore specific directories by editing the /etc/updatedb.conf file. Adding paths to the PRUNEPATHS variable ensures those directories are excluded from future database updates, reducing noise in your search results.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More