> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to inspect a VM and attach its boot disk to another VM

If a virtual machine (VM) does not start or you cannot connect to it, you can attach its boot disk to another VM as a secondary disk and inspect the boot disk from there. To do this:

1. [Create a VM](/compute/virtual-machines/manage) for debugging in the same project as the boot disk you want to inspect. [Set up the SSH connection](/compute/virtual-machines/connect#set-up-the-vm) to your new VM.

2. [Stop the original VM](/compute/virtual-machines/stop-start#how-to-stop-and-start-vms-manually) that you want to inspect. Otherwise, you can't attach its boot disk to another VM.

3. Get the ID of the original VM's boot disk:

   ```bash theme={null}
   nebius compute instance get --id <original_VM_ID> \
     --format jsonpath='.spec.boot_disk.existing_disk.id'
   ```

4. Attach the boot disk to the debug VM as a secondary disk:

   ```bash theme={null}
   nebius compute instance update <debug_VM_ID> \
     --patch \
     --secondary-disks '[{"existing_disk": {"id": "<boot_disk_ID>"}, "attach_mode": "READ_WRITE", "device_id": "original-boot-disk"}]'
   ```

5. [Connect to the debug VM by using SSH](/compute/virtual-machines/connect#connect-to-the-vm-by-using-ssh).

6. List the partitions and filesystems on the boot disk:

   ```bash theme={null}
   lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS /dev/disk/by-id/virtio-original-boot-disk
   ```

7. Mount the filesystem you need to inspect. The root filesystem is on the largest ext4 (or xfs) partition — usually `-part1`. To mount it:

   ```bash theme={null}
   sudo mkdir -p /mnt/original-boot-disk
   sudo mount -o ro /dev/disk/by-id/virtio-original-boot-disk-part1 /mnt/original-boot-disk
   ```

   For safety, use the `-o ro` parameter to mount the filesystem in read-only mode. This prevents any accidental changes to the boot disk you are inspecting.

8. (Optional) If you need to repair the filesystem by writing to it, remount it in read-write mode:

   ```bash theme={null}
   sudo mount -o remount,rw /mnt/original-boot-disk
   ```

9. When done inspecting, unmount the filesystem:

   ```bash theme={null}
   sudo umount /mnt/original-boot-disk
   ```

10. [Detach](/compute/storage/detach-volume#remove-the-volume-from-the-vm's-specification) the boot disk of the original VM from the debug VM.

11. After the disk is detached, [start the original VM](/compute/virtual-machines/stop-start#how-to-stop-and-start-vms-manually). You can't start the VM if its boot disk is attached to another running VM.

## See also

* [How to collect diagnostic logs from Compute virtual machines](/compute/virtual-machines/logs)
* [Viewing serial logs of virtual machines](/compute/monitoring/serial-logs)
* [How to detach additional volumes from virtual machines](/compute/storage/detach-volume)
* [Attaching and mounting Compute volumes to VMs](/compute/storage/use)
