Open dtseiler opened 7 months ago
I just saw this note from v3.0.3:
fix the check for an existing mountable filesystem before running mkfs again
Would that fix this issue?
Actually I wonder if this line alone would do the short-circuiting I need here:
unless mounted?(device)
update, nevermind, we have that but it's in providers/default.rb. Perhaps I can copy the same fixes you had in that PR where I see they should go.
I wonder if we could update the mounted?
function to traverse symlinks (eg if device
is a symlink, check the target of that symlink). I think that would then see that, for example, /dev/disk/by-id/foo-data
is already mounted, just at /dev/sdb
, and would return rather than try to format and mount it again.
:speaking_head: Foreword
Good morning.
:ghost: Brief Description
Using GCP VM (GCE). We had been using
/dev/sdX
device settings but since those are not stable we are looking at changing to the recommended usage of/dev/disk/by-id/foo
. However when we do this, thefilesystem
module appears to always kick offmkfs
everytime, presumably because/proc/mounts
and/etc/mtab
etc. still refer to the/dev/sdX
value, so the device names differ?It doesn't appear to actually do anything, my data is intact and nothing was unmounted or remounted. Is this the expectation? Is there any way for
filesystem
to recognize the symlink for the/dev/sdX
device and not try to reformat everytime?:pancakes: Cookbook version
v1.0.0 (yes we have an old download apparently)
:woman_cook: Chef-Infra Version
Chef Infra Client: 18.3.0
:tophat: Platform details
Google Cloud GCE
Steps To Reproduce
Steps to reproduce the behavior:
/dev/sdb
) with aby-id
symlink pointing to it (eg/dev/disk/by-id/foo-data
)filesystem
with theby-id
path for thedevice
attributeChef client.log messages:
Again, it doesn't appear to actually be doing anything, presumably it recognizes that the volume already has a filesystem and exits. But I'd rather not have the attempt at all.
:police_car: Expected behavior
Ignore the existing filesystem if the device is a symlink to an already-established device
:heavy_plus_sign: Additional context
I know our version of filesystem is terribly old. Please let me know if this behavior is fixed in a newer version.
Not sure how easy it would be to upgrade it. Obviously we can't risk any destructive changes.