> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/cloud/azure/virtual-machines/vm/azure-vm-lvm-corruption-fix.md).

# Azure VM LVM corruption fix

### Solution:

* Make new VM
* Mounted Disk on that
* Mounted each LVM partition
* Dry run with:

```bash
xfs_repair -n /dev/mapper/LVMPartitionName
```

* Repaired partitions with:

```bash
xfs_repair /dev/mapper/LVMPartitionName
```

* The ones that could not be repaired like that, used last resort:

```bash
xfs_repair -L /dev/mapper/LVMPartitionName
```

* Tested again on all partitions with:

```bash
xfs_repair /dev/mapper/LVMPartitionName
```

* Closed new VM
* De-allocated disk
* Mounted disk back on the Old VM (in stopped state)
* Started Old VM
* Tested SSH access and GUI (Both worked)
* Deleted Newly Created VM and resources associated
