2

I have 3 embedded CPU system running Linux 2.6.37, which are connected via Ethernet. Each CPU has its own NAND flash memory. One of them is "main" CPU number 0, while 2 others are his companions. I want all three to run from the same root file system residing on the CPU0 to avoid tripling of possible updates/changes in RootFS files.

For this I wanted to export the '/' (root file system) via NFS on CPU0, while CPU1 & CPU2 will boot up from CPU0 via NFS (nfsroot).

But this seems to not work - any attempt to export the '/' fails with the message : exportfs: / does not support NFS export

Are there any principle limitations on exporting '/'? If yes, any ideas what can be done to reach the goal? Thanks a lot ahead.

Addition/Update:

  1. Each CPU knows its number, the boot loader (u-boot) will put correct parameters into Linux command line to boot from NAND(CPU0) or from NFS(CPU1-2). The same way CPU0 will start the NFS server, while CPU1-2 will not.

  2. There is no need in "private" files, as in any case the root file system is mounted read-only also today. Just each CPUx has its own private NAND, while I want to eliminate this.

  3. This is not the same as "diskless" case, because in diskless case some SUBDIRECTORY is exported as root FS, while in my case all the root FS must be exported.

  4. I should note that exporting of any subdirectory from NAND works fine (I at least tried several). Just exporting '/' fails.

  • what you are looking for is a server (CPU0) and two diskless stations (CPU1 & CPU2), du to locking and concurrent access each system must have, at least, some private files, while /usr can be shared among many hosts. – Archemar Apr 20 '17 at 12:10
0

If the CPUs would share the whole root file system, this would include all configurations, including for example the nfs configuration. How would they know they are main or companion?

One approach would be to create partitions on the flash for the biggest directories (find out with du -sm /*|sort -n) and mount those from the companions if possible (you can do with /home or /usr, but not with /etc).

But while the system is still in development, you may not know how much space you will need on each partition, so it may be better to have only a small /root partition and one big other partition like /shared, which can be mounted. You will then have to create symbolic links like ln -s /shared/home /home. But make sure you don't brick your system! If you try to move /bin to the shared partition, /bin/mount will not be found on boot.

|improve this answer|||||
0

Non-recursively bind-mount the root directory elsewhere, e.g. /srv/nfs/root:

mount --bind / /srv/nfs/root

Then export /srv/nfs/root.

Don't do a recursive bind (--rbind) or else directories such as /proc, /sys and /dev will also be exported.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.