On Fri, Feb 26, 2010 at 11:32:45AM -0800, Luke Kanies wrote:
> On Feb 26, 2010, at 11:28 AM, Marcin Owsiany wrote:
>
>> On Thu, Feb 25, 2010 at 06:13:12PM +0100, Daniel wrote:
>>> On Thu, Feb 25, 2010 at 6:05 PM, Luke Kanies  
>>> <[email protected]> wrote:
>>>> On Feb 25, 2010, at 12:13 AM, Marcin Owsiany wrote:
>>>>
>>>>> On Wed, Feb 24, 2010 at 09:24:55AM -0800, Luke Kanies wrote:
>>>>>>
>>>>>> Or should we maybe skip the filesystem type entirely and just  
>>>>>> initialize
>>>>>> the volume as a given filesystem when the volume itself is  
>>>>>> created?
>>>>>> E.g., something like:
>>>>>>
>>>>>> logical_volume { foo: vg => bar, fs => ext3, ensure => present }
>>>>>>
>>>>>> So when you create the lv, you initialize the fs, but otherwise 
>>>>>> you
>>>>>> don't mess with it.
>>>>>
>>>>> Makes sense, although you should not get rid of the FS type. It  
>>>>> will
>>>>> still be useful for changing filesystem type (including online  
>>>>> migration
>>>>> between compatible filesystems like ext2->ext3).
>>>>
>>>> Is there, then, a consistent, safe way to determine the filesystem  
>>>> type?
>>>
>>> Maybe file i another option can help.
>>>
>>> # file -s /dev/mapper/rootvg-tmplv
>>> /dev/mapper/rootvg-tmplv: ReiserFS V3.6 block size 4096 (mounted or
>>> unclean) num blocks 128000 r5 hash
>>
>> That's also approximately the method I used in my provider for the  
>> filesystem type.
>>
>>> I'm not sure if this works when the superblock is corrupt. Maybe i  
>>> can
>>> do some testing on this subject
>>
>> I'm not sure it matters. There could always be a situation where your
>> filesystem is broken enough for file/mount/kernel to not be able to
>> recognize it, but for the data to still be in a recoverable state (at
>> least partially). The point is that we don't want puppet to do  
>> anything
>> harmful (like recreate the filesystem) in that case. Then again I  
>> don't
>> know if there is anything that you can do to a filesystem without
>> potentially harming it..
>
> This sounds basically intractable - there's no dependable way to know if 
> there's a filesystem in place, which to me means there's no way to know 
> if we should create a filesystem.  Right?

Yes, that is why I think the approach of using an attribute for the
volume resource is safer for filesystem creation.

However I imagine that for lossless filesystem conversion it should be
reasonably safe. Something like:

filesystem { "/dev/sda3":
  from => ext2,
  to => ext3
}

that would only call "tune2fs -j /dev/sda3" if the current type is
detected to be ext2. Even if that is an artifact of a corruption, then
tune2fs should be able to detect that and abort, I assume.

OTOH maybe having a full filesystem type for this purpose is a little
too much - there are not that many filesystems that can be upgraded on
the fly.

-- 
Marcin Owsiany <[email protected]>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to