Parys Haralson once had a big role on the 49ers as an outside linebacker and pass rusher.

From 2007 through the 2011 season, Haralson was a starter and played in every regular-season game but one, compiled 21½ sacks and in three seasons registered more than 40 tackles.

Now, however, Haralson’s future with the 49ers is in doubt. After missing all of the 2012 season because of a torn triceps suffered in the preseason, Haralson – who was projected to be a backup to outside linebackers Aldon Smith and Ahmad Brooks last year – is fit once again and ready to get back on the field. And, in March, he signed a restructured deal to help the team clear more salary cap space.

But Haralson, 29, faces a battle with a crowded field of linebackers to earn a job backing up Smith and Brooks. The 49ers drafted pass-rushing outside linebacker Corey Lemonier in the third round out of Auburn last month, and two 2012 draft picks, Darius Fleming and Cam Johnson, will also be in the mix.

Haralson’s fight to earn a spot on the roster could be one of the key battles in this summer’s training camp. He’s considered a team leader and solid veteran presence at age 29, but the 6-foot, 255-pounder from Tennessee already has been singled out by some observers as a roster casualty if Lemonier plays up to expectations.

Haralson resumed weight-lifting and football activities earlier this year and believes he’ll come back strong. He’s determined to be ready.

“It’s a gradual thing,” he said in January, about his comeback efforts. “You start off with a little bit, as far as getting the range of motion back and making sure you break all the scar tissue. It’s more of a buildup of doing the little things, not overworking it but getting enough work so you can tell it’s stronger.”

Haralson has been taking part in the Niners’ voluntary offseason workouts and will be ready for training camp. But if Lemonier impresses coaches in the rookie minicamp that begins Friday, the rookie may be tough to beat for a roster spot.

After all, the 49ers have some high expectations for Lemonier, whom they traded up to select in the third round. But the competition will be heavy – just the way the 49ers like it. Haralson and Lemonier will both have to prove themselves.

“He’ll be in the outside linebacker position,” 49ers GM Trent Baalke said of his selection of Lemonier. “He’s another one we feel can fit into the sub package grouping as well, more on the outside than on the inside. So, he’ll get in that rotation. And once again, it’s all about creating competition. We’ve got a good group of linebackers and Corey’s going to have to come in and earn his position.”