The defendant, David M. Azar, was convicted of murder in the second degree in 1989, and sentenced to life in prison. We later ordered a new trial, see Commonwealth v. Azar, 435 Mass. 675 (2002), but then the defendant pleaded guilty to the lesser included offense of manslaughter. He *73received credit for time served under his 1989 conviction, with the balance of his sentence suspended. The defendant later moved to correct his sentence, arguing that the failure of the plea judge to take into account statutory good time, to which he was entitled under G. L. c. 127, § 129,1 resulted in a sentence beyond the statutory maximum (twenty years) for manslaughter. The judge denied the defendant’s motion, and the defendant appealed. The Appeals Court vacated the “[ojrder denying defendant’s motion for new trial . . . .” Commonwealth v. Azar, 62 Mass. App. Ct. 1109 (2004). We granted the Commonwealth’s application for further appellate review. Because the defendant was not entitled to statutory good time while serving his sentence for murder, and because he is not entitled to good time while his sentence is suspended, we now affirm the judge’s denial of the defendant’s motion to correct an illegal sentence.
Facts. Although the background of this case is somewhat unusual, the facts required to resolve the issue before us are not in dispute. The defendant was indicted for the murder of his daughter in 1988, and was convicted of murder in the second degree on July 28, 1989, for which he was sentenced to life in prison. The defendant appealed from the conviction, and his conviction was affirmed on direct appeal in 1992. See Commonwealth v. Azar, 32 Mass. App. Ct. 290 (1992). The defendant moved for a new trial or for a finding of guilty on the lesser included offense of manslaughter on November 24, 1998. The trial judge did not believe it was in the interest of justice to reopen the “appellate agenda,” nor did he believe a lesser verdict was more consonant with justice and declined to act on the motion. The Appeals Court reversed, ordering a new trial. Commonwealth v. Azar, 50 Mass. App. Ct. 767 (2001). We granted the Commonwealth’s application for further appellate review, and vacated the denial of the defendant’s motion for a new trial, holding that an error in the jury instructions on the definition of malice, inter alla, created a substantial risk of a miscarriage of justice. Commonwealth v. Azar, 435 Mass. 675, 676 (2002).
*74Prior to retrial, the defendant pleaded guilty in 2002 to so much of the indictment as alleged manslaughter. In accordance with a plea agreement, the judge sentenced the defendant to a term of from nineteen to twenty years at the Massachusetts Correctional Institution, at Cedar Junction, with credit for the 4,570 days the defendant had served for his 1989 murder conviction, and the judge suspended the remainder of the sentence for ten years. A ten-year period of probation was imposed, with the conditions that the defendant have no contact with his former wife or children, and that he not visit his daughter’s grave.
On March 24, 2003, the defendant filed a motion pursuant to Mass. R. Crim. P. 30 (a), as appearing in 435 Mass. 1501 (2001), to correct an illegal sentence.2 Because the defendant’s claim that his sentence is illegal derives from the so-called “good time statute,” we pause to describe that statute. At the time of the defendant’s indictment and conviction of murder, individuals serving a term of imprisonment of four or more years were entitled to a statutory good time deduction of twelve and one-half days for each month served. See G. L. c. 127, § 129.3 *75“Unlike the other types of deductions, statutory good time is received as soon as the prisoner begins to serve his sentence. Although a prisoner can forfeit statutory good time for affirmative misconduct, he does not have to wait or do anything to acquire it in the first place.” Burno v. Commissioner of Correction, 399 Mass. 111, 114 (1987).
The defendant here claims that the statutory good time he was due for the period during which he was incarcerated on the murder conviction reduced his sentence to the extent that the period he had already served (4,570 days) was greater than the twenty-year maximum sentence for manslaughter.4 Thus, his argument continues, an imposition of ten years’ probation would be improper; he had already served the maximum sentence permitted under the statute. The judge denied the defendant’s request, concluding that the sentence was lawful, that the defendant entered the guilty plea voluntarily and with a full understanding of the consequences, and that, in the event the defendant violates probation and is committed on his sentence, the Department of Correction then would determine whether statutory good time entitled the defendant to a discharge.
In its unpublished memorandum and order pursuant to its rule 1:28, the Appeals Court vacated the judge’s denial of the *76defendant’s motion “for new trial.” See Commonwealth v. Azar, 62 Mass. App. Ct. 1109 (2004). Choosing to consider the defendant’s motion not as a challenge to an illegal sentence under rule 30 (a), but rather as a motion for a new trial under Mass. R. Crim. R 30 (b), as appearing in 435 Mass. 1501 (2001), the Appeals Court concluded that the statutory good time credits are guaranteed by State law and must be allowed when they are due, that is, at the time of sentencing, and that therefore the defendant was entitled to a new trial.
On December 10, 2004, the defendant was arraigned in Cambridge District Court on complaints of larceny of property over $250, G. L. c. 266, § 30; destruction of property, G. L. c. 266, § 127; and possession of a class B substance, G. L. c. 94C, § 34. As a result of these charges, the defendant was found in violation of his probation. Disposition of the probation violation was continued until June 7, 2005, presumably so that the import of a probation violation in this case could be resolved. Ordinarily, when probation is revoked, the original suspended sentence must be imposed. See Commonwealth v. Holmgren, 421 Mass. 224, 228 (1995). Here, the issue is whether any such suspended sentence remains.
Discussion. 1. Rule 30 (a). We consider first a procedural matter. The Appeals Court concluded in its memorandum that relief under rule 30 (a) was not available here, where the defendant is on probation, because such relief is “only available where a defendant is, at the time the motion is made, then serving a Massachusetts sentence.” The Appeals Court relied on our decision in Commonwealth v. Lupo, 394 Mass. 644 (1985), where we stated in dictum that “rule 30 (a) is intended primarily to provide relief for defendants incarcerated in violation of Federal law or of the laws of the Commonwealth.” Id. at 646. See Rodwell v. Commonwealth, 432 Mass. 1016, 1018 (2000); Commonwealth v. Ward, 15 Mass. App. Ct. 388, 390 n.2 (1983). The Appeals Court considered the motion instead as if it were one for a new trial. See rule 30 (b).
Although this is not an unreasonable construction, due to the language of rule 30 (a) that any “person who is imprisoned or whose liberty is restrained” may file a motion to correct his sentence, the situation in this case does not fit precisely within *77either rule 30 (a) (motion to correct illegal sentence) or rule 30 (b) (motion for new trial). The defendant is not imprisoned, but he does not want the new trial that would result from the granting of a rule 30 (b) motion. He seeks to challenge the legality of his sentence, and he does not desire the remedy of a new trial that the Appeals Court granted. Yet the defendant remains in jeopardy that an allegedly unlawful sentence may visit harm on him in the future. If the suspended sentence is imposed because of a probation violation, he would be returned to prison notwithstanding that the imposition of probation might have been improper in the first place. Accordingly, he should not be left without a remedy. Cf. Commonwealth v. Lupo, supra at 644-645 (defendant challenging only imposition of fine, not imposition of probation). “If the circumstances reveal that the judge imposed a sentence contrary to law, it would be unfair to deny relief at the appellate level.” Commonwealth v. Richards, 44 Mass. App. Ct. 478, 481 (1998). Nor does our statement in the Lupo case, that rule 30 (a) is “intended primarily to provide relief for defendants incarceratedprevent this result (emphasis added in part). Commonwealth v. Lupo, supra at 646. That statement was not intended to exclude from the rule’s coverage all defendants who are not incarcerated. As the defendant is not presenting a hypothetical situation, but instead may be committed to prison on a suspended sentence the legality of which he challenges, we choose to address the motion as one properly brought under rule 30 (a).
2. The sentence. The defendant’s contention that the statutory good time to which he is entitled reduces the maximum amount of time on a manslaughter sentence to a period shorter than the time he has already served overlooks the fact that the time the defendant served was pursuant to a conviction of murder. No statutory good time was available for murder. Statutory good time was provided only for prisoners serving a term of imprisonment. See G. L. c. 127, § 129 (“The officer in charge of each correctional institution . . . shall keep a record of each prisoner in his custody whose term of imprisonment is four months or more. Every such prisoner . . . shall be entitled to have the term of his imprisonment reduced by a deduction from the maximum term . . .” [emphasis added]). Indeed, the *78concept would be unworkable otherwise, given that in a life sentence there is no calculable maximum to reduce. The defendant was serving a life sentence, not a term of years. Although it is true that statutory good time is received as soon as a prisoner begins serving his sentence, see Burno v. Commissioner of Correction, 399 Mass. 111, 114 (1987), the defendant never began serving a sentence to which statutory good time applies.
Nor has the defendant served any time in prison on the manslaughter charge. Since the time he pleaded guilty to manslaughter, he has been serving only a suspended sentence. A defendant receives no statutory good time on a suspended sentence, as such good time is “available only for the portion of the sentence actually served in confinement.” Id., citing Hennessy v. Superintendent, Mass. Correctional Inst., Framingham, 386 Mass. 848, 856 (1982).
Should the defendant be remanded as a result of his probation violation, he would then be serving a sentence to which good time applies. However, the defendant would receive statutory good time only on the portion of his sentence then imposed, i.e., the portion he would be serving. See id.5
The defendant’s sentence did not exceed the maximum term for manslaughter, see G. L. c. 265, § 13, nor did it violate any of the laws of the Commonwealth. In accordance with the plea agreement, the judge imposed a “split” sentence: of a nineteen to twenty year sentence, he sentenced the defendant to 4,570 days to serve, and then gave the defendant credit for 4,570 days served on the murder conviction. The judge suspended the remainder of the sentence for ten years, and put the defendant on a ten-year probationary period.
Such “split” sentences were legal at the time of the defendant’s conviction, the amendment prohibiting the suspension of State prison sentences not taking effect until after the defendant’s murder conviction. See G. L. c. 127, § 133, as appearing in St. 1993, c. 432, § 11. Thus the total sentence, which did not exceed the twenty-year maximum allowed for man*79slaughter, was not illegal. See Commonwealth v. McGuinness, 421 Mass. 472, 475 (1995) (illegal sentence is “one that is not permitted by law for the offense committed”).
The defendant attempts to draw support from the case of Lewis v. Commonwealth, 329 Mass. 445 (1952), where a petitioner successfully appealed from his conviction of armed robbery, and was returned to the Superior Court for resentenc-ing for the lesser offense of larceny. Id. at 446-447. The Lewis case is not inconsistent with our holding today. In that case, we held that the new sentence should include any good time earned under G. L. c. 127, § 129, and that, if “the total time to be deducted exceeds the maximum of such sentence as the court could or would impose for larceny, the petitioner is to be discharged from custody.” Id. at 452. The defendant before us argues that the plea judge should have made the same calculation in his case. However, in the Lewis case, the petitioner had previously been sentenced on a crime that authorized the deduction of good time. Thus, his statutory good time had been earned while he was incarcerated and the trial court simply could apply that time to reduce his maximum sentence. Id. (“[Good time shall be deducted] at the rate at which such time was credited to him . . . according to the length of the sentence ... he was then purportedly serving” [emphasis added]). By contrast, the defendant in this case earned no statutory good time pursuant to his murder conviction. The defendant will receive no statutory good time unless and until he is committed to prison to serve the suspended portion of his sentence, and the statutory good time will be computed on the basis of the sentence he will then be serving.
Conclusion. The Superior Court’s denial of the defendant’s motion challenging his sentence is affirmed.
So ordered.
General Laws c. 127, § 129, was repealed by St. 1993, c. 432, § 10; thus statutory good time is no longer available. Neither party contends that the statute’s repeal affects this case. See note 3, infra.
Rule 30 (a) of the Massachusetts Rules of Criminal Procedure, as appearing in 435 Mass. 1501 (2001), provides:
“Unlawful Restraint. Any person who is imprisoned or whose liberty is restrained pursuant to a criminal conviction may at any time, as of right, file a written motion requesting the trial judge to release him or her or to correct the sentence then being served upon the ground that the confinement or restraint was imposed in violation of the Constitution or laws of the United States or of the Commonwealth of Massachusetts.”
General Laws c. 127, § 129, as amended through St. 1967, c. 379, at the time in question stated in pertinent part:
“The officer in charge of each correctional institution or other place of confinement. . . shall keep a record of each prisoner in his custody whose term of imprisonment is four months or more. Every such prisoner whose record of conduct shows that he has faithfully observed all the rules of his place of confinement, and has not been subjected to punishment, shall be entitled to have the term of his imprisonment reduced by a deduction from the maximum term for which he may be held under his sentence or sentences, which shall be determined as follows: . . . upon a sentence of four or more years, twelve and one half days for each month .... If a prisoner violates any rule of his place *75of confinement, the commissioner of correction . . . shall decide what part, if any, of such good conduct deduction from sentence or sentences shall be forfeited by such violation, and may likewise determine, in the event of the prisoner’s subsequent good conduct, whether any or all of such deduction shall be restored.
“A prisoner in a correctional institution of the commonwealth who is entitled to have the term of his imprisonment reduced shall receive from the commissioner of correction a certificate of discharge and shall be released from the correctional institution in which he has been confined, upon the date which has been determined by such deductions from the maximum term of his sentence . . . .”
Although the exact figures would have to be computed by the Department of Correction, see G. L. c. 127, § 129, the defendant’s theory presumably would yield the following: the maximum sentence for manslaughter of twenty years multiplied by 365 days equals 7,300 days in prison. His statutory good time would be 12.5 days a month multiplied by twelve months multiplied by twenty years equals 3,000 days of statutory good time. Seven thousand three hundred days under the maximum sentence minus 3,000 days of good time equals 4,300 days to serve. He has already served 4,570 days.
This is not an ex post facto application of the sentencing provisions. All we do today is enforce the sentencing statutes as they existed at the time of the defendant’s conviction.