From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pz0-f43.google.com ([209.85.210.43]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbWbU-0007Pz-WD for linux-mtd@lists.infradead.org; Tue, 28 Jun 2011 11:37:17 +0000 Received: by pzk1 with SMTP id 1so82836pzk.16 for ; Tue, 28 Jun 2011 04:37:13 -0700 (PDT) Subject: Re: [Ubifs] Reboot -> "recovery needed"? From: Artem Bityutskiy To: Gilles Date: Tue, 28 Jun 2011 14:38:04 +0300 In-Reply-To: References: <1rhb079etc7nr1tasfal6eag1d6lmfhd73@4ax.com> <1309246418.23597.31.camel@sauron> <45ej07pjslh20fb66illqsmn9r0au0fejb@4ax.com> <1309260162.23597.66.camel@sauron> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Message-ID: <1309261088.23597.68.camel@sauron> Mime-Version: 1.0 Cc: linux-mtd@lists.infradead.org Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2011-06-28 at 13:25 +0200, Gilles wrote: > On Tue, 28 Jun 2011 14:22:38 +0300, Artem Bityutskiy > wrote: > >> Thanks for the info. I'll see if I can edit the source code to > >> "reboot" to unmount the root filesystem, or replace "reboot" with > >> another application or script. > > > >I think it may be enough to re-mount read-only, and probably it is > >impossible to unmount in many cases. But I am not 100% sure. > > So I could rename "reboot" something else, then write a shell script > named "reboot" that will first remount the Ubifs partition ro, and > then call the real "reboot"? I think it is not that simple - if there is any file open for writing - remount will fail with EBUSY. So you'd first need to shut down apps, then do that. You should probably refer standard boot scripts to see what they do. On the other hand, as long as your reboot command runs sync, it is harmless to not unmount UBIFS. -- Best Regards, Artem Bityutskiy