The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #15878

Module puppetlabs/lvm: filesystem type is not safe

Added by Andre Nathan over 3 years ago. Updated over 2 years ago.

Status:ClosedStart date:08/08/2012
Priority:ImmediateDue date:
Assignee:-% Done:


Category:lvmSpent time:-
Target version:-
Keywords: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:



The logic to detect if a filesystem is present is implemented as follows:

 def exists?
   fstype != nil
 def fstype
   mount('-f', '--guess-fstype', @resource[:name]).strip
 rescue Puppet::ExecutionFailure

So if for whatever reason the mount command fails or returns a non-zero status (eg. because it ran out of memory or it segfaulted or the root partition was read-only or some other unpredictable situation), the fstype method will return nil, causing exists? to fail and the filesystem to be reformatted.

To be safe, the fstype test should only return nil if it’s sure there’s no filesystem in the device, and return non-nil in every other situation.


#1 Updated by William Van Hevelingen over 3 years ago

  • Category set to lvm

#2 Updated by Miguel Di Ciurcio Filho over 2 years ago

I think the current code is much more reliable than the old one:

def fstype
rescue Puppet::ExecutionFailure

If there is any better way to detect the presence of a filesystem, please reopen this ticket.

#3 Updated by Miguel Di Ciurcio Filho over 2 years ago

  • Status changed from Unreviewed to Closed

Also available in: Atom PDF