Mounting and Unmounting File Systems (System Administration Guide, Volume 1) (2024)

Before you can access the files on a file system, you need to mountthe file system. Mounting a file system attaches that file system to a directory(mount point) and makes it available to the system. Theroot (/) file system is always mounted. Any other filesystem can be connected or disconnected from the root (/)file system.

When you mount a file system, any files or directories in the underlyingmount point directory are unavailable as long as the file system is mounted.These files are not permanently affected by the mounting process, and theybecome available again when the file system is unmounted. However, mountdirectories are typically empty, because you usually do not want to obscureexisting files.

For example, the figure below shows a local file system, starting witha root (/) file system and subdirectories sbin, etc, and opt.

Figure 34-1 Sample root (/) File System

Mounting and Unmounting File Systems (System Administration Guide, Volume 1) (1)

Now, say you wanted to access a local file system from the /opt file system that contains a set of unbundled products.

First, you must create a directory to use as a mount point for the filesystem you want to mount, for example, /opt/unbundled.Once the mount point is created, you can mount the file system (by using the mount command), which makes all of the files and directories in /opt/unbundled available, as shown in the figure below. See Chapter36, Mounting and Unmounting File Systems (Tasks) for detailed instructions on how to perform thesetasks.

Figure 34-2 Mounting a File System

Mounting and Unmounting File Systems (System Administration Guide, Volume 1) (2)

The Mounted File System Table

Whenever you mount or unmount a file system, the /etc/mnttab (mount table) file is modified with the list of currently mountedfile systems. You can display the contents of this file with the cat or more commands, but you cannot edit it.Here is an example of an /etc/mnttab file:


$ more /etc/mnttab/dev/dsk/c0t0d0s0 / ufs rw,intr,largefiles,onerror=panic,suid,dev=2200000 938557523/proc /proc proc dev=3180000 938557522fd /dev/fd fd rw,suid,dev=3240000 938557524mnttab /etc/mnttab mntfs dev=3340000 938557526swap /var/run tmpfs dev=1 938557526swap /tmp tmpfs dev=2 938557529/dev/dsk/c0t0d0s7 /export/home ufs rw,intr,largefiles,onerror=panic,suid,dev=2200007 938557529$

The Virtual File System Table

It would be a very time-consuming and error-prone task to manually mountfile systems every time you wanted to access them. To fix this, the virtual file system table(the /etc/vstab file) was created to maintain a listof file systems and how to mount them. The /etc/vfstabfile provides two important features: you can specify file systems to automaticallymount when the system boots, and you can mount file systems by using onlythe mount point name, because the /etc/vfstab file containsthe mapping between the mount point and the actual device slice name.

A default /etc/vfstab file is created when youinstall a system depending on the selections you make when installing systemsoftware; however, you can edit the /etc/vfstab fileon a system whenever you want. To add an entry, the main information you needto specify is the device where the file system resides, the name of the mountpoint, the type of the file system, whether you want it to mount automaticallywhen the system boots (by using the mountall command),and any mount options.

The following is an example of an /etc/vfstab file.Comment lines begin with #. This example shows an /etc/vfstab file for a system with two disks (c0t0d0and c0t3d0).


$ more /etc/vfstab#device device mount FS fsck mount mount#to mount to fsck point type pass at boot options/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -/proc - /proc proc - no -/dev/dsk/c0t0d0s1 - - swap - no -swap - /tmp tmpfs - yes -/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 2 no -/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /test ufs 2 yes -$

In the above example, the last entry specifies that a UFS file systemon the /dev/dsk/c0t3d0s7 slice will be automaticallymounted on the /test mount point when the system boots.Note that, for root (/) and /usr,the mount at boot field value is specified as no, because these file systems are mounted by the kernel as partof the boot sequence before the mountall command is run.

See Chapter36, Mounting and Unmounting File Systems (Tasks) for descriptions of each of the /etc/vfstab fields and information on how to edit and use the file.

The NFS Environment

NFS is a distributed file system service that can be used to share resources (files or directories) from one system, typically a server,with other systems across the network. For example, you might want to sharethird-party applications or source files with users on other systems.

NFS makes the actual physical location of the resource irrelevant tothe user. Instead of placing copies of commonly used files on every system,NFS allows you to place one copy on one system's disk and let all other systemsaccess it across the network. Under NFS, remote files are virtually indistinguishablefrom local ones.

A system becomes an NFS server if it has resources to share over thenetwork. A server keeps a list of currently shared resources and their accessrestrictions (such as read/write or read-only).

When you share a resource, you make it available for mounting by remotesystems.

You can share a resource in these ways:

  • By using the share or shareall command

  • By adding an entry to the /etc/dfs/dfstab (distributed file system table) file and rebooting the system

See Chapter36, Mounting and Unmounting File Systems (Tasks) for information on how to share resources.See System AdministrationGuide, Volume 3 for a complete description of NFS.

AutoFS

You can mount NFS file system resources by using a client-side servicecalled automounting (or AutoFS), which enables a system to automatically mountand unmount NFS resources whenever you access them. The resource remains mountedas long as you remain in the directory and are using a file. If the resourceis not accessed for a certain period of time, it is automatically unmounted.

AutoFS provides the following features:

  • NFS resources don't need to be mounted when the system boots,which saves booting time.

  • Users don't need to know the root password to mountand unmount NFS resources.

  • Network traffic might be reduced, since NFS resourcesare only mounted when they are in use.

The AutoFS service is initialized by automount, whichis run automatically when a system is booted. The automount daemon, automountd, runs continuously and is responsible for the mountingand unmounting of the NFS file systems on an as-needed basis. By default,the Solaris operating environment automounts /home.

AutoFS works with file systems specified in the name service. This informationcan be maintained in NIS, NIS+, or local /etc files.With AutoFS, you can specify multiple servers to provide the same file system.This way, if one of the servers is down, AutoFS can try to mount from anothermachine. You can specify which servers are preferred for each resource inthe maps by assigning each server a weighting factor.

See System AdministrationGuide, Volume 3 for complete information on how to setup and administer AutoFS.

The Cache File System (CacheFS)

If you want to improve the performance and scalability of an NFS orCD-ROM file system, you should use the Cache File System (CacheFS). CacheFSis a general purpose file system caching mechanism that improves NFS serverperformance and scalability by reducing server and network load.

Designed as a layered file system, CacheFS provides the ability to cacheone file system on another. In an NFS environment, CacheFS increases the clientper server ratio, reduces server and network loads, and improves performancefor clients on slow links, such as Point-to-Point Protocol (PPP). You canalso combine CacheFS with the AutoFS service to help boost performance andscalability.

See Chapter37, The Cache File System (Tasks) for detailed information aboutCacheFS.

Deciding How to Mount File Systems

The table below provides guidelines on mounting file systems based onhow you use them.

Table 34-3 Determining How to Mount File Systems

If You Need to Mount ...

Then You Should Use ...

Local or remote file systems infrequently

The mountcommand entered manually from the command line.

Local file systems frequently

The /etc/vfstab file, which will mount the file system automatically when thesystem is booted in multi-user state.

Remote file systems frequently,such as home directories

  • The /etc/vfstab file, which will automaticallymount the file system when the system is booted in multi-user state.

  • AutoFS, which will automatically mount or unmountthe file system when you change into (mount) or out of (unmount) the directory.

To enhance performance, you can also cachethe remote file systems by using CacheFS.

You can mount a CD-ROM containing a file system by simply insertingit into the drive (Volume Management will automatically mount it). You canmount a diskette containing a file system by inserting it into the drive andrunning the volcheck command. See Chapter14, Guidelines for Using CDs and Diskettes (Overview)for more information.

Mounting and Unmounting File Systems (System Administration Guide, Volume 1) (2024)

FAQs

What is mounting and unmounting of file systems? ›

When you mount a file system, any files or directories in the underlying mount point directory are unavailable as long as the file system is mounted. These files are not permanently affected by the mounting process, and they become available again when the file system is unmounted.

How to mount and unmount? ›

Mount and umount commands are very handy in this case. In this article, we will learn these two commands. In short, using mount command we can mount a file system into a directory and using umount command we can umount the same file system from that directory. These can be done for hard disk and USB drive also.

What is mounting and unmounting a drive? ›

An unmounted storage disk is still physically connected to a computer and powered on, but the computer cannot read or write data to it. It is the opposite of mounting a disk, which activates the disk volume and makes its contents available to the computer's operating system.

How to unmount a file system forcefully in Linux? ›

Options in unmount Command in Linux

-f: Force unmount (in case of an unreachable NFS system). This command forces the unmount of /mnt/my_nfs even if the network file system (NFS) is unreachable. -v: Verbose mode.

What does mount and unmount mean in disk Utility? ›

Mounting a volume means putting it somewhere in the file system so that it's data becomes available. For example, mounting a flash volume named MyFlash usually creates to a folder named /media/MyFlash from which it's contents can be accessed. Unmounting it means making it's data unavailable through the file system.

How do I permanently mount a file system? ›

You can mount file systems for a single session using the mount command, and permanently by editing /etc/fstab . Mounting needs to be done by an administrator, either by logging in as root or by using the sudo command. There are some cases where mounting is done automatically, like when you insert a USB flash drive.

Does unmount mean delete? ›

When you have unmounted a RAM disk, the content is deleted and the memory is released. The operating system powers off USB devices after unmounting them.

What does it mean to mount a filesystem? ›

Mounting makes file systems, files, directories, devices, and special files available for use at a particular location. It is the only way a file system is made accessible. The mount command instructs the operating system to attach a file system at a specified directory.

Is it safe to unmount? ›

Unmounting in computing refers to the process of detaching a storage device or filesystem from the operating system, making it safe for removal. This ensures that no data is being read from or written to the device, reducing the risk of data corruption or loss.

What happens if you dismount a volume? ›

Unmounting a volume makes its filesystem inaccessible to its Droplet's operating system. This means the OS can't write to or read from the volume. You should unmount volumes before resizing or detaching them to protect data integrity.

How do I disable drive mounting? ›

Disable the "Automatically mount new volumes" option in Disk Management (Windows): Open Disk Management (right-click on the Start button and select Disk Management). Right-click on the USB drive and select "Change Drive Letter and Paths". Select the drive letter and click on "Remove".

Why does my SD card keeps mounting and unmounting? ›

Fix 1.

Sometimes, it is the mobile phone or digital camera hardware failure that causes SD cards to be unreadable, showing the "unexpectedly removed" error. For Android phone users, you can unmount an SD card on your phone and then mount it again after rebooting your smartphone.

What happens when you unmount a file system? ›

The unmounting of a file system removes it from the file system mount point, and deletes the entry from the /etc/mnttab file.

What is file mount and unmount system calls? ›

Mounting makes file systems, files, directories, devices and special files available for use and available to the user. Its counterpart umount instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible and may be removed from the computer.

Which command is used to unmount a filesystem? ›

The umount command unmounts a previously mounted device, directory, file, or file system. Processing on the file system, directory, or file completes and it is unmounted. Members of the system group and users operating with root user authority can issue any umount command.

What is the difference between mount and unmount? ›

Mounted parts are assembled, while unmounted are separated from any machine or installation. When talking about mounted or unmounted parts, we refer to whether they're assembled to the machine they belong to (mounted) when the part search takes place.

What is mounting updating and unmounting? ›

The Mounting Phase begins when a component is first created and inserted into the DOM. The Updating Phase occurs when a component's state or props change. And the Unmounting Phase occurs when a component is removed from the DOM.

What is unmounting in operating system? ›

Unmounting in computing refers to the process of detaching a storage device or filesystem from the operating system, making it safe for removal. This ensures that no data is being read from or written to the device, reducing the risk of data corruption or loss.

Top Articles
Construction In Progress Accounting | eSUB Cloud
Baby Bee Songs, Albums, Reviews, Bio & More | ... | AllMusic
5 Bijwerkingen van zwemmen in een zwembad met te veel chloor - Bereik uw gezondheidsdoelen met praktische hulpmiddelen voor eten en fitness, deskundige bronnen en een betrokken gemeenschap.
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
Cvs Devoted Catalog
True Statement About A Crown Dependency Crossword
Florida (FL) Powerball - Winning Numbers & Results
Used Wood Cook Stoves For Sale Craigslist
Nonuclub
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Nebraska Furniture Tables
Classic Lotto Payout Calculator
Stihl Km 131 R Parts Diagram
Viha Email Login
Grayling Purnell Net Worth
Epguides Strange New Worlds
Skip The Games Fairbanks Alaska
Craigslist Pearl Ms
Is Windbound Multiplayer
Joan M. Wallace - Baker Swan Funeral Home
Yosemite Sam Hood Ornament
Play It Again Sports Norman Photos
Avatar: The Way Of Water Showtimes Near Maya Pittsburg Cinemas
Craigslist Hunting Land For Lease In Ga
800-695-2780
UCLA Study Abroad | International Education Office
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Wonder Film Wiki
Is Henry Dicarlo Leaving Ktla
How do you get noble pursuit?
30+ useful Dutch apps for new expats in the Netherlands
Askhistorians Book List
Ringcentral Background
Desales Field Hockey Schedule
Moonrise Time Tonight Near Me
Smayperu
new haven free stuff - craigslist
Craigslist Lakeside Az
Skip The Games Grand Rapids Mi
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
Pulaski County Ky Mugshots Busted Newspaper
Pink Runtz Strain, The Ultimate Guide
How Big Is 776 000 Acres On A Map
Bekkenpijn: oorzaken en symptomen van pijn in het bekken
Noga Funeral Home Obituaries
El Patron Menu Bardstown Ky
Goosetown Communications Guilford Ct
Kenmore Coldspot Model 106 Light Bulb Replacement
Noelleleyva Leaks
Vrca File Converter
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5478

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.