code: func (pb *Block) Snapshot(dir string) error {
  	blockDir := filepath.Join(dir, pb.meta.ULID.String())
  	if err := os.MkdirAll(blockDir, 0777); err != nil {
  		return errors.Wrap(err, "create snapshot block dir")
  	}
  
  	chunksDir := chunkDir(blockDir)
  	if err := os.MkdirAll(chunksDir, 0777); err != nil {
  		return errors.Wrap(err, "create snapshot chunk dir")
  	}
  
  	// Hardlink meta, index and tombstones
  	for _, fname := range []string{
  		metaFilename,
  		indexFilename,
  		tombstoneFilename,
  	} {
  		if err := os.Link(filepath.Join(pb.dir, fname), filepath.Join(blockDir, fname)); err != nil {
  			return errors.Wrapf(err, "create snapshot %s", fname)
  		}
  	}
  
  	// Hardlink the chunks
  	curChunkDir := chunkDir(pb.dir)
  	files, err := ioutil.ReadDir(curChunkDir)
  	if err != nil {
  		return errors.Wrap(err, "ReadDir the current chunk dir")
  	}
  
  	for _, f := range files {
  		err := os.Link(filepath.Join(curChunkDir, f.Name()), filepath.Join(chunksDir, f.Name()))
  		if err != nil {
  			return errors.Wrap(err, "hardlink a chunk")
  		}
  	}
  
  	return nil
  }
docs: // Snapshot creates snapshot of the block into dir.