wrong drive mounted

fabian91

New Member
Oct 25, 2024
7
1
3
Hi,
I had a problem with my imported VM yesterday. After reinstalling gdm3 there were no problems visible until now.

I have 2 drives connected to this vm: sda and sdb. /dev/sda1 contains the system and a mountpoint /storage. At this mountpoint /dev/sdb1 is mounted normally and shared to the users with a samba share.
I got a call an hour ago "All my data is gone". A quick look showed: /storage does not contain /dev/sdb1, it seemed like /dev/sda1 was mounted inside. The whole filesystem was visible inside the mountingpoint. So I have done a reboot and voila, everything works normally.

Is this a known bug? Or how does this happen?

Thanks
 
A quick look showed: /storage does not contain /dev/sdb1, it seemed like /dev/sda1 was mounted inside.
I'm not quite sure if I understand this sentence correctly. Do you mean that /dev/sda1 was mounted at /storage recursively? How are those mountpoints set up (e.g. cat /etc/fstab and cat /proc/mounts)?
 
Yeah, it was mounted recursively. /storage contained /dev/sda1.
But not real recursively. /storage contained /dev/sda1. So /storage/storage exists.
But /storage/storage was empty.

My entry /etc/fstab was:

/dev/sdb1 /storage

I changed it to use uuid, so I think this should not happen again. But how was this possible? Maybe some confusion about the drive order?
 
Were there any changes in the VM configuration or were they during runtime? Checking the syslog could also give further conclusions why that happened. How is the VM configured (qm config <vmid>)? Anyway, using the partition UUIDs is a good way if drives/udev should change the device names again.
 
Last edited:
Hi,
even if it is a virtual machine, device name assignments in Linux might be racy between subsequent boots, so it's best to never rely on the device name letters. IIRC, it can even happen without any real changes to or in the VM, but not 100% sure.
 
  • Like
Reactions: dakralex

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!