aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount
Commit message (Collapse)AuthorAgeFilesLines
* mount: document atime optionEd Maste2024-01-241-1/+4
| | | | | | | | | atime is enabled by default, but may be specified explicitly so that any future change in the default would not have an effect on a given mount. Reviewed by: olce, rgrimes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43580
* mount: Add a note that userquota and groupquota aren't printed with -pWarner Losh2024-01-161-1/+17
| | | | | | | The quota options are pseudo options and not passed to the mount system call when a filesystem is mounted. They are not part of the info returned from getmntinfo(3), so can't be printed. Add a note to this effect.
* Fix "version introduced" in numerous manual pagesTom Hukins2024-01-081-1/+1
| | | | | MFC after: 1 week Pull request: https://github.com/freebsd/freebsd-src/pull/853
* sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-6/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove copyright strings ifdef'd outWarner Losh2023-11-272-16/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* sbin: Remove ancient SCCS tags.Warner Losh2023-11-279-21/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* mount.8: Mention tarfs(5)Jose Luis Duran2023-10-041-1/+2
| | | | | | Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/856
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-251-2/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* Fix for getmntpoint(3) when checking for NFS mount points.Kirk McKusick2023-01-291-6/+7
| | | | | | | | | | Only attempt to add /dev/ to f_mntfromname names that result in a valid character device. MFC after: 1 week Reported by: Bjoern A. Zeeb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907
* Rewrite to avoid Coverity false positive.Kirk McKusick2023-01-261-5/+7
| | | | | | | MFC after: 1 week Reported by: Coverity (CID 1502669) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907
* Document the mntopts(3) functions.Kirk McKusick2023-01-156-201/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mntopts(3) functions support operations associated with a mount point. The main purpose of this commit is to document the mntopts(3) functions that now appear in 18 utilities in the base system. See mntopts(3) for the documentation details. The getmntopts() function appeared in 4.4BSD. The build_iovec(), build_iovec_argf(), free_iovec(), checkpath(), and rmslashes() functions were added with nmount(8) in FreeBSD 5.0. The getmntpoint() and chkdoreload() functions are being added in this commit. These functions should be in a library but for historic reasons are in a file in the sources for the mount(8) program. Thus, to access them the following lines need to be added to the Makefile of the program wanting to use them: SRCS+= getmntopts.c MOUNT= ${SRCTOP}/sbin/mount CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} Once these changes have been MFC'ed to 13 they may be made into a library. Reviewed by: kib, gbe MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907
* Add support for mounting single files in nullfsDoug Rabson2022-12-193-3/+35
| | | | | | | | | | | My main use-case for this is to support mounting config files and secrets into OCI containers. My current workaround copies the files into the container which is messy and risks secrets leaking into container images if the cleanup fails. Reviewed by: mjg, kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D37478
* Delete xref to suidperl(1) which has long since been removed in perl5.12.Jens Schweikhardt2022-08-141-3/+1
|
* mount: revert the active vnode reporting featureDoug Ambrisko2022-06-151-4/+3
| | | | | | | Revert the computing of active vnode reporting since statfs is used by a lot of tools. Only report the vnodes used. Reported by: mjg
* mount: add vnode usage per file system with mount -vDoug Ambrisko2022-06-131-0/+7
| | | | | | | | | | This avoids the need to drop into the ddb to figure out vnode usage per file system. It helps to see if they are or are not being freed. Suggestion to report active vnode count was from kib@ Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D35436
* mount: use pidfile_signalMateusz Guzik2022-04-091-26/+1
| | | | | | | | | | This fixes a performance problem where poudriere -j 104 keeps remounting filesystems, which induce wanting to signal mountd, if running. The current code tries to do it by creating the pidfile in /var/run and unlinking it if the operation succeeds, inducing contention against anything doing an exec as it tries to look up /var/run/ld-elf.so.hints Differential Revision: https://reviews.freebsd.org/D34681
* mount(8): Fix a typo in source code commentsGordon Bergling2022-03-281-1/+1
| | | | | | - s/filesytem/filesystem/ MFC after: 3 days
* mount.8: mention that the snapshot option is exclusiveRobert Wing2022-03-171-3/+5
| | | | | | | | When using the snapshot option, all other options are ignored. This update reflects changes made in ab2dbd9b871d. Reviewed by: 0mp, mckusick Differential Revision: https://reviews.freebsd.org/D34584
* vfslist.c: initialize skipvfs variableStefan Eßer2022-01-051-0/+1
| | | | | | | | | | The function makevfslist is only called once in mount.c, but should be save to be called more than once with different parameters. The bin/df command links against this file, and will need this possibility to allow -l and -t to be used together. MFC after: 3 days
* mount: make libxo support more locale-awarePiotr Pawel Stefaniak2021-09-271-3/+3
| | | | | | | "special", "node", and "mounter" are not guaranteed to be encoded with UTF-8. Use the appropriate modifier. Reported by: eugen@
* mount: Don't pass a NULL format string to xo_err().John Baldwin2021-09-251-1/+1
| | | | | | This fixes a -Wformat error from GCC 9. Fixes: e725ee7eb672 mount: add libxo(3) support
* mount: add libxo(3) supportCameron Katri2021-09-243-55/+114
| | | | | | Adds --libxo to mount(8). Differential Revision: https://reviews.freebsd.org/D30341
* Move the mount name to bit mapping into sys/mount.h so it can be shared with theWarner Losh2020-08-191-31/+4
| | | | | | | | | | | | kernel. Discussed with: kib@ Reviewed by: kirk@ (prior version) Sponsored by: Netflix Diffential Revision: https://reviews.freebsd.org/D25969 Notes: svn path=/head/; revision=364401
* All the other printf() calls cast to (void) here, do the two newer ones forWarner Losh2020-08-071-2/+2
| | | | | | | consistency. Notes: svn path=/head/; revision=364004
* Add two options to allow mount to avoid covering up existing mount points.Sean Eric Fagan2019-09-233-3/+15
| | | | | | | | | | | | | | | | | | | The two options are * nocover/cover: Prevent/allow mounting over an existing root mountpoint. E.g., "mount -t ufs -o nocover /dev/sd1a /usr/local" will fail if /usr/local is already a mountpoint. * emptydir/noemptydir: Prevent/allow mounting on a non-empty directory. E.g., "mount -t ufs -o emptydir /dev/sd1a /usr" will fail. Neither of these options is intended to be a default, for historical and compatibility reasons. Reviewed by: allanjude, kib Differential Revision: https://reviews.freebsd.org/D21458 Notes: svn path=/head/; revision=352614
* Allow "update" option to be used in the fstab(5). Document possible use case.Maxim Sobolev2019-07-221-0/+1
| | | | | | | | | Approved by: mckusick MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18586 Notes: svn path=/head/; revision=350224
* Add a new "untrusted" option to the mount command. Its purposeKirk McKusick2019-07-013-1/+11
| | | | | | | | | | | | | | | | | | | is to notify the kernel that the file system is untrusted and it should use more extensive checks on the file-system's metadata before using it. This option is intended to be used when mounting file systems from untrusted media such as USB memory sticks or other externally-provided media. It will initially be used by the UFS/FFS file system, but should likely be expanded to be used by other file systems that may appear on external media like msdosfs, exfat, and ext2fs. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20786 Notes: svn path=/head/; revision=349589
* Exercise some care before sending SIGHUP to mountd.Konstantin Belousov2019-04-081-0/+11
| | | | | | | | | | Reviewed by: antoine, emaste, oshogbo Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19847 Notes: svn path=/head/; revision=346038
* When getting mount information for all filesystems, mount uses theKirk McKusick2018-08-071-1/+2
| | | | | | | | | | | | | getfsstat(2) system call using the MNT_NOWAIT flag to indicate that it wants to use the statfs information cached in the mount structure. When the -v (verbose) flag is specified, we need to use the MNT_WAIT flag to getfsstat(2) so that kernel will call VFS_STATFS to get the current statfs statistics from each filesystem. Sponsored by: Netflix Notes: svn path=/head/; revision=337437
* Fix synopsis of the -t option.Mateusz Piotrowski2018-08-061-18/+13
| | | | | | | | | | | | | | | While here: - Remove deprecated ".Tn" macros. - Improve formatting and fix typos in the description of the -t option. Reviewed by: bcr Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D16541 Notes: svn path=/head/; revision=337377
* vfs_donmount: in certain cases try r/o mount if r/w mount failsAndriy Gapon2018-03-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | If the operation is not an update, if neither r/w nor r/o mode is explicitly requested, if the error code hints at the possibility of the media being read-only, and if the fallback is allowed, then we can try to automatically downgrade to the readonly mode. This is especially useful for auto-mounting of removable media that sometimes can happen to be write-protected. The fallback to r/o is not enabled by default. It can be requested on a per-mount basis with a new mount option, 'autoro'. Or it can be globally allowed by setting vfs.default_autoro. Reviewed by: cem, kib MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13361 Notes: svn path=/head/; revision=331616
* Remove decade's old whine about msdos vs msdosfs.Warner Losh2018-03-091-4/+1
| | | | | | | | | Retain the compatibility silently though. Reviewed by: cem@, kevans@, emaste@ (and many others in the past) Notes: svn path=/head/; revision=330705
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-2/+14
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix "mount -uw /" when the filesystem type doesn't match.Edward Tomasz Napierala2017-07-081-1/+3
| | | | | | | | | | | | | | | | | This basically makes "mount -uw /" work when the filesystem mounted on / is NFS, but the one configured in fstab(5) is UFS, which can happen when you forget to modify fstab. Note that the whole special case ("else if (argv[0][0] == '/'") is probably not needed anyway. I'll take a look at removing it altogether; for now this is a minimally intrusive fix. MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11323 Notes: svn path=/head/; revision=320803
* Add MD_VERIFY option to enable O_VERIFY in open for vnode type.Stephen J. Kiernan2017-05-311-0/+1
| | | | | | | | | | | | | | | | Add -o [no]verify option to mdconfig (and document in man page.) Implement GEOM attribute MNT::verified to ask md if the backing vnode is verified. Check for MNT::verified in cd9660 mount to flag the mount as MNT_VERIFIED if the underlying device has been verified. Reviewed by: rwatson Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2902 Notes: svn path=/head/; revision=319358
* Move mount.conf(8) to mount.conf(5); it's a kernel configuration fileEdward Tomasz Napierala2017-05-282-253/+1
| | | | | | | | | and not an administrative utility. MFC after: 2 weeks Notes: svn path=/head/; revision=319079
* sbin/mount: strcpy -> strlcpyAlan Somers2017-04-071-3/+4
| | | | | | | | | | Reported by: Coverity CID: 1011173, 1011174 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316611
* Add a post-humous manpage for cd9660(5), the ISO-9660 file systemEnji Cooper2017-03-231-1/+2
| | | | | | | | | | | | | Describe (briefly) how to compile the filesystem into the kernel and load as a module. Reference cd9660(5) in mount(8) and mount_cd9660(8). MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315775
* mount.conf(8): fix a .Xr callEnji Cooper2017-03-231-1/+1
| | | | | | | | | | Add the missing section number for devfs(5) MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315774
* Renumber copyright clause 4Warner Losh2017-02-288-8/+8
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add a free_iovec() function to reset iovec's.Brooks Davis2016-12-142-0/+15
| | | | | | | | | | | | | The primary purpose is to call nmount() in a loop with new iovec's so free_iovec takes arguments by reference and resets their values. Reviewed by: cem MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 Notes: svn path=/head/; revision=310092