In partition proceedings the court may order the commissioners to sell and convey the whole or any part of the land which cannot be divided advantageously, upon such terms and conditions and with such securities for the proceeds of the sale as the court may order, and to distribute the proceeds so as to make the partition just and equal. The sale shall be made by public auction, after like notice as is required for the sale of land by an administrator, and the evidence thereof may be perpetuated in like manner by returns filed with the court in which the proceedings are had; or the sale may be a private sale, upon the terms as the court orders, if it finds after notice, as provided in section 8, and a hearing, or after receiving the written assent of all parties in interest, that the interests of all parties will be promoted thereby. If the sale is by auction, section nineteen of chapter two hundred and four shall apply thereto.
Mass. Gen. Laws ch. 241, § 31