Hi all,
Does anyone know if it's possible to overwrite a mounted filesystem with another filesystem without having to umount or reboot?
I'm busy building a tool which allows us to remotely update all software (inc. kernel) on a single board computer at once. The SBC has a motorola
85000 cpu, 4-16mb flash and 4-16mb ram. The SBC has its root filesystem on the flash. The QSLinux flash drivers allow us to overwrite the filesystem by writing to /dev/flash0. We tested this and it works. The problem is we also need to access this new filesystem so we can save some configuration files before rebooting. Unfortunally I can't get that to work.
I've build a static daemon which kill's all other processes, remounts root read-only and receives the new filesystem image over the network. After overwriting the currect filesystem I use the ioctl BLKFLSBUF and BLKRRPART to flush all buffers and re-read the partition table. Remounting /dev/ftla read-write on / works and I can list the new filesystem. Accessing and creating files however results in corruption.
I think the problem is some kind of filesystem cache, maybe a cache in the VFS layer. Does anybody here knows what could be wrong or give me some pointers where to look?
thanks in advance, Wolter Kamphuis