מגילה כ״ו ב:ט״ז
And Rava said: A Torah scroll that became worn out is interred and buried next to a Torah scholar, and in this regard, a Torah scholar is defined even as one who only studies the halakhot in the Mishna and the baraitot but is not proficient in their analysis. Rav Aḥa bar Ya’akov said: And when it is buried, it is first placed in an earthenware vessel, as it is stated: “And put them in an earthenware vessel, that they may last for many days” (Jeremiah 32:14).
וְאָמַר רָבָא: סֵפֶר תּוֹרָה שֶׁבָּלָה — גּוֹנְזִין אוֹתוֹ אֵצֶל תַּלְמִיד חָכָם, וַאֲפִילּוּ שׁוֹנֶה הֲלָכוֹת. אָמַר רַב אַחָא בַּר יַעֲקֹב: וּבִכְלִי חֶרֶס, שֶׁנֶּאֱמַר: ״וּנְתַתָּם בִּכְלִי חָרֶשׂ לְמַעַן יַעַמְדוּ יָמִים רַבִּים״.
משנה תורה, הלכות תפילין ומזוזה וספר תורה י׳:ג׳
A Torah scroll that has become worn or disqualified should be placed in an earthenware container and buried next to a Torah sage. This is the manner in which it should be entombed.
The mantle of a scroll that has become worn should be used to make shrouds for a corpse that has no one to bury it. This is the manner in which it should be entombed.
The mantle of a scroll that has become worn should be used to make shrouds for a corpse that has no one to bury it. This is the manner in which it should be entombed.
סֵפֶר תּוֹרָה שֶׁבָּלָה אוֹ שֶׁנִּפְסַל נוֹתְנִין אוֹתוֹ בִּכְלִי חֶרֶשׂ וְקוֹבְרִין אוֹתוֹ אֵצֶל תַּלְמִידֵי חֲכָמִים וְזוֹ הִיא גְּנִיזָתוֹ. מִטְפְּחוֹת סְפָרִים שֶׁבָּלוּ עוֹשִׂין אוֹתָן תַּכְרִיכִין לְמֵת מִצְוָה וְזוֹ הִיא גְּנִיזָתָן:
שולחן ערוך, אורח חיים קנ״ד:ה׳
[Regarding] a Torah scroll that became worn out - we place into an earthenware vessel and bury it in the grave of a Torah scholar; even one who only studies the laws and has not served under [higher level] Torah scholars.
ספר תורה שבלה מניחין אותו בכלי חרס וגונזין אותו בקבר ת"ח אפי' אינו אלא שונה הלכות ולא שימש ת"ח:
שולחן ערוך, יורה דעה רפ״ב:י׳
A Sefer Torah that wore out or became invalid- we place it in an earthenware container and bury it next to a wise sage, and this is its proper Geniza ("hiding away").
ספר תורה שבלה או נפסל נותנין אותו בכלי חרס וקוברין אותו אצל ת"ח וזו היא גניזתו: