aboutsummaryrefslogtreecommitdiff
path: root/sbin/geom
Commit message (Collapse)AuthorAgeFilesLines
* geom(8): list geoms with /dev/ prefixRobert Wing2020-12-121-0/+4
| | | | | | | | | | | | | | | | | | | Allow geom(8) to list geoms with the '/dev/' prefix. `geom part show` accepts the '/dev/' prefix but `geom part list` does not. Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior of find_geom() in lib/geom/part/geom_part.c. PR: 188213 Reported by: Ronald F. Guilmette <rfg@tristatelogic.com> Reviewed by: imp, kevans Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27556 Notes: svn path=/head/; revision=368576
* Remove all the RELEASE_CRUNCH defines, they are useless.Warner Losh2019-12-161-1/+1
| | | | | | | | RELEASE_CRUNCH has been broken for a very long time. Remove the last remants from the tree. Notes: svn path=/head/; revision=355821
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-0/+20
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add the "-t" option to geom(8) utility, to display geoms hierarchy.Edward Tomasz Napierala2018-09-142-4/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sample output: % geom -t Geom Class Provider da0 DISK da0 da0 PART da0s1 da0s1 PART da0s1a ffs.da0s1a VFS da0s1a DEV da0s1 DEV da0 DEV da1 DISK da1 swap SWAP da1 DEV cd0 DISK cd0 cd0 DEV Reviewed by: oshogbo Approved by: re (kib) MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17151 Notes: svn path=/head/; revision=338684
* Add new option to the geom(8) utility, "-p". It makes it easy to look upEdward Tomasz Napierala2018-09-132-1/+80
| | | | | | | | | | | | | | the GEOM class instance from the provider name. Reviewed by: oshogbo, 0mp Approved by: re (kib) MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17116 Notes: svn path=/head/; revision=338640
* Minor usability improvements to geom(8).Edward Tomasz Napierala2018-09-111-9/+12
| | | | | | | | | Approved by: re (kib) MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=338589
* Normalize the g(eom,cache,part,...) build.Brooks Davis2018-06-2571-13609/+20
| | | | | | | | | | | | | | | | | | | | | | | Rather then combining hardlink creation for the geom(8) binary with shared library build, move libraries to src/lib/geom so they are built and installed normally. Create a common Makefile.classes which is included by both lib/geom/Makefile and sbin/geom/Makefile so the symlink and libraries stay in sync. The relocation of libraries allows libraries to be build for 32-bit compat. This also reduces the number of non-standard builds in the system. This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit system out of the box as it will look in the wrong place for libraries unless GEOM_LIBRARY_PATH is set appropriatly in the environment. Reviewed by: bdrewery Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15360 Notes: svn path=/head/; revision=335645
* gpart: add EFI alias for MBR partition schemeEd Maste2018-06-171-4/+6
| | | | | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15870 Notes: svn path=/head/; revision=335301
* Follow r333233, add fat32lba description to gpart(8)Li-Wen Hsu2018-06-121-1/+6
| | | | | | | | | | | Reviewed by: emaste MFC after: 3 days X-MFC with: r333233 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15767 Notes: svn path=/head/; revision=334985
* gpart.8: list all options in table form for each commandEd Maste2018-05-111-64/+107
| | | | | | | | | | | | Previously gpart's man page listed some command options in prose, and some in table form, which made it more difficult to use as a reference. Reviewed by: bcr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15135 Notes: svn path=/head/; revision=333488
* gpart.8: sort suboptions per mdoc(7)Ed Maste2018-05-111-14/+14
| | | | | | | | | | Alphabetical order, uppercase before lowercase for each letter and with no regard to whether an option takes an argument. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333487
* Introduce the 'n' flag for the geli attach command.Mariusz Zaborski2018-05-092-3/+8
| | | | | | | | | | | | | If the 'n' flag is provided the provided key number will be used to decrypt device. This can be used combined with dryrun to verify if the key is set correctly. This can be also used to determine which key slot we want to change on already attached device. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D15309 Notes: svn path=/head/; revision=333439
* Change option dry-run from 'n' to 'C' in geli attach command.Mariusz Zaborski2018-05-092-8/+8
| | | | | | | | | | | | 'n' is used in other commands to define the key index. We should be consistent with that. 'C' option is used by patch(1) to perform dryrun so lets use that. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D15308 Notes: svn path=/head/; revision=333438
* Introduce dry run option for attaching the device.Mariusz Zaborski2018-04-102-3/+7
| | | | | | | | | | | This will allow us to verify if passphrase and key is valid without decrypting whole device. Reviewed by: cem@, allanjude@ Differential Revision: https://reviews.freebsd.org/D15000 Notes: svn path=/head/; revision=332361
* Clarify and clean up some language, and add an explicit example.Warren Block2018-03-021-11/+15
| | | | | | | | Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D12336 Notes: svn path=/head/; revision=330291
* Add GUID and alias for Apple APFS partitionConrad Meyer2018-02-111-1/+3
| | | | | | | | PR: 225813 Submitted by: James Wright <james.wright AT jigsawdezign.com> Notes: svn path=/head/; revision=329119
* geom: don't write stack garbage in disk labelsAlan Somers2018-02-049-0/+16
| | | | | | | | | | | | | | | | | | | | | | Most consumers of g_metadata_store were passing in partially unallocated memory, resulting in stack garbage being written to disk labels. Fix them by zeroing the memory first. gvirstor repeated the same mistake, but in the kernel. Also, glabel's label contained a fixed-size string that wasn't initialized to zero. PR: 222077 Reported by: Maxim Khitrov <max@mxcrypt.com> Reviewed by: cem MFC after: 3 weeks X-MFC-With: 323314 X-MFC-With: 323338 Differential Revision: https://reviews.freebsd.org/D14164 Notes: svn path=/head/; revision=328849
* gnop(8): add the ability to set a nop provider's physical pathAlan Somers2018-01-182-2/+7
| | | | | | | | | | While I'm here, expand the existing tests a bit. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13579 Notes: svn path=/head/; revision=328108
* Document gmirror sysctls.Mark Johnston2017-11-301-6/+42
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=326410
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2722-0/+44
| | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-3117-17/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix alignment of 'last' in autofill.Marcel Moolenaar2017-10-061-1/+1
| | | | | | | | | | | | | | 'last' is the sector number of the last usable sector. Sector numbers start with 0. As such, 'last' is always 1 less than the count of sectors and aligning 'last' down as-is means that the number of free sectors is pessimized by 'alignment - 1' if the number of usable sectors was already a multiple of the alignment. Consequently, gpart(8) failed to create a partition when the alignment and size were such that it would extend to the end of the disk. Notes: svn path=/head/; revision=324369
* Provide an articulate example of how to properly delete partitions andAlexey Dokuchaev2017-09-191-1/+24
| | | | | | | | | | | | | | | | partitioning scheme. Users often get confused and frustrated when trying to delete partition table and getting ``Device busy'' error because they forgot (or did not ever know that they have) to delete all its partitions first, and while the manual page mentions this briefly, it does not stress it out enough. Approved by: ae, manpages (bjk) PR (as inspiration): 196102 Differential Revision: https://reviews.freebsd.org/D12336 Notes: svn path=/head/; revision=323764
* Fix language used in the r322923.Mariusz Zaborski2017-09-171-7/+12
| | | | | | | | | Pointed out by: wblock@ MFC after: 1 week X-MFC-with: r322923 Notes: svn path=/head/; revision=323671
* geom_virstor: Remove wholly unnecessary g_metadata_store copyConrad Meyer2017-09-081-57/+1
| | | | | | | | | Just code cleanup. No functional change. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323315
* Audit userspace geom code for leaking memory to diskConrad Meyer2017-09-082-0/+2
| | | | | | | | | | | | | | | | | | Any geom class using g_metadata_store, as well as geom_virstor which duplicated g_metadata_store internally, would dump sectorsize - mdsize bytes of userspace memory following the metadata block stored. This is most or all geom classes (gcache, gconcat, geli, gjournal, glabel, gmirror, gmultipath, graid3, gshsec, gstripe, and geom_virstor). PR: 222077 (comment #3) Reported by: Maxim Khitrov <max AT mxcrypt.com> Reviewed by: des Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12269 Notes: svn path=/head/; revision=323314
* Hide length of geli passphrase during boot.Mariusz Zaborski2017-08-262-12/+58
| | | | | | | | | | | | | Introduce additional flag to the geli which allows to restore previous behavior. Reviewed by: AllanJude@, cem@ (previous version) MFC: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11751 Notes: svn path=/head/; revision=322923
* Fix withered handling of r280687, broken by r286719.Alexander Motin2017-04-271-2/+15
| | | | | | | MFC after: 1 week. Notes: svn path=/head/; revision=317515
* Always allow setting number of iterations for the first time.Alexander Motin2017-04-211-1/+3
| | | | | | | | | | | | | | | Before this change it was impossible to set number of PKCS#5v2 iterations, required to set passphrase, if it has two keys and never had any passphrase. Due to present metadata format limitations there are still cases when number of iterations can not be changed, but now it works in cases when it can. PR: 218512 MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D10338 Notes: svn path=/head/; revision=317246
* Fix memory leak in "gpart bootcode"Alan Somers2017-04-051-2/+3
| | | | | | | | | | | | Also, annotate that gpart_issue never returns Reported by: Coverity CID: 1007105 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316535
* Fix clearing geom metadata if DIOCGSECTORSIZE failsAlan Somers2017-04-051-3/+2
| | | | | | | | | | | | | An unhandled error case would result in passing SIZE_MAX to malloc. While I'm here, remove an unnecessary NULL check before free Reported by: Coverity CID: 1017793 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316530
* Add the capability to refresh the gpart(8) label without need a reboot.Marcelo Araujo2017-03-122-1/+37
| | | | | | | | | | | | | | | | gpart(8) has functionality to change the label of an GPT partition. This functionality works like it should, however, after a label change the /dev/gpt/ entries remain unchanged. glabel(8) status output remains unchanged. The change only takes effect after a reboot. PR: 162690 Submitted by: sub.mesa@gmail, Ben RUBSON <ben.rubson@gmail.com>, ae Reviewed by: allanjude, bapt, bcr MFC after: 6 weeks. Differential Revision: https://reviews.freebsd.org/D9935 Notes: svn path=/head/; revision=315112
* sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-0418-22/+22
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314656
* Add sysctl to control auto resize of the GEOM metadata.Mariusz Zaborski2017-02-271-0/+12
| | | | | | | | Reviewed by: AllanJude Differential Revision: https://reviews.freebsd.org/D9603 Notes: svn path=/head/; revision=314359
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-11/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Add `gmirror create` subcommand, alike to gstripe, gconcat, etc.Alexander Motin2016-11-302-1/+24
| | | | | | | | | | | | It is quite specific mode of operation without storing on-disk metadata. It can be useful in some cases in combination with some external control tools handling mirror creation and disks hot-plug. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=309321
* Fix alignment issues on MIPS: align the pointers properly.Ruslan Bukin2016-10-311-1/+1
| | | | | | | | | | | All the 5520 GEOM_ELI tests passed successfully on MIPS64EB. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D7905 Notes: svn path=/head/; revision=308137
* Add missing history sections to a number of storage related man pagesAllan Jude2016-09-161-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gmultipath.8: Add HISTORY Adjust sentences with bad phrases picked up by igor ggatec.8: Add HISTORY ggated.8: Add HISTORY ggatel.8: Add HISTORY Seperate out sentence as advised by igor. hastctl.8: Add HISTORY hastd.8: Add HISTORY Fix sentence highlighted by igor. iscontrol.8: Add HISTORY mdmfs.8: Add HISTORY Address issues raised by igor mount_nfs.8: Add HISTORY Not sure where mount_nfs first showed up, but the verison used in the BSD's originates from 4.4BSD according to CSRG archive. Though commercial offerings from Sun and others covers older systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI nandfs.8: Add HISTORY Adjust sentence in description to address bad phrase highlighted by igor. nvmecontrol.8: Add HISTORY PR: 212491 PR: 212498 PR: 212499 PR: 212500 PR: 212501 PR: 212502 PR: 212505 PR: 212508 PR: 212540 PR: 212543 PR: 212546 Submitted by: Sevan Janiyan <venture37@geeklan.co.uk> Notes: svn path=/head/; revision=305861
* Fix misleading description of the -b option in the geli init command.Mariusz Zaborski2016-08-031-2/+2
| | | | | | | | | Reviewed by: bjk, wblock Differential Revision: https://reviews.freebsd.org/D7226 Discussed with: AllanJude Notes: svn path=/head/; revision=303725
* Rewrite the GPT and MBR examples. For GPT, ensure that the boot partitionDag-Erling Smørgrav2016-07-251-36/+63
| | | | | | | | | | is large enough for gptzfsboot, which has doubled in size since 10. PR: 211361 MFC after: 3 days Notes: svn path=/head/; revision=303289
* sbin: ake use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298872
* MFHGlen Barber2016-04-113-19/+67
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297824
| * Fix the problem, when gpart(8) can't write both bootcode and partcodeAndrey V. Elsukov2016-04-111-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | in one command due to wrong file size limit. Do not use bootcode size to calculate partsize limit. Also add report message about successful partcode writing. Reported by: Trond Endrestøl MFC after: 2 weeks Notes: svn path=/head/; revision=297820
| * Create the GELIBOOT GEOM_ELI flagAllan Jude2016-04-082-11/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag indicates that the user wishes to use the GELIBOOT feature to boot from a fully encrypted root file system. Currently, GELIBOOT does not support key files, and in the future when it does, they will be loaded differently. Due to the design of GELI, and the desire for secrecy, the GELI metadata does not know if key files are used or not, it just adds the key material (if any) to the HMAC before the optional passphrase, so there is no way to tell if a GELI partition requires key files or not. Since the GELIBOOT code in boot2 and the loader does not support keys, they will now only attempt to attach if this flag is set. This will stop GELIBOOT from prompting for passwords to GELIs that it cannot decrypt, disrupting the boot process PR: 208251 Reviewed by: ed, oshogbo, wblock Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D5867 Notes: svn path=/head/; revision=297691
* | MFHGlen Barber2016-03-141-2/+1
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296869
| * Allow standard commands for "unknown" classes in RESCUE mode.Alexander Motin2016-03-111-2/+1
| | | | | | | | | | | | | | | | | | For example, it allows quite useful `geom disk list` command. MFC after: 1 week Notes: svn path=/head/; revision=296653
* | Explicitly add more files to the 'runtime' package.Glen Barber2016-02-0918-0/+18
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295450
* Make additional parts of sys/geom/eli more usable in userspaceAllan Jude2016-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | The upcoming GELI support in the loader reuses parts of this code Some ifdefs are added, and some code is moved outside of existing ifdefs The HMAC parts of GELI are broken out into their own file, to separate them from the kernel crypto/openssl dependant parts that are replaced in the boot code. Passed the GELI regression suite (tools/regression/geom/eli) Files=20 Tests=14996 Result: PASS Reviewed by: pjd, delphij MFC after: 1 week Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4699 Notes: svn path=/head/; revision=293306
* Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.cAllan Jude2015-12-271-1/+2
| | | | | | | | | | | | | | | | | | | | | cperciva's libmd implementation is 5-30% faster The same was done for SHA256 previously in r263218 cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation Extend sbin/md5 to create sha384(1) Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h} Reviewed by: cperciva, des, delphij Approved by: secteam, bapt (mentor) MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3929 Notes: svn path=/head/; revision=292782
* Remove a note about damaged PMBR. Now GPT will be detected automaticallyAndrey V. Elsukov2015-12-101-11/+1
| | | | | | | | | with such corruption. MFC after: 1 month Notes: svn path=/head/; revision=292058