8. Given the sequence $\left\{a_{n}\right\}$ with the first term being 2, and satisfying $6 S_{n}=3 a_{n+1}+4^{n}-1$. Then the maximum value of $S_{n}$ is
$$
\begin{array}{l}
6 S_{n}=3\left(S_{n+1}-S_{n}\right)+4^{n}-1 \Rightarrow S_{n+1}=3 S_{n}-\frac{4^{n}-1}{3} \\
\Rightarrow S_{n+1}+\lambda \cdot \frac{4^{n+1}-1}{3}+b=3\left(S_{n}+\lambda \cdot \frac{4^{n}-1}{3}+b\right) \\
\Rightarrow S_{n+1}+4 \lambda \cdot \frac{4^{n}-1}{3}+\lambda+b=3 S_{n}+3 \lambda \cdot \frac{4^{n}-1}{3}+3 b \\
\Rightarrow S_{n+1}=3 S_{n}-\lambda \cdot \frac{4^{n}-1}{3}+2 b-\lambda \Rightarrow \lambda=1, b=\frac{1}{2} .
\end{array}
$$
$$
\text { Then } S_{n}+\frac{4^{n}-1}{3}+\frac{1}{2}=\frac{7}{2} \cdot 3^{n-1} \Rightarrow S_{n}=\frac{7}{2} \cdot 3^{n-1}-\frac{4^{n}-1}{3}-\frac{1}{2}=\frac{7 \cdot 3^{n}-2 \cdot 4^{n}-1}{6} \text {. }
$$

After calculation, when $n=3$, $S_{n}$ reaches its maximum value of 10.
$$