A hard disk mounted with no partitions usually indicates that the device node is missing, the filesystem is corrupted, or the drive has been wiped. Verify the block device status using lsblk and check kernel logs with dmesg for I/O errors. If the device exists but shows no partitions, you may need to recreate the partition table using fdisk or parted, ensuring you do not overwrite existing data unless intended.
Verify Block Device Visibility
The first step in troubleshooting a hard disk that appears to have no partitions is confirming that the operating system can physically see the drive. Sometimes, the issue is not with the partitioning scheme itself, but with the kernel failing to detect the hardware due to cable issues, controller problems, or power management states. You must distinguish between a drive that is completely invisible and one that is visible but lacks logical divisions.
Open a terminal and execute the lsblk command. This tool lists all available block devices in a tree format. Look for your target drive, typically identified as sda, sdb, or nvme0n1. If the drive does not appear in this list, the problem is likely hardware-related or related to the storage controller driver rather than partitioning software. Check the physical connections, ensure the SATA or NVMe slot is seated correctly, and verify that the drive spins up if it is an HDD.
If the drive appears in lsblk but has no child entries under it, this confirms that the partition table is either missing or unreadable. In this scenario, the device node exists (e.g., /dev/sdb), but there are no sub-devices like /dev/sdb1. Proceed to inspect the kernel messages to rule out immediate hardware failure.
Check Kernel Logs for Errors
Before attempting any repairs, it is crucial to determine if the drive is suffering from physical damage or bad sectors. Corrupted partition tables can sometimes be a symptom of underlying media errors. Use the dmesg command to view recent kernel ring buffer messages. Filter the output specifically for your device name to isolate relevant events.
dmesg | grep -i sd
Look for keywords such as "I/O error," "reset failed," or "media error." If you see repeated I/O errors when accessing the device, the drive may be failing, and you should prioritize data recovery over partition repair. If the logs show clean initialization but no partition detection, the partition table structure is likely lost or corrupted. In cases where the partition table is intact but the filesystem is damaged, refer to our guide on How to Test for ext4 Partition? Not ext4 Filesystem to diagnose filesystem-level issues separately from block-level problems.
Recreate the Partition Table
If the hardware is healthy and the partition table is confirmed missing, you will need to create a new one. This process involves defining how the disk is divided into logical sections. Be extremely cautious, as this operation will destroy all existing data on the disk if it was previously partitioned. Always back up important data before modifying partition tables.
You can use fdisk or parted for this task. Using fdisk, enter the interactive mode by running sudo fdisk /dev/sdX, replacing X with your drive letter. Inside the menu, type o to create a new empty DOS partition table, or g to create a GPT partition table. GPT is recommended for modern drives larger than 2TB and UEFI systems. After creating the table, type n to add a new partition, accept the defaults for size, and then type w to write the changes to disk.
Once the partition is created, you must format it with a filesystem. For Ubuntu, ext4 is the standard choice. Use the command sudo mkfs.ext4 /dev/sdX1 to format the newly created partition. This prepares the volume for mounting and data storage.
Update Mount Points and fstab
After formatting, the partition needs to be accessible via the directory tree. Create a mount point directory, such as /mnt/data, using mkdir. Then, mount the partition manually to test it: sudo mount /dev/sdX1 /mnt/data. If the mount succeeds, you can access files at that location.
To make this persistent across reboots, you should update the /etc/fstab file. This file contains instructions for the system on which partitions to mount and where. Incorrect entries here can prevent booting or cause mount failures. Ensure you use the UUID of the partition rather than the device name, as device names can change. You can find the UUID using blkid. A detailed explanation of managing these entries is available in Explain _ Information: You may need to update /etc/fstab. Add a line to /etc/fstab with the UUID, mount point, filesystem type, and options.
Frequently Asked Questions
Why does lsblk show my drive but no partitions?
This occurs when the partition table is missing, corrupted, or formatted in a way the kernel cannot read. It means the raw blocks exist, but the logical structure dividing them is gone. Recreating the partition table with fdisk or parted resolves this.
Can I recover data from a drive with no partitions?
Yes, data recovery tools like TestDisk or Photorec can scan the raw disk for known file signatures and restore partitions or individual files. However, success depends on whether the partition table header was overwritten. Stop writing to the disk immediately to maximize recovery chances.
What is the difference between MBR and GPT partition tables?
MBR (Master Boot Record) supports up to 2TB drives and four primary partitions, while GPT (GUID Partition Table) supports much larger drives and more partitions. GPT is the modern standard, especially for UEFI boot systems, and offers better redundancy with backup partition tables.
How do I fix a drive that shows as read-only after mounting?
This often happens if the filesystem is detected as dirty due to an unclean shutdown. Run fsck on the partition to check and repair inconsistencies. If the drive is physically failing, it may switch to read-only mode to prevent further data loss.
Is it safe to delete all partitions on a drive?
It is safe if you intend to wipe the drive entirely and start fresh. However, this action is irreversible and will erase all data. Ensure you have backups and have selected the correct device path, as deleting partitions on the wrong drive will result in permanent data loss.