Azure reinitialization or overwritten partition table.

Alec Voronovich 0 Reputation points
2025-01-17T22:30:45.8433333+00:00

Has anyone encountered a data disk partition disappearing after a VM reboot or detach/reattach in Azure—likely due to some automated reinitialization—leaving the data inaccessible? How can I recover or prevent this scenario?
A 440 GB data disk previously partitioned and formatted (as /dev/nvme1n1p1) now shows up with no partitions after a reboot/detach in Azure. The filesystem was mounted at /mnt/data and contained critical data, but now lsblk only shows /dev/nvme1n1 without any partition (/dev/nvme1n1p1). Azure might have reinitialized the disk or overwritten the partition table, causing the data to vanish.

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
659 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vinod Kumar Reddy Chilupuri 2,310 Reputation points Microsoft Vendor
    2025-01-20T07:00:07.1633333+00:00

    Hi @Alec Voronovich

    Welcome to Microsoft Q&A, thanks for posting your query.

    If a data disk partition disappears after a VM reboot or detach/reattach in Azure, it may be due to issues with the partition table or disk initialization. When a disk is detached and reattached, Azure may sometimes reinitialize the disk, especially if it is not properly unmounted or if there are issues with the disk's metadata. This can lead to the loss of the partition table.

    • Use tools like fdisk to inspect the current state of the partition table. If you have documentation of the original partition layout, you can recreate the partitions
    • You can try using disk recovery tools to scan the disk for lost partitions or recover data. Tools like testdisk or gparted can help in some cases.
    • Prevent Future Issues: To avoid this scenario in the future, ensure that you properly detach disks before rebooting the VM. Additionally, consider regularly backing up critical data to prevent loss.

    By following these recovery steps and implementing preventive measures, you can effectively manage the risk of data loss associated with disappearing partitions on Azure data disks. If issues persist, restoring from a backup is often the most reliable way to recover critical data.

    https://learn.microsoft.com/en-us/troubleshoot/azure/cloud-services/extended/deploy/disk-partition-preservation#disk-partition-preservation

    Troubleshoot Linux VM device name changes in Azure - Virtual Machines | Microsoft Learn

    https://learn.microsoft.com/en-us/troubleshoot/azure/cloud-services/extended/deploy/disk-partition-preservation#disk-preservation

    Hope the above answer helps! Please let us know do you have any further queries.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.