aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount
Commit message (Collapse)AuthorAgeFilesLines
* mount.8: document nosymfollow optionWolfram Schneider2025-11-241-2/+7
| | | | | Document the nosymfollow mount option in more details. Forgotten in 5ddc8ded1dbe650b7d83240a1f86a1eb6e2b9b5a
* getvfsbyname.3 mount.8: Reference lsvfs(1)Mateusz Piotrowski2025-10-281-1/+2
| | | | | | MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D53411
* manpages: prefer linking to xo_options.7 over xo_parse_args.3Alan Somers2025-07-161-3/+3
| | | | | | | | | | | | | | | Most libxo-enabled utilities link to xo_parse_args.3. But that man page doesn't actually describe how to format command-line arguments. Rather, xo_options.7 does. I suspect that these utilities link to the former because the latter man page did not exist until libxo-0.7.2 (8a6eceff3ce). And newer utilities have probably been copy/pasting the same text from older ones. But the superior man page does exist now, so we should link to it instead. MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51354
* mount: Improve usage message and polish man page descriptionsAlexander Ziaee2025-04-302-10/+15
| | | | | | | | | | | | | + license: tag spdx, remove dead hyphen + -t: fix linter errors, sync to program usage + -o ro: explain itself before explaining it's equivalence + -o rw: mention MFC after: 1 week Fixes: 70866c8dbdb6c (Fix synopsis of the -t option) Reviewed by: imp, mhorne, Pat Maddox <pat@patmaddox.com> Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D49671
* mount.8: Add a single example for single user modeAlexander Ziaee2025-04-241-0/+4
| | | | | | | | | | | | | The zfs command to do this is a bit longer and harder to remember. In the last few releases mount(8) learned how to do this, so lets show it in the manual. MFC after: 3 days Reported by: Jan Bramkamp <crest+freebsd@rlwinm.de> Discussed with: cperciva, emaste Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D49988
* Search for mntopts.h globally, not locallyBrooks Davis2025-04-222-2/+2
| | | | | | | | | Change the include directives to use <mntopts.h> instead of "mntopts.h" now that it's installed by libutil (the latter option was dubious regardless since a -I${SRCTOP}/sbin/mount was required anyway). Reviewed by: olce, imp, dim, emaste Differential Revision: https://reviews.freebsd.org/D49952
* Move mntopts(3) suppport into libutilBrooks Davis2025-04-224-799/+2
| | | | | | | | | | | | | | | | | Many programs use this functionality so it should be available centrally rather than compiled into each program independently. This has the modest downside of adding libutil dependencies to some mount_<foo> programs, but many (plus mount(8)) already have those depndencies so this shouldn't be a major imposition. In commit 906c312bbf74, Kirk said this could be done once the change was merged to FreeBSD 13. That happened in commit 668dfa016698 in 2023. While here perform related tidying including removing SRCS where the only entry is ${PROG}.c rendering it unnecessary. Reviewed by: olce, dim, emaste Differential Revision: https://reviews.freebsd.org/D49951
* mount(8): Avoid truncation when fstab-formatting unionfs mount infoJason A. Harmening2024-12-301-8/+8
| | | | | | | | | | | | | | | | When displaying unionfs mounts in fstab format (`mount -p`), mount(8) currently uses strlcpy to remove the disposition prefix from the mount name returned by getmntinfo(3). But strlcpy, like strcpy before it, does not guarantee correct behavior if the source and destination buffers overlap. Just offset the buffer and avoid the destructive copy in the first place. PR: 283420 Reviewed by: imp (previous version), olce MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48177
* sbin/{ffsinfo,mount,newfs}: reference ffs(4) in man pagesDavid Gilbert2024-11-251-1/+2
| | | | | | PR: 282867 MFC: stable/14 Approved by: mhorne (via IRC)
* manuals: Remove trailing spacesGraham Percival2024-11-041-1/+1
| | | | | | | | | | This does not change the rendered ascii at all. Signed-off-by: Graham Percival <gperciva@tarsnap.com> Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com> MFC after: 3 days Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1473
* mount(8): Complete libxo transitionYan-Hao Wang2024-10-121-9/+10
| | | | | | Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41390
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* man filesystems: fix xrefs after move to section 4Alexander Ziaee2024-05-161-6/+6
| | | | | Reviewed by: des, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
* 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