A cross-platform tool to gather detailed information about the connected storage devices on your system. It works seamlessly on both Linux and Windows environments.
The Storage Device Inspector enables you to inspect and gather comprehensive information about all the storage devices connected to your system, including USB drives, internal hard drives, and SSDs.
- Device Type: USB, Fixed Disk (internal storage)
- Serial Number, Model Information
- Vendor and Product IDs
- Total Size and Free Space (in both GB and bytes)
- Filesystem Information (including partitions)
- Health Status (if available)
This tool is perfect for users needing a quick overview of all connected storage devices, or for those who wish to export this data for analysis.
- Cross-Platform Compatibility: Works on both Linux and Windows with minimal setup.
- Comprehensive Data: Gathers in-depth information about each device’s type, size, partitions, filesystem, and more.
- Simple & Fast: No complex installations—just run the script to get instant results in a JSON format.
- Exportable: Results are saved in a
StorageDevicesInfo.jsonfile, making it easy to integrate with other tools or systems.
git clone https://github.com/AliJ-Official/StorageDevicesInspector.gitIf you don't have Git installed, you can download the zip file from this link and extract it.
- No external dependencies are required for the PowerShell script. As long as you have PowerShell installed, you're all set. However, you’ll need to adjust the Execution Policy to allow scripts to run.
-
Open PowerShell in the same directory
-
Check Current Execution Policy:
Get-ExecutionPolicy -
If the policy is set to Restricted, temporarily change it to Bypass:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\StorageDevicesInspector.ps1Once the script finishes, a StorageDevicesInfo.json file will be generated in the same directory, containing the detailed information of all connected storage devices.
-
This script requires
jqto format the output as JSON. Depending on your distribution, follow the appropriate instructions to install it. -
For Debian/Ubuntu-based Systems (apt):
sudo apt-get update && sudo apt-get upgrade sudo apt-get install jq -
For Red Hat/CentOS/Fedora-based Systems (dnf or yum):
sudo dnf install jq # or sudo yum install jq -
For Manual Installation (Universal) Download the binary and move it to the correct directory:
curl -Lo jq https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 chmod +x jq sudo mv jq /usr/local/bin/
chmod +x StorageDevicesInspector.sh./StorageDeviceInspector.shOnce the script finishes, a StorageDevicesInfo.json file will be generated in the same directory, containing the detailed information of all connected storage devices.
Both scripts will generate a StorageDevicesInfo.json file. The data will be structured in JSON format, making it easy to parse or integrate with other tools for analysis or reporting.
Feel free to modify and adapt these scripts to suit your needs. If you have suggestions, improvements, or new features, feel free to submit a Pull Request!
Contributions are always welcome! If you find any bugs, or have feature requests, or improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Icons by FontAwesome
jqfor JSON parsing: https://stedolan.github.io/jq/- PowerShell for Windows: Pre-installed on most Windows systems