From: Wolter Kamphuis Subject: Overwrite mounted filesystem Date: Mon, 22 Sep 2003 12:21:31 +0200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <3F6ECD2B.4000203@wkamphuis.student.utwente.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7BIT Return-path: Received: from smtp05.wxs.nl ([195.121.6.57]:19611 "EHLO smtp05.wxs.nl") by vger.kernel.org with ESMTP id S263071AbTIVKaf (ORCPT ); Mon, 22 Sep 2003 06:30:35 -0400 Received: from wkamphuis.student.utwente.nl (ip3e833697.speed.planet.nl [62.131.54.151]) by smtp05.wxs.nl (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with ESMTP id <0HLM0006B23ZD0@smtp05.wxs.nl> for linux-fsdevel@vger.kernel.org; Mon, 22 Sep 2003 12:21:35 +0200 (MEST) To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi all, Does anyone know if it's possible to overwrite a mounted filesystem with another filesystem (both ext2) without having to umount or reboot? I've build a static daemon which kill's all other processes, remounts root read-only and overwrites it with a new filesystem image, received over the network, stored in memory. After overwriting the currect filesystem I use ioctl BLKFLSBUF and BLKRRPART to flush all buffers and re-read the partition table. Remounting the root-fs read-write works and I can list the new filesystem. Accessing and creating files however results in fs-corruption. I need to place a few files on this new filesystem before rebooting, for example the passwd file. I think the problem is some kind of filesystem cache, maybe a cache in the VFS layer. Does anybody here know what could be wrong or give me some pointers where to look? thanks in advance, Wolter Kamphuis btw, I'm building this tool for a embedded system, a motorola mpc850 cpu, 4-16mb ram and 4-16mb flash. The root-fs is placed on the flash. We use a modified 2.2.5 linux kernel.