Default style (Cherry Eve). Switch styles (Capricorn). XML Feed Calendar
All | General | Programming | Shell
20040712 Monday July 12, 2004



July 12, 2004 10:41 AM IST Permalink

Overlay mountpoints

Generally when you mount a file system at a certain point, it prohibits you from mounting other file systems to that point. This is normally not a problem, as you should normally never need to mount another resource over the previous mount point. However there can be times that this is your only option - for example replacing a device with a new one.
To Accomplish this we use the overlay (-O) option to mount. For example we have a mount point /opt/silly, containing a local device and it's corresponding data:

# df -h /opt/silly
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c7t0d0s0       22G   9.8G    12G    47%    /opt/silly
if we try to mount another file system at this point:
# mount trex:/export/web /opt/silly
nfs mount: mount: /opt/silly: Device busy
but we can add the -O flag:
# mount -O trex:/export/web /opt/silly
#
and then:
# df -h /opt/silly
Filesystem             size   used  avail capacity  Mounted on
trex:/export/web       8.1G   6.9G   1.0G    87%    /opt/silly
But there are actually two file systems mounted there:
# grep opt/silly /etc/mnttab
/dev/dsk/c7t0d0s0       /opt/silly      ufs     rw,intr,largefiles,logging,xattr,onerror=panic,dev=8002d0       1089624975
trex:/export/web        /opt/silly      nfs     rw,xattr,dev=44000ae    1089625076
July 12, 2004 10:39 AM IST Permalink