  Locally repairable codes(LRCs) play important roles in distributed storage
systems(DSS). LRCs with small locality have their own advantages since fewer
available symbols are needed in the recovery of erased symbols. In this paper,
we prove an upper bound on the dimension of LRCs with minimum distance $d\geq
7$. An upper bound on the length of almost optimal LRCs with $d=7$, $r=2$ at
$q^2+q+3$ is proved. Then based on the $t$-spread structure, we give an
algorithm to construct almost optimal LRCs with $d=7$, $r=2$ and length $n\geq
3\lceil\frac{\sqrt{2}q}{3}\rceil$ when $q\geq 4$, whose dimension attains the
aforementioned upper bound.
