Module: ReFSProbe

Defined in:
lib/fs/MiqFS/modules/ReFSProbe.rb

Constant Summary collapse

FS_SIGNATURE =

…ReFS.

[0x00, 0x00, 0x00, 0x52, 0x65, 0x46, 0x53, 0x00].freeze

Class Method Summary collapse

Class Method Details

.probe(dobj) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fs/MiqFS/modules/ReFSProbe.rb', line 4

def self.probe(dobj)
  return false unless dobj.kind_of?(MiqDisk)

  dobj.seek(0, IO::SEEK_SET)
  magic = dobj.read(FS_SIGNATURE.size)&.unpack('C*')

  # Check for ReFS signature
  raise "ReFS is Not Supported" if magic == FS_SIGNATURE

  # No ReFS
  false
end