Problems if device name changes

I had a 2 disk pool on sdb and sdc. I hotplugged another drive which showed up as sdd. However after a reboot the new drive became sdb, and the old drives became sdc & sdd and Rockstor couldn’t mount the pool.

This is a very good test, thank you. Can you do one more thing, which will help us fix this issue faster?

First, I assume your system is fully updated(3.4-1). After reboot, open the web-ui and go to Storage -> Disks screen. That triggers a rescan which could go one of these two ways IMO.

1. Rockstor will properly update it’s disk state and it will then mount pools and filesystems correctly.
2. It may bomb in an unknown fashion and still fail to mount, in which case, the logs will provide useful information to track this bug down. in this case, you can just send us the /opt/rockstor/var/log/rockstor.log file( Reboot again and see if it successfully mounts automatically.

I can probably fix this issue without above requested help, but would greatly appreciate it if you can. Either way, we should be able to fix this soon. Here’s the issue:

I was able to reproduce this equivalently but not exactly as in your case. As I suspected, this is not an issue if Rockstor does a rescan before mounting pools and shares.

Currently there is a bootstrap process that happens when the rockstor service starts and this problem is solved by making rescan part of the bootstrap. I made this fix in issue #546.

The fix will be rolled out in the next update sometime in the next couple of days. In the meantime, if you provide the information I asked in the previous comment, it would also help further validate. I know it can be hard to reproduce, so no worries if you can’t.

Longer term, we’ll need something more robust than bootstrap code to handle important os events. I’ve created a place holder issue for that:

At the time, I hacked around it to get the device mounted. It was only a temporary thing to copy some data off and I have since removed the drive. IIRC I had tried a rescan, and that updated the drive serial and capacity to match the correct device, but the pool was still showing on the original device name (which was now the newly added drive).
Note that the recommended way to mount file-systems is by UUID or label, and these avoid the issue of changing device names entirely. 

Next stable rpm update is being built as I write this and it should fix the device renaming issue(#546).

Thanks for the mount by uuid tip. It sounds like a better design and simplifies the code also. I’ll test it out.

Closing the loop on this topic. The issue has been fixed a while ago(Dec 10, 2014).

The longer term feature( that I mentioned in the previous comment can be discussed separately.