In distributed storage systems, an r-Locally Repairable Code (r-LRC) ensures that a failed symbol can be recovered by accessing at most r other symbols. Prakash et al. in (Proceedings of IEEE International Symposium on Information Theory, pp. 2776–2780, 2012) further introduced the concept of \((r, \delta )\) -LRC, where \(\delta \ge 2\) , which can deal with the symbol failure in the presence of extra \(\delta -2\) symbol failures still by accessing at most r other symbols. In particular, an r-LRC is just an (r, 2)-LRC. Luo and Ling in (Des Codes Cryptogr 90:1271–1287, 2022) obtained some alphabet-optimal r-LRCs concerning the Cadambe–Mazumdar bound from optimal linear codes constructed by special projective spaces. In this paper, we generalize the results of Luo and Ling in (Des Codes Cryptogr 90:1271–1287, 2022). Firstly, we generalize the result of constructing optimal linear codes to larger code length. In particular, we present the conditions for the constructed linear codes to qualify as Griesmer codes or distance-optimal codes. Secondly, we explore the locality of the constructed codes. The novelty of our work lies in establishing the locality as \((r,\delta )\) -locality and \((r,\delta )\) -locality with availability, in contrast to the previous literature that only considered r-locality. In addition, through the analysis combining the code parameters and the Cadambe–Mazumdar-like bound for \((r,\delta )\) -LRCs, we obtained some alphabet-optimal \((r, \delta )\) -LRCs and alphabet-optimal \((r, \delta )\) -LRCs with availability.