Commit Graph

75 Commits

Author SHA1 Message Date
Chris Moerz
c80c104cbd
glabel.8: Describe cases related to permissions / existing mounts
Specially, note some requirements for label changes:

- glabel requires write permission on device
- filesystems first need to be unmounted for new labels to persist
  across reboots
- if the affected device node holds the filesystem root, single-user
  mode with r/o mount will be required.

Also, while here, apply some formatting tweaks.

PR:		276724
Reported by:	Alex Matei <matei35@yahoo.com>
Reviewed by:	gbe, jrm, Alexander Ziaee <concussious@runbox.com>
Differential Revision:	https://reviews.freebsd.org/D44394
2024-05-21 15:49:17 -03:00
Alexander Ziaee
1a720cbec5 man filesystems: fix xrefs after move to section 4
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:29 -06:00
Poul-Henning Kamp
66bee50af7 Remove cross-references to GBDE 2024-05-07 07:35:33 +00:00
Ricardo Branco
78444b5ade glabel: Add support for Linux swap
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1205
2024-04-28 22:39:47 -06:00
Alan Somers
4b7949144c geli.8: add some notes regarding performance tuning
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D44908
2024-04-24 07:53:37 -06:00
Alan Somers
c0f02dcd4c geli.8: minor proofreading
MFC after:	3 days
Sponsored by:	Axcient
Reviewed by:	imp, pauamma (manpages)
Differential Revision: https://reviews.freebsd.org/D44907
2024-04-22 15:54:56 -06:00
Ricardo Branco
a8fd0a5f44 glabel: Remove support for old reiserfs
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1101
2024-04-19 16:48:28 -06:00
Cheng-Hsun Lin
1d479bf6b4
gjournal(8): standardize capitalization for consistency
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1017
2024-02-13 16:09:35 +08:00
Warner Losh
a2f733abcf lib: Automated cleanup of cdefs and other formatting
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
2023-11-26 22:23:59 -07:00
Mark Johnston
81f36fbc98 glabel.8: Warn against using generic labels on a shared device
Also suggest against creating a generic label on a device which already
contains a filesystem.

PR:		264166
Reviewed by:	imp, delphij, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35326
2023-09-27 08:39:31 -04:00
Arjan de Vet
88d13bf337 geli: Fix geli setkey -J for detached providers
Clear cached_passphrase before generating a new key, otherwise the
operation nonsensically tries to reuse the old passphrase.

PR:		254966
Pull Request:	https://github.com/freebsd/freebsd-src/pull/780
MFC after:	1 week
2023-08-28 11:03:55 -04:00
Warner Losh
fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh
1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh
b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Marius Strobl
4ef1c6f75d base: Remove support for the VTOC8 partitioning scheme
The removal of the sparc64 support in February 2020 obsoleted the
VTOC8 partitioning scheme as no other FreeBSD platform makes use
of it. Moreover, the code is bitrotting as nothing defines e. g.
LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. With
this change, the following commits are reverted as far as VTOC8
is concerned and parts haven't already previously been deleted
along with prior sparc64 removals:
094fcb157d
a7d366e958
ba8d50d08b

The alignment example d9711c28ef
added to the VTOC8 section of gpart.8 is folded into the MBR one.

This should finally conclude the deorbit of sparc64-specific bits.

        We had joy, we had fun
        we ran Unix on a Sun.
        But that source and the song
        of FreeBSD have all gone.

Credits to Michael Bueker for the original "Unix on a Sun" and Rod
McKuen for the "Seasons in the Sun" lyrics.
2023-07-26 13:16:12 +02:00
Jessica Clarke
daf2519ea2 geom: Migrate from COMPAT_32BIT to generic COMPAT_libcompat
See commit 8fad2cda93 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by:	imp, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40927
2023-07-09 18:49:28 +01:00
Graham Perrin
3541d90836 gpart(8): slices are out of context for GPT
Correct the GPT example. Creation of a partition leaves free the rest
of the device (not the slice).

Approved-by:  imp
Fixes:        ae1b731b5d Rewrite the GPT and MBR examples.  For GPT, ensure that the boot partition is large enough for gptzfsboot, which has doubled in size since 10.
MFC after:    1 week
Pull-request: https://github.com/freebsd/freebsd-src/pull/795
2023-07-07 23:05:46 +01:00
Tom Hukins
409594ef34 gpart(8): Improve manual page syntax
Fix various warnings from `mandoc -Tlint lib/geom/part/gpart.8`.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702
2023-06-01 20:43:04 -06:00
Tom Hukins
d275d2e3d3 gpart(8): Refer to a related manual page
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702
2023-06-01 20:41:34 -06:00
Mariusz Zaborski
06db6a9dce geli: fix typo
PR:		271396
Reported by:	Tim Chase <freebsd@tim.thechases.com>
MFC after:	1 week
2023-05-15 10:44:17 +02:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
2023-05-12 10:44:03 -06:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Mariusz Zaborski
5fff09660e geli: split the initalization of HMAC
GELI allows to read a user key from a standard input.
However if user initialize multiple providers at once, the standard
input will be empty for the second and next providers.
This caused GELI to encrypt a master key with an empty key file.

