MNTENT(5) UNIX Programmer’S Manual MNTENT(5)

Total Page:16

File Type:pdf, Size:1020Kb

MNTENT(5) UNIX Programmer’S Manual MNTENT(5) MNTENT(5) UNIX Programmer’s Manual MNTENT(5) NAME mntent, fstab - static information about filesystems SYNOPSIS #include <mntent.h> DESCRIPTION NOTE: Unless NetInfo is disabled, /etc/fstab is accessed only at boot time, when it’s used to mount all file systems of type 4.3. The file /etc/fstab describes the file systems and swapping partitions used by the local machine. It is created by the system administrator using a text editor, and processed by commands which mount, unmount, check consistency of, dump and restore file systems, and by the system in providing swap space. It consists of a number of lines of the form: fsname dir type opts freq passno an example of which would be: /dev/xy0a / 4.3 rw,noquota 1 2 The entries in this file are accessed using the routines in getmntent(3), which returns a structure of the following form: struct mntent { char *mnt_fsname; /* file system name */ char *mnt_dir; /* file system path prefix */ char *mnt_type; /* 4.3, nfs, dos, macintosh, cfs, or ignore */ char *mnt_opts; /* ro, etc. */ int mnt_freq; /* dump frequency, in days */ int mnt_passno; /* pass number on parallel fsck */ }; There is one entry per line in the file, and the fields are separated by white space. A ‘‘#’’ as the first non-white character indicates a comment. The mnt_opts field consists of a string of comma separated options. Some of the options are common to all filesystem types, and others only make sense for a single filesystem type. It is important to specify that a removable filesys- tem (such as floppy disk) is removable, or ro if a filesys- tem is read-only. See mount(8) for a more complete descrip- tion of the options available. The mnt_type field determines how the mnt_fsname, and mnt_opts fields will be interpreted. Below is a list of the file system types currently supported and the way each of them interprets these fields. See /NextDeveloper/Headers/bsd/mntent.h for additional, though unsupported, file system types. 4.3 mnt_fsname Must be a block special device. mnt_opts Valid opts are: ro, rw, suid, nosuid. nfs mnt_fsname servername:volumename to be mounted mnt_opts Valid opts are: ro, rw, nosuid, hard, soft, bg, fg, retry, rsize, wsize, timeo, retrans, port, intr, net, secure, grpid, nosub, multi, acregmin, acregmax, noac, acdirmin, acdirmax. dos mnt_fsname Must be a raw device. mnt_opts Ignored. NOTE: This file system does not support SCSI hard disks, CD-ROMs, or 2.88 MB floppies; it supports only 720KB and 1.4 MB floppies. To mount a dos volume, the appropriate loadable kernel server must already be loaded into the system. macintosh mnt_fsname Must be a raw device. mnt_opts Ignored. NOTE: To mount a macintosh volume, the appropriate loadable kernel server must already be loaded into the system. cfs (CD-ROM file system) mnt_fsname Must be a raw device. mnt_opts Ignored. NOTE: To mount a cfs volume, the appropriate loadable kernel server must already be loaded into the system. If the mnt_type is specified as ‘‘ignore’’ the entry is ignored. This is useful to show disk partitions which are currently not used. Disks that are specified as as ‘‘ignore’’ are also not automounted by the Workspace in NEXTSTEP. This is useful when your disk has data in a for- mat that NEXTSTEP doesn’t recognize, and you want it to ignore the disk. The field mnt_freq indicates how often each partition should be dumped by the dump(8) command (and triggers that command’s w option which tells which file systems should be dumped). Most systems set the mnt_freq field to 1, indicating that the file systems are dumped each day. The final field mnt_passno is used by the disk consistency check program fsck(8) to allow overlapped checking of file systems during a reboot. All file systems with mnt_passno of 1 are first checked simultaneously, then all file systems with mnt_passno of 2, and so on. It is usual to make the mnt_passno of the root file system have the value 1, and then check one file system on each available disk drive in each subsequent pass to the exhaustion of file system parti- tions. /etc/fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. The order of records in /etc/fstab is important because fsck, mount, and umount process the file sequentially; file systems must appear after file systems they are mounted within. FILES /etc/fstab SEE ALSO fsck(8), getmntent(3), mount(8), quotacheck(8), quotaon(8), umount(8).
Recommended publications
  • CST8207 – Linux O/S I
    Mounting a Filesystem Directory Structure Fstab Mount command CST8207 - Algonquin College 2 Chapter 12: page 467 - 496 CST8207 - Algonquin College 3 The mount utility connects filesystems to the Linux directory hierarchy. The mount point is a directory in the local filesystem where you can access mounted filesystem. This directory must exist before you can mount a filesystem. All filesystems visible on the system exist as a mounted filesystem someplace below the root (/) directory CST8207 - Algonquin College 4 can be mounted manually ◦ can be listed in /etc/fstab, but not necessary ◦ all mounting information supplied manually at command line by user or administrator can be mounted automatically on startup ◦ must be listed /etc/fstab, with all appropriate information and options required Every filesystem, drive, storage device is listed as a mounted filesystem associated to a directory someplace under the root (/) directory CST8207 - Algonquin College 5 CST8207 - Algonquin College 6 Benefits Scalable ◦ As new drives are added and new partitions are created, further filesystems can be mounted at various mount points as required. ◦ This means a Linux system does not need to worry about running out of disk space. Transparent ◦ No application would stop working if transferred to a different partition, because access to data is done via the mount point. ◦ Also transparent to user CST8207 - Algonquin College 7 All known filesystems volumes are typically listed in the /etc/fstab (static information about filesystem) file to help automate the mounting process If it is not listed in the /etc/fstab file, then all appropriate information about the filesystem needs to be listed manually at the command line.
    [Show full text]
  • File System, Files, and *Tab /Etc/Fstab
    File system, files, and *tab File system files directories volumes, file systems mounting points local versus networked file systems 1 /etc/fstab Specifies what is to be mounted where and how fs_spec: describes block special device for remote filesystem to be mounted fs_file: describes the mount point fs_vfstype: describes the type of file system fs_mntops: describes the mount options associated with the filesystem 2 /etc/fstab cont. fs_freq: used by the dump command fs_passno: used by fsck to determine the order in which checks are done at boot time. Root file systems should be specified as 1, others should be 2. Value 0 means that file system does not need to be checked 3 /etc/fstab 4 from blocks to mounting points metadata inodes directories superblocks 5 mounting file systems mounting e.g., mount -a unmounting manually or during shutdown umount 6 /etc/mtab see what is mounted 7 Network File System Access file system (FS) over a network looks like a local file system to user e.g. mount user FS rather than duplicating it (which would be a disaster) Developed by Sun Microsystems (mid 80s) history for NFS: NFS, NFSv2, NFSv3, NFSv4 RFC 3530 (from 2003) take a look to see what these RFCs are like!) 8 Network File System How does this actually work? server needs to export the system client needs to mount the system server: /etc/exports file client: /etc/fstab file 9 Network File System Security concerns UID GID What problems could arise? 10 Network File System example from our raid system (what is a RAID again?) Example of exports file from
    [Show full text]
  • The Linux Command Line
    The Linux Command Line Fifth Internet Edition William Shotts A LinuxCommand.org Book Copyright ©2008-2019, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042. A version of this book is also available in printed form, published by No Starch Press. Copies may be purchased wherever fine books are sold. No Starch Press also offers elec- tronic formats for popular e-readers. They can be reached at: https://www.nostarch.com. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. Release History Version Date Description 19.01A January 28, 2019 Fifth Internet Edition (Corrected TOC) 19.01 January 17, 2019 Fifth Internet Edition. 17.10 October 19, 2017 Fourth Internet Edition. 16.07 July 28, 2016 Third Internet Edition. 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. Table of Contents Introduction....................................................................................................xvi Why Use the Command Line?......................................................................................xvi
    [Show full text]
  • Filesystem Hierarchy Standard
    Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Version 3.0 Publication date March 19, 2015 Copyright © 2015 The Linux Foundation Copyright © 1994-2004 Daniel Quinlan Copyright © 2001-2004 Paul 'Rusty' Russell Copyright © 2003-2004 Christopher Yeoh Abstract This standard consists of a set of requirements and guidelines for file and directory placement under UNIX-like operating systems. The guidelines are intended to support interoperability of applications, system administration tools, development tools, and scripts as well as greater uniformity of documentation for these systems. All trademarks and copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Permission is granted to make and distribute verbatim copies of this standard provided the copyright and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this standard under the conditions for verbatim copying, provided also that the title page is labeled as modified including a reference to the original standard, provided that information on retrieving the original standard is included, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this standard into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the copyright holder. Dedication This release is dedicated to the memory of Christopher Yeoh, a long-time friend and colleague, and one of the original editors of the FHS.
    [Show full text]
  • Oracle® Linux 7 Managing File Systems
    Oracle® Linux 7 Managing File Systems F32760-07 August 2021 Oracle Legal Notices Copyright © 2020, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract.
    [Show full text]
  • Bash Tutorial
    Bash Shell Lecturer: Prof. Andrzej (AJ) Bieszczad Email: [email protected] Phone: 818-677-4954 Bash Shell The shell of Linux • Linux has a variety of different shells: – Bourne shell (sh), C shell (csh), Korn shell (ksh), TC shell (tcsh), Bour ne Again shell (bash). • Certainly the most popular shell is “bash”. Bash is an sh- compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). • It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. • It offers functional improvements over sh for both programming and interactive use. Bash Shell Programming or Scripting ? • bash is not only an excellent command line shell, but a scripting language in itself. Shell scripting allows us to use the shell's abilities and to automate a lot of tasks that would otherwise require a lot of commands. • Difference between programming and scripting languages: – Programming languages are generally a lot more powerful and a lot faster than scriptin g languages. Programming languages generally start from source code and are compil ed into an executable. This executable is not easily ported into different operating syste ms. – A scripting language also starts from source code, but is not compiled into an executabl e. Rather, an interpreter reads the instructions in the source file and executes each inst ruction. Interpreted programs are generally slower than compiled programs. The main a dvantage is that you can easily port the source file to any operating system. bash is a s cripting language. Other examples of scripting languages are Perl, Lisp, and Tcl.
    [Show full text]
  • Cygwin User's Guide
    Cygwin User’s Guide i Cygwin User’s Guide Cygwin User’s Guide ii Copyright © 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this per- mission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. Cygwin User’s Guide iii Contents 1 Cygwin Overview 1 1.1 What is it? . .1 1.2 Quick Start Guide for those more experienced with Windows . .1 1.3 Quick Start Guide for those more experienced with UNIX . .1 1.4 Are the Cygwin tools free software? . .2 1.5 A brief history of the Cygwin project . .2 1.6 Highlights of Cygwin Functionality . .3 1.6.1 Introduction . .3 1.6.2 Permissions and Security . .3 1.6.3 File Access . .3 1.6.4 Text Mode vs. Binary Mode . .4 1.6.5 ANSI C Library . .5 1.6.6 Process Creation . .5 1.6.6.1 Problems with process creation . .5 1.6.7 Signals . .6 1.6.8 Sockets . .6 1.6.9 Select .
    [Show full text]
  • Nixos: a Purely Functional Linux Distribution
    NixOS: A Purely Functional Linux Distribution Eelco Dolstra Andres Loh¨ Delft University of Technology, The Netherlands Utrecht University, The Netherlands [email protected] [email protected] Abstract change after they have been built; rather, the system is updated to Existing package and system configuration management tools suf- a new configuration by changing the specification and rebuilding fer from an imperative model, where system administration actions the system from it. This allows a system to be built determinis- such as upgrading packages or changes to system configuration tically, and therefore reproducibly. It allows the user to roll back files are stateful: they destructively update the state of the sys- the system to previous configurations, since previous configura- tem. This leads to many problems, such as the inability to roll back tions are not overwritten. Perhaps most importantly, statelessness changes easily, to run multiple versions of a package side-by-side, makes configuration actions predictable: they do not mysteriously to reproduce a configuration deterministically on another machine, fail because of some unknown aspect of the state of the system. or to reliably upgrade a system. In this paper we show that we can We have previously shown how package management — the overcome these problems by moving to a purely functional system installation and management of software packages — can be done configuration model. This means that all static parts of a system in a purely functional way, in contrast to the imperative models (such as software packages, configuration files and system startup of conventional tools such as RPM (Foster-Johnson 2003).
    [Show full text]
  • Freebsd Command Reference
    FreeBSD command reference Command structure Each line you type at the Unix shell consists of a command optionally followed by some arguments , e.g. ls -l /etc/passwd | | | cmd arg1 arg2 Almost all commands are just programs in the filesystem, e.g. "ls" is actually /bin/ls. A few are built- in to the shell. All commands and filenames are case-sensitive. Unless told otherwise, the command will run in the "foreground" - that is, you won't be returned to the shell prompt until it has finished. You can press Ctrl + C to terminate it. Colour code command [args...] Command which shows information command [args...] Command which modifies your current session or system settings, but changes will be lost when you exit your shell or reboot command [args...] Command which permanently affects the state of your system Getting out of trouble ^C (Ctrl-C) Terminate the current command ^U (Ctrl-U) Clear to start of line reset Reset terminal settings. If in xterm, try Ctrl+Middle mouse button stty sane and select "Do Full Reset" exit Exit from the shell logout ESC :q! ENTER Quit from vi without saving Finding documentation man cmd Show manual page for command "cmd". If a page with the same man 5 cmd name exists in multiple sections, you can give the section number, man -a cmd or -a to show pages from all sections. man -k str Search for string"str" in the manual index man hier Description of directory structure cd /usr/share/doc; ls Browse system documentation and examples. Note especially cd /usr/share/examples; ls /usr/share/doc/en/books/handbook/index.html cd /usr/local/share/doc; ls Browse package documentation and examples cd /usr/local/share/examples On the web: www.freebsd.org Includes handbook, searchable mailing list archives System status Alt-F1 ..
    [Show full text]
  • The Linux Command Line
    The Linux Command Line Second Internet Edition William E. Shotts, Jr. A LinuxCommand.org Book Copyright ©2008-2013, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, 171 Second Street, Suite 300, San Fran- cisco, California, 94105, USA. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. This book is also available in printed form, published by No Starch Press and may be purchased wherever fine books are sold. No Starch Press also offers this book in elec- tronic formats for most popular e-readers: http://nostarch.com/tlcl.htm Release History Version Date Description 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. 09.11 November 19, 2009 Fourth draft with almost all reviewer feedback incorporated and edited through chapter 37. 09.10 October 3, 2009 Third draft with revised table formatting, partial application of reviewers feedback and edited through chapter 18. 09.08 August 12, 2009 Second draft incorporating the first editing pass. 09.07 July 18, 2009 Completed first draft. Table of Contents Introduction....................................................................................................xvi
    [Show full text]
  • Chapter 8: Disks and Filesystems
    8 D I S K S A N D F I L ESYSTEMS Oh, my head hurts bad. Rings of ones and zeros, ouch! Filesystems hide them. Proper data management is perhaps a sys- tems administrator’s most vital duty. You can replace almost every computer compo- nent, but the data on your disk is irreplace- able. Perhaps that data isn’t important or it’s backed up, but losing files will ruin your day. As a sysadmin, you must protect important data by carefully manag- ing your disks and filesystems. We covered the basics of disklabels and MBR partitions in Chapter 2, but OpenBSD lets you use and abuse disks and filesystems in any number of ways. You’ll learn how in this chapter. !"#$%&'()*+(,-./0)1,2)(23'3$,) 415670)839:;(%)<=)>&9;# Device Nodes A device node is a file that provides a logical interface to a piece of hardware. By reading from a device node, sending data to it, or using a command on it, you’re telling the operating system to perform an action on a piece of hardware or, in some cases, a logical device. Different devices behave differently when data is sent to them. For example, writing to the console makes text appear on the screen or termi- nal, while writing to a disk device puts data on that disk. (OpenBSD puts device nodes in /dev and disallows device nodes on other filesystems.) Many disk management programs expect to be given a device name as an argument. Unfortunately, device node names are frequently cryptic and vary widely among operating systems—even on closely related operat- ing systems that run on the same hardware.
    [Show full text]
  • VERITAS Storage Migrator 3.4.1 Installation Guide UNIX
    VERITAS Storage Migrator™ 3.4.1 Installation Guide UNIX January 2001 30-000069-011 Disclaimer The information contained in this publication is subject to change without notice. VERITAS Software Corporation makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. VERITAS Software Corporation shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this manual. Copyright Copyright 1994-2001 VERITAS Software Corporation. All Rights Reserved. VERITAS, VERITAS SOFTWARE, the VERITAS logo, Business Without Interruption, VERITAS The Data Availability Company, VERITAS Storage Migrator, and VERITAS Storage Migrator Remote are trademarks or registered trademarks of VERITAS Software Corporation in the US and/or other countries. Other product names mentioned herein may be trademarks or registered trademarks of their respective companies. Printed in the USA, January 2001. VERITAS Software Corporation. 1600 Plymouth St. Mountain View, CA 94043 Phone 650.335.8000 Fax 650.335.8050 http://www.veritas.com Contents Preface . .v Introduction . .v Audience . .v Scope . .v Organization . vi Using This Guide . vi Related Documents . vi Conventions . .vii Type Style . .vii Notes and Cautions . .vii Key Combinations . .vii Command Usage . .vii Getting Help . viii Chapter 1. Things to Know Before You Install VSM . .1 Introduction . 1 General Note About Upgrading to VSM 3.4.1 . 1 Cautions and Other Information . 2 Notes and Cautions for All Systems . 2 First Time Users . 2 Storage Migrator Remote Users . 2 Software Patches . 2 VERITAS Storage Migrator Licensing .
    [Show full text]