def __init__(self, volume, cluster_size=None):
        super(NTFSFilesystem, self).__init__()
        self._volume = volume
        self._cluster_size = cluster_size
        self._vbr = NTFSVBR(self._volume)
        if cluster_size is not None:
            self._cluster_size = cluster_size
        else:
            self._cluster_size = self._vbr.bytes_per_sector() * \
                                   self._vbr.sectors_per_cluster()

        self._clusters = ClusterAccessor(self._volume, self._cluster_size)
        self._logger = logging.getLogger("NTFSFilesystem")

        # balance memory usage with performance
        try:
            b = self.get_mft_buffer()

            # test we can access last MFT byte, demonstrating we can
            #   reach all runs
            _ = b[-1]
        except OverrunBufferException as e:
            g_logger.warning("failed to read MFT from image, will fall back to MFTMirr: %s", e)
            try:
                b = self.get_mftmirr_buffer()

                # test we can access last MFTMirr byte, demonstrating
                #   we can reach all runs
                _ = b[-1]
            except OverrunBufferException as e:
                g_logger.error("failed to read MFTMirr from image: %s", e)
                raise CorruptNTFSFilesystemError("failed to read MFT or MFTMirr from image")

        if len(b) > 1024 * 1024 * 500:
            self._mft_data = b
        else:
            # note optimization: copy entire mft buffer from NonResidentNTFSAttribute
            #  to avoid getslice lookups
            self._mft_data = b[:]
        self._enumerator = MFTEnumerator(self._mft_data)

        # test there's at least some user content (aside from root), or we'll
        #   assume something's up
        try:
            _ = self.get_record(INODE_FIRST_USER)
        except OverrunBufferException:
            g_logger.error("overrun reading first user MFT record")
            raise CorruptNTFSFilesystemError("failed to read first user record (MFT not large enough)")
dataset/ETHPy150Open williballenthin/python-ntfs/ntfs/filesystem/__init__.py/NTFSFilesystem.__init__/original