4.14. Mounting File Systems: mount and umountA super-user may extend the file system by using the mount utility (Figure 4-30).
In the following example, I spliced the file system contained on the "/dev/dsk2" device onto the "/usr" directory. Notice that before I performed the mount, the "/usr" directory was empty; after the mount, the files stored on the "/dev/dsk2" device appeared inside this directory. $ mount ...list the currently mounted devices. /dev/dsk1 on / type ext2 (rw) $ ls /usr .../usr is currently empty. $ mount /dev/dsk2 /usr ...mount the /dev/dsk2 device. $ mount ...list the currently mounted devices. /dev/dsk1 on / type ext2 (rw) /dev/dsk2 on /usr type ext2 (rw) $ ls /usr ...list the contents of the mounted device. bin/ etc/ include/ lost+found/ src/ ucb/ demo/ games/ lib/ pub/ sys/ ucblib/ dict/ hosts/ local/ spool/ tmp/ $ _ To unmount a device, use the umount utility. In the following example, I unmounted the "/dev/dsk2" device and then listed the "/usr" directory. The files were no longer accessible. $ umount /dev/dsk2 ...unmount the device. $ mount ...list the currently mounted devices. /dev/dsk1 on / type ext2 (rw) $ ls /usr ...note that /usr is empty again. $ _ |