unionfs


 

Union-FS

Union-FS (unionctl, unionfs.o) is a linux kernel module "which can appear to merge the contents of several directories (branches), while keeping their physical content separate".

Version: 1.0.14

Status: Done

 

 



 

Description

If you don't know what unionfs is and how to use it, please read the basics or go to the unionfs official page.

 

On MG35, unionfs is a very useful tool in development: it is possible to overlay a writeable filesystem from a disk (or even on a server) on top of the read-only filesystem provided by the firmware in flash (cramfs). As an example, if you unionfs /usr/bin (from the hdd) over /bin (from the flash cramfs) you can "overwrite" the built-in binaries with user-provided ones, without the need to create a new cramfs and reflash.Unionfs can also be very useful in "normal" usage, particularly with the package management system.

 

Usage

The unionfs driver must be loaded before attempting to create any union mounts. To load the driver, execute the following command:

 

 

/sbin/insmod /usr/lib/modules/2.4.17-uc0/unionfs.o

using /usr/lib/modules/2.4.17-uc0/unionfs.o

 

After successfully loading the module, you can remount directories in stacks. To make your /etc writable with a ram overlay, try:

 

 

mkdir -p /mnt/etc

mount -t ramfs none /mnt/etc

mount -t unionfs none -o dirs=/mnt/etc=rw:/etc=ro /etc

 

To add or change files in /bin, you could use:

 

 

mkdir -p /usr/rootbin

cp /usr/mytest/dvdplayer.bin /usr/rootbin

mount -t unionfs none -o dirs=/usr/rootbin=rw:/bin=ro /bin

 

Examples

To add files in /usr/bin to /bin, extending the number of available commands or overwriting the built-in ones, you could use:

 

 

mount -t unionfs none -o dirs=/usr/bin=rw:/bin=ro /bin

 

For skinning, you could use mount a hdd directory over /img:

 

 

mount -t unionfs none -o dirs=/usr/img=rw:/img=ro /img

 

History

Version 1.0.14 - [John, 2008-04]