I have two NVMe drives in my Proxmox computers. My problem is that the drive names are not persistent and change in connection with reinstallation or reboot. The problem is not specific to NVMe drives. The same would happen if it were SATA drives. What I need is a oneline command that returns the device name of my boot drive in the format /dev/nvme* or /dev/sd*. I need to use the command in connection with setting up my Proxmox computers via Ansible.
**EDIT:** I'm trying to be a little more specific about what I need. In Ansible I have a list of available drives in the computer. In my case with NVMe drives the list looks like this:
[/dev/nvme0n1,/dev/nvme1n1]
. If I had SATA drives the list could look like this: [/dev/sda,/dev/sdb,/dev/sdc]
. In connection with setting up a Ceph cluster, I need a drive list excluding my boot drive. So I need a command that for example returns /dev/sda or /dev/nvme0n1. I then use that as a mask to remove the boot drive from the list of available drives.
Asked by Søren Sjøstrøm
(87 rep)
Aug 10, 2025, 05:14 PM
Last activity: Aug 11, 2025, 06:18 AM
Last activity: Aug 11, 2025, 06:18 AM