pub fn prepare_dir(config: &Config) -> Result<u32>
Creates the data directory if needed and returns its shard count.