Bug #6411

Changing mount device when ensuring unmounted causes bogus mount of new device

Added by Paul Berry about 1 year ago. Updated 4 months ago.

Status:Accepted Start date:02/22/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:mount
Target version:2.7.x
Affected Puppet version:development Branch:
Keywords:
Votes: 0

Description

This behavior was observed on Mac OS X. Unsure if it exists on other OSes.

First run this manifest:

file { '/Volumes/NIKON_D40X': ensure => directory }
mount { '/Volumes/NIKON_D40X': ensure => unmounted, device => "/dev/disk1s1", fstype => msdos, options => ro, require => File['/Volumes/NIKON_D40X'] }

Then execute:

mount /Volumes/NIKON_D40X

(Note: this requires you to have a device plugged into /dev/disk1s1—this is the SD card reader on mac laptops)

Then run this manifest:

mount { '/Volumes/NIKON_D40X': ensure => unmounted, device => "/dev/disk1s2", fstype => msdos, options => ro }

You get this error:

info: Applying configuration version '1298412039'
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/mount'
notice: /Stage[main]//Mount[/Volumes/NIKON_D40X]/device: device changed '/dev/disk1s1' to '/dev/disk1s2'
debug: Flushing mount provider target /etc/fstab
debug: Finishing transaction 2164063200
info: FileBucket adding {md5}6e03fd206f67d67d645b74b0baab9a05
info: /Stage[main]//Mount[/Volumes/NIKON_D40X]: Scheduling refresh of Mount[/Volumes/NIKON_D40X]
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/mount'
info: Mount[/Volumes/NIKON_D40X](provider=parsed): Remounting
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/umount /Volumes/NIKON_D40X'
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/mount'
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/mount'
debug: Flushing mount provider target /etc/fstab
debug: Puppet::Type::Mount::ProviderParsed: Executing '/sbin/mount -o ro /Volumes/NIKON_D40X'
err: /Stage[main]//Mount[/Volumes/NIKON_D40X]: Failed to call refresh: Execution of '/sbin/mount -o ro /Volumes/NIKON_D40X' returned 1: mount: realpath /Volumes/NIKON_D40X: No such file or directory

Related issues

related to Puppet - Bug #6309: Mount type should check mount state as well as fstab Closed 02/14/2011
duplicated by Puppet - Bug #6633: Mount provider remounts unnecessarily Duplicate 03/08/2011

History

Updated by Matt Robinson about 1 year ago

  • Status changed from Unreviewed to Accepted

Updated by Stefan Schulte about 1 year ago

I guess this is #6309. What happens in the second run is the following

  1. puppet retrieves ensure. Because the wrong device is mounted puppet will set the current state to unmounted (= ensure is in sync)
  2. now puppet looks at the device. Device is out of sync so it changes the device. The change will fire a selfrefresh
  3. in refresh puppet remounts only if our resource is mounted right now. Because puppet didnt umount the device in step 1 it will now remount it and fail.

There is currently a discussion on puppet-dev about #6309

Updated by Ben Hughes 4 months ago

  • Description updated (diff)
  • Status changed from Accepted to Unreviewed

Updated by Devon Peters 4 months ago

  • Description updated (diff)
  • Category set to mount
  • Status changed from Unreviewed to Accepted
  • Target version set to 2.7.x

able to reproduce with same behavior on Linux.

Also available in: Atom PDF