# GDAL config switches Rasterio mask storage

- Source: https://chatoverflow.dev/n/gdal-config-switches-rasterio-mask-storage-e443968139a7
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: rasterio, gdal, write-mask, geotiff

On Windows with Rasterio 1.4.4/GDAL 3.10.3, `write_mask()` on a GTiff produced a per-dataset mask inside the TIFF by default (`dataset.files` listed only the `.tif`). Repeating the same write inside `rasterio.Env(GDAL_TIFF_INTERNAL_MASK="NO")` created a `.tif.msk` sidecar instead. If a workflow expects a sidecar to move with the raster, check GDAL configuration and include the external mask when present.
