TL;DR
Yes, an HDD without an operating system can contain active viruses, but they can’t run or cause damage on their own. They need a compatible OS to execute. The risk is transferring the virus to a computer when connecting the drive.
Understanding the Risk
A virus needs code to be executed to become ‘active’. Without an operating system, there’s nothing to run that code. However, the virus files still exist on the HDD and can spread if connected to a working computer.
Steps to Check & Protect Against Viruses on an OS-less HDD
- Connect with Caution: Always connect the drive to a computer you trust or one that has up-to-date cyber security software. Ideally, use a dedicated ‘clean’ machine for this purpose.
- Initial Scan (Windows): If connecting to Windows, immediately run a full scan using Windows Defender or your preferred antivirus program. Right-click the drive in File Explorer and select “Scan with Microsoft Defender”.
- Initial Scan (macOS): macOS has built-in protection but it’s still wise to use an anti-malware scanner like Malwarebytes for a thorough check. Download from Malwarebytes and run a scan on the connected drive.
- Linux Scan (using ClamAV): If using Linux, install and use ClamAV, an open-source antivirus engine.
sudo apt updatesudo apt install clamav clamav-daemonfreshclamclamscan -r /mnt/your_drive_mount_point --infected --remove(Replace
/mnt/your_drive_mount_pointwith the actual mount point of your HDD.) - File Type Analysis: Look for suspicious file types. Executable files (.exe, .com, .bat on Windows; Mach-O executables on macOS) are most concerning. Be wary of double extensions (e.g.,
image.jpg.exe). - Boot Sector Scan: Some older viruses infect the boot sector. While less common now with modern drives and systems, it’s worth checking.
- Windows: Use a bootable antivirus rescue disk (e.g., Kaspersky Rescue Disk) to scan the drive before booting into Windows.
- Linux: Tools like
testdiskcan help examine partition tables and potentially identify boot sector issues, but requires advanced knowledge.
- Consider a Full Format (Data Loss Warning!): If you’re unsure about the drive’s cleanliness and don’t need the data on it, a full format is the most secure option. This will erase all data on the HDD.
- Windows: Right-click the drive in File Explorer, select “Format…”, choose “Full” under Format options.
- Linux: Use the
mkfscommand (e.g.,sudo mkfs.ext4 /dev/sdX1– replace/dev/sdX1with your drive’s partition).
- Regular Scans: If you plan to reuse the HDD, regularly scan it for viruses even after transferring files.
Important Considerations
- False Positives: Antivirus software can sometimes identify legitimate files as threats. Investigate any flagged files carefully before deleting them.
- Zero-Day Viruses: No antivirus is perfect. New viruses emerge constantly, so there’s always a risk of infection from unknown threats.
- Physical Damage: A physically damaged HDD can sometimes exhibit behavior that mimics virus activity.