This commits initialize the HMAC with the key file, and then reuse the
finalized structure to generate different encryption keys for different
providers.

Reported by:	Nathan Dorfman
Tested by:	philip
Security:	FreeBSD-SA-23:01.geli
Security:	CVE-2023-0751
2023-02-08 10:01:58 -08:00
Emmanuel Vadot
0bf688786f pkgbase: Put geom utilities in their own package
For most users it's not needed to boot and they are also
available in the FreeBSD-rescue package in case an update
break and FreeBSD-geom package isn't updated correctly.

Differential Revision:	https://reviews.freebsd.org/D36224
2022-10-26 19:46:28 +02:00
Benedict Reuschling
d63104d253 Add information on how to load gmirror on boot to auto activate mirrors
PR:			234997
Reported by:		Michiel van Baak <michiel@vanbaak.eu>
Event:			Aberdeen Hackathon 2022
Differential Revision:	https://reviews.freebsd.org/D20577
2022-10-05 16:44:31 +00:00
Jens Schweikhardt
cf13e67730 Fix dead reference to boot0(8) to point to boot0cfg(8). 2022-09-16 19:08:22 +02:00
Mateusz Piotrowski
a848315f68 gmirror.8: Remove references rc.early
The manual page of gmirror describes how gmirror providers can be used
for kernel dumps. Unfortunately, the instruction references
/etc/rc.early, which is no longer a part of rc(8).

Remove references to rc.early and suggest creating an rc(8) service
script instead.

Future work: In the Problem Report on Bugzilla, Lawrence Chen suggested
adding example rc(8) scripts to the gmirror. However, those examples
need to be tested before they become official reference examples in the
base. Also, those scripts should probably land directly to /etc/rc.d,
/usr/share/examples/rc.d, or /usr/share/examples/gmirror instead of the
gmirror manual page.

PR:		178818
Reported by:	Lawrence Chen <beastie@tardisi.com>
Fixes:		dd2b024a33 Removal of early.sh
MFC after:	1 week
2022-07-21 22:02:44 +02:00
Mark Johnston
081b4452a7 geli: Add a chicken switch for unmapped I/O
We have a report of a panic in GELI that appears to go away when
unmapped I/O is disabled.  Add a tunable to make such investigations
easier in the future.  No functional change intended.

PR:		262894
Reviewed by:	asomers
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34944
2022-04-18 17:55:24 -04:00
Mateusz Piotrowski
fd06117525 *: Do not use the no-op -r flag for bsdlabel(8)
The -r flag is ignored by the FreeBSD implementation of bsdlabel(8)
(also called disklabel(8) in the past). Remove its use from examples
and tests in the tree.

This commit does not touch historical documentation under share/doc/smm
and files under contrib/netbsd-tests.

Reviewed by:	imp
MFC after:	2 weeks
Approved by:	imp (src)
Fixes:		57dfbec57b More axe-work:
Differential Revision:	https://reviews.freebsd.org/D34585
2022-03-17 17:28:07 +01:00
Alexander Motin
7f16b501e2 GEOM: Introduce partial confxml API
Traditionally the GEOM's primary channel of information from kernel to
user-space was confxml, fetched by libgeom through kern.geom.confxml
sysctl.  It is convenient and informative, representing full state of
GEOM in a single XML document.  But problems start to arise on systems
with hundreds of disks, where the full confxml size reaches many
megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much
smaller XML document, subset of the full confxml, limited to 64KB and
representing only one specified geom and optionally its parents.  It
uses existing GEOM control interface, extended with new "getxml" verb.
In case of any error, such as the buffer overflow, it just transparently
falls back to traditional full confxml.  This patch uses the new API in
user-space GEOM tools where it is possible.

Reviewed by:	imp
MFC after:	2 month
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D34529
2022-03-12 11:55:52 -05:00
Hans Petter Selasky
419822b372 libgeom(3): Use calloc instead of malloc and bzero.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/546
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 10:38:16 +01:00
Alexander Motin
5c20bfc787 gpart: Avoid geom_gettree() call in "bootcode -b".
geom_gettree() may be pretty expensive on large systems, and it is
not needed if only -b flag specified, that is processed by kernel.

MFC after:	1 month
2022-03-08 14:01:04 -05:00
Alexander Motin
2117cdd4b4 GEOM: Introduce gctl_add_param() API.
Make gctl_add_param() API public, allowing more precise control over
parameter flags.  Previously it was impossible to properly declare
write-only ASCII parameters, used for result reporting, they were
declared as read-write binary instead, that was not nice.

MFC after:	1 month
2022-03-07 11:12:25 -05:00
Kirk McKusick
c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00
Ed Maste
9c296a2105 geom: Add HiFive boot partitions
As documented in the HiFive Unmatched Software Reference Manual.

Reviewed by:	imp, mhorne
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34010
2022-01-26 10:54:45 -05:00
Ed Maste
3524dead81 gpart.8: minor tidying
Reported by:	igor(1)
2022-01-26 10:54:45 -05:00
Eugene Grosbein
ba94a95402 gpart(8): add minimal reference to glabel(8) to manual page
MFC after:	1 week
2022-01-10 22:07:23 +07:00
Mateusz Piotrowski
58d60030ff gmultipath.8: Fix a typo
It's Word Wide Port Name, not World Word Port Name.

MFC after:	3 days
2021-12-10 14:33:34 +01:00
Alexander Motin
c7cf100aaf geli(8): Do not report error on resize to the same size.
Just validate the old metadata and exit.  Originally the check was
added to not thash the only copy of metadata, but we can achieve the
same just by skipping the writing/trashing.  The metadata validation
should protect user from wrongly specifying new size instead of old.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2021-08-18 17:11:03 -04:00
Noah Bergbauer
d575e81fbc gconcat: Implement new online append feature
Implement the "gconcat append" command which can be used
to append a disk to the end of an existing gconcat device
without unmounting.

If the gconcat device is using the "automatic" method, i.e.,
stores metadata on the devices, new metadata is written
to all existing components, as well as to the newly added one.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/472
Reviewed by:	imp@
2021-06-14 11:42:03 -06:00
Andreas Bjornestad
25352f9fda Minor grammar nit
PR:		docs/253975
2021-03-03 16:20:29 +00:00
Edward Tomasz Napierala
bce7ee9d41 Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@.  It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by:	emaste, imp, gbe (manpages)
Differential Revision:	https://reviews.freebsd.org/D26980
2020-10-28 13:46:11 +00:00
Mateusz Piotrowski
6709a5167f Fix formatting of SYNOPSIS
There was an unnecessary newline being added before Nm.

MFC after:	3 days
2020-10-15 14:17:45 +00:00
Conrad Meyer
cb1480f8d4 gpart(8): Recognize apple-zfs and solaris-reserved partition ids
Introduce G_PART_ALIAS_SOLARIS_RESERVED, GPT_ENT_TYPE_SOLARIS_RESERVED et al.,
to make gpart show output more convenient on systems with illumos/openindiana
disks visible.

Submitted by:	Juraj Lutter <otis AT sk.FreeBSD.org>
Reviewed by:	bcr(manpages), delphij, myself
Differential Revision:	https://reviews.freebsd.org/D26012
2020-08-17 17:07:05 +00:00
Gordon Bergling
9af25ea3bb geli(8): Add missing commands in the EXAMPLES section
- Add a missing 'geli attach' command
- Fix the passphrase prompt for a 'geli attach' command

Reported by:	Fabian Keil <freebsd-listen at fabiankeil dot de>
Reviewed by:	bcr (mentor)
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D25761
2020-07-22 13:00:56 +00:00
Gordon Bergling
fcc9702f05 geli(8): Add an example on how to use geli(8) with a file as encrypted storage
Reviewed by:	bcr (mentor)
Approved by:	bcr (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25741
2020-07-20 13:24:50 +00:00
Baptiste Daroussin
5b990a9463 Revert r362466
Such change should not have happen without prior discussion and review.

With hat:	transitioning core
2020-06-22 07:46:24 +00:00
Hans Petter Selasky
7747001b12 Improve wording to be more precise and clear.
No functional change intended.

s/Master Boot/Main Boot/ (also called MBR)

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-06-21 13:34:08 +00:00
John Baldwin
e2b9919398 Remove support for geli(4) algorithms deprecated in r348206.
This removes support for reading and writing volumes using the
following algorithms:

- Triple DES
- Blowfish
- MD5 HMAC integrity

In addition, this commit adds an explicit whitelist of supported
algorithms to give a better error message when an invalid or
unsupported algorithm is used by an existing volume.

Reviewed by:	cem
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24343
2020-04-15 00:14:50 +00:00