aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall/scripts/zfsboot
Commit message (Collapse)AuthorAgeFilesLines
* bsdinstall: Add note to zfsboot pointing to release/tools/vmimage.subrJessica Clarke2026-02-081-0/+1
| | | | | | | The VM image creation scripts have a copy of this list of datasets which should be kept in sync, which can otherwise be easily missed, as was the case in the now-reverted 3e8619e535b6 ("bsdinstall: Create separate datasets for directories in /usr/ports").
* Revert "bsdinstall: Create separate datasets for directories in /usr/ports"Ricardo Branco2026-02-081-2/+0
| | | | | | | | | | | | This reverts commit 3e8619e535b61c99f0dc50cc6c7e237eb82a8be7. While it's generally a good idea to have separate datasets for things like this, it breaks git clone with: fatal: destination path 'ports' already exists and is not an empty directory. Signed-off-by: Ricardo Branco <rbranco@suse.de> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2006
* bsdinstall: Create separate datasets for directories in /usr/portsRicardo Branco2026-01-101-0/+2
| | | | | | | | Both distfiles & packages contain compressed files. Signed-off-by: Ricardo Branco <rbranco@suse.de> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1873
* bsdinstall: Use fat32 EFI system partition for ZFSEd Maste2025-11-111-1/+1
| | | | | | | | | | | This is consistent with other operating systems and with bsdinstall's UFS config and with bsdinstall's ZFS config prior to commit 0b7472b3d8d2. Fixes: 0b7472b3d8d2 ("Mount the EFI system partition (ESP) on newly-installed systems.") Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53642
* bsdinstall: Fix typosJose Luis Duran2025-10-181-1/+1
| | | | | | Reviewed by: emaste MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D53170
* bsdinstall: Add loader.efi to all ESPs we createWarner Losh2025-09-301-11/+15
| | | | | | | | | | | | | | | For proper redundancy, add copies of loader.efi to each of the ESPs we create when we create multi-volume ZFS datasets. zfsboot creates a list of secondary ESPs, while bootpart doesn't create any (it's the UFS partitioning tool) because we don't supporg UFS over gmirror. The primary ESP is mounted and is what we use efibootmgr to boot from. The redundant copies allow the system to boot if the primary disks fails. Sponsored by: Netflix MFC After: 2 days PR: 208802 Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52780
* bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oidSiva Mahadevan2025-09-191-5/+5
| | | | | | | | Signed-off-by: Siva Mahadevan <me@svmhdvn.name> PR: 266374 Pull request: https://github.com/freebsd/freebsd-src/pull/1851 Reviewed by: emaste Sponsored by: The FreeBSD Foundation
* bsdinstall: Drop outdated comments about ZFS dataset compressionMichael Osipov2025-09-091-2/+2
| | | | | | | | | | | All datasets on zroot pool are compressed by default since FreeBSD 11.0 [1], no need to mention that on some specific datasets these days. [1] 47206692f2cca020891d1eec5028e02c3e6f56c5 Reviewed by: jrm (mentor), ziaee MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52304
* bsdinstall: use the canonical name for compressionLexi Winter2025-07-281-1/+1
| | | | | | | | | | | | | According to zfsprops(7), the canonical property for the compression algorithm is "compression", with "compress" accepted as an alternate name. Use the canonical name in bsdinstall. While here, change "lz4" to "on" so we pick up any future changes in the default compression algorithm. MFC after: 1 week Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D51572
* bsdinstall: Remove support for ZFS + MBR disk layoutsEd Maste2025-07-251-133/+8
| | | | | | | | | | | | It hasn't worked for some time -- as reported in review D40816 "Installing FreeBSD with Auto ZFS + MBR has been broken ever since the move to OpenZFS with FreeBSD 13." It relied on the partition table and ZFS data overlapping in a very fragile way and is not a good idea. Reviewed by: jhb Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51028
* zfsboot: fix misuse of the phrase zpoolGraham Perrin2025-05-191-15/+15
| | | | | | | | | A pool is not a zpool. Reviewed by: jbh, ivy Approved by: des (mentor) MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1569
* bsdinstall: hook up help line and prompt for ZFS disk selectionFranco Fichtner2025-01-241-4/+4
| | | | | | | | | | Previously we were passing the wrong variable names for the prompt and help line, so the intended action wasn't clear to the user. Reviewed by: jhb, markj MFC after: 3 days See also: https://github.com/opnsense/installer/issues/22 Pull Request: https://github.com/freebsd/freebsd-src/pull/1579
* bsdinstall/zfsboot: Remove unused global variableAlexander Ziaee2025-01-211-1/+0
| | | | | | | | | | | | | | | In an AMA session on the FreeBSD Discord, it was revealed that no logic remains calling GPART_BOOTCODE_PARTONLY. It was removed in aa2a0e0fc311 for FreeBSD 12. git grep shows no other references. No functional change intended. MFC after: 2 weeks Fixes: aa2a0e0fc311 (Enable new UEFI+GELI support) Reported by: Antranig Vartanian <antranigv@freebsd.am> Reviewed by: emaste, mhorne Approved by: emaste, mhorne (src) Approved by: mhorne, carlavilla (mentors) Differential Revision: https://reviews.freebsd.org/D48086
* bsdinstall: Fix a typo in a commentMark Johnston2025-01-061-1/+1
| | | | | PR: 283507 MFC after: 1 week
* bsdinstall zfsboot: Add an option to edit the ZFS pool creation optionsCraig Leres2024-12-261-0/+12
| | | | | | | | | | This allows the default options (-O compress=lz4 -O atime=off) to be overridden, before the ZFS boot pool is created. For example, to set the compression algorithm to something different. Reviewed by: jhb, dim MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47478
* bsdinstall zfsboot: Don't override ZFSBOOT_FORCE_4K_SECTORS if it is null.John Baldwin2023-11-181-1/+1
| | | | | | | | | Only set a default value of 1 if the shell variable is unset. This allows installer scripts to disable the variable. PR: 274513 Reported by: Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz> Differential Revision: https://reviews.freebsd.org/D42319
* bsdinstall: Fix command line argument list parsingAlfonso S. Siciliano2023-10-111-1/+1
| | | | | | | bsddialog(1) uses getopt_long(3) to parse command line argument list. Add '--' to avoid errors caused by arguments (menu items) begin with '-'. The change is compatible with dialog(1) and Xdialog(1).
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* bsdinstall on zfs: create dataset for /home rather than /usr/homeMike Karels2023-05-231-3/+3
| | | | | | | | | Now that pw (hence adduser and the initial install) use /home for user home directories rather than /usr/home, create a dataset for /home rather than /usr/home. Update the man page to match. Reviewed by: rgrimes, markj Differential Revision: https://reviews.freebsd.org/D40086
* bsdinstall: s/to small/too small/Mateusz Guzik2022-12-221-1/+1
| | | | Reported by: Sulev-Madis Silber <ketas@si.pri.ee>
* bsdinstall: improve zfsboots ability to handle datasets under a BEBrad Davis2022-06-231-3/+12
| | | | | | | | | Currently we only set canmount=noauto on the root of the BE, this change makes it so we set it on all datasets under the BE as well. Reviewed by: allanjude Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D35422
* Fix a memory leak from caf73e58579Alan Somers2022-05-281-1/+2
| | | | | | | | | | Don't shadow an already-local variable with another local declaration. Reported by: dteske MFC after: 13 days MFC with: caf73e58579343fc1661f43554b30115bb940535 Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D35331
* bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKSAlan Somers2022-05-271-4/+3
| | | | | | | | | | | If the ZFSBOOT_DISKS variable is set to one or more disk names, then those disks should be preselected in the disk menu. However, the code wasn't correctly setting the variable, leaving all disks unselected. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: dteske Differential Revision: https://reviews.freebsd.org/D35331
* bsdinstall: use gpt/efiboot0 label in /etc/fstabAlan Somers2022-05-241-1/+1
| | | | | | | | | | Otherwise, boot will hang if the numbering of disks has changed since initial install. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: brd Differential Revision: https://reviews.freebsd.org/D35309
* bsdinstall: allow whitelabeling the scriptsBrad Davis2022-05-241-1/+1
| | | | | | Approved by: allanjude, asiciliano Differential Revision: https://reviews.freebsd.org/D35197 Sponsored by: Rubicon Communications, LLC ("Netgate")
* bsdinstall: filter out disks that are unavailable from the list of options ↵Brad Davis2022-04-101-0/+9
| | | | | | | | in ZFS Reviewed by: allanjude, rew Differential Revision: https://reviews.freebsd.org/D34167 Sponsored by: Rubicon Communications, LLC ("Netgate")
* Remove extraneous semicolons trailing break and continue statements.Jens Schweikhardt2022-03-291-4/+4
|
* bsdinstall: zfsboot: Prompt user for zpool name if the pool already existsEmmanuel Vadot2021-12-151-0/+32
| | | | | | | | | | | | If one install FreeBSD on multiple disks (say 13 and CURRENT) the first created pool will always be used. Prompt the user for a new pool name if we detect that the default or supplied one already exists. Reviewed by: imp MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33331
* Allows user to specify an optional ZFSBOOT_POOL_SIZE for their zrootJohn Ko2021-06-021-8/+38
| | | | | | | | | | | | | | The default is to create a zroot that consumes the whole disk because if used with geli(8) this makes sense. Without geli(8), I like to keep my data pool separate from my system pool. This is different than ZFSBOOT_BOOT_POOL_SIZE which is named bootpool. Reviewed by: allenjude Pull Request: https://github.com/freebsd/freebsd-src/pull/53 Differential Revision: https://reviews.freebsd.org/D30588
* Mount the EFI system partition (ESP) on newly-installed systems.Nathan Whitehorn2021-02-231-2/+17
| | | | | | | | | | | | | | | | | | Per hier(7), the ESP will be mounted at /boot/efi. On UFS systems, any existing ESP will be reused and mounted there; otherwise, a new one will be made. On ZFS systems, space for an ESP is allocated on all disks in the root pool, but only the partition actually used to boot is set up and mounted. This makes future upgrades of the EFI loader easier (upgrade scripts can just change /boot/efi) and also greatly simplifies the parts of the installer involved in initialization of the ESP. It also makes the installer's behavior correspond to the documentation in hier(7). Reviewed by: imp, tsoome MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28897
* bsdinstall: riscv-specific tweaksMitchell Horne2021-01-271-2/+2
| | | | | | | | | | | | Make the installer more useful, by allowing it to create a bootable installation. Also, enable the menu option for ZFS-on-root. Like arm64, RISC-V boots by UEFI only, so arm64's partedit implementation is renamed and shared among the two platforms. Reviewed by: gjb MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D28180
* bsdinstall: Use TMPDIR if setRebecca Cran2020-01-151-3/+4
| | | | | | | | | Submitted by: Ryan Moeller <ryan@freqlabs.com> Reviewed by: bcran, Nick Wolff <darkfiberiru@gmail.com> Differential Revision: https://reviews.freebsd.org/D22979/ Notes: svn path=/head/; revision=356740
* bsdinstall: fix ESP detection for auto ZFS layoutYuri Pankov2019-10-091-0/+3
| | | | | | | | | | | | | | Pass the list of user selected disks from zfsboot to bootconfig so that the latter doesn't rely on ESP autodetection that apparently fails for some cases, e.g. memstick installation with nvme (boot) and sata drives. While here, fix printing of debug messages in bootconfig. Reviewed by: bcran, imp, tsoome Differential Revision: https://reviews.freebsd.org/D21930 Notes: svn path=/head/; revision=353335
* Rework UEFI ESP generationRebecca Cran2018-12-201-38/+1
| | | | | | | | | | | | | | | | Currently, the installer uses pre-created 800KB FAT12 filesystems that it dd's onto the ESP partition. This changeset improves that by having the installer generate a FAT32 filesystem directly onto the ESP using newfs_msdos and then copying loader.efi into /EFI/freebsd. For live installs it then runs efibootmgr to add a FreeBSD boot entry in the BIOS. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D17947 Notes: svn path=/head/; revision=342283
* Sort i18n messages in bsdinstall zfsbootDevin Teske2018-10-281-1/+1
| | | | | | | | | No functional change. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=339845
* Adjust for 80-columns.Devin Teske2018-10-281-4/+4
| | | | | | | | | No functional change. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=339830
* Adjust bsdinstall zfsboot code to 80-columns and whitespace fixesDevin Teske2018-10-261-47/+51
| | | | | | | | | No functional changes. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=339768
* bsdinstall/zfsboot: Enable new UEFI+GELI supportAllan Jude2018-08-231-9/+42
| | | | | | | | | | | | | | | | | | | After r336252 it is no longer necessary to have a separate bootpool when booting from an encrypted disk with UEFI. This change also switches the EFI System Partition contents from the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos and uses loader.efi directly, instead of boot1.efi. PR: 228916 Reviewed by: dteske MFC after: 1 month Relnotes: yes Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D12315 Notes: svn path=/head/; revision=338282
* bsdinstall: default to UEFI-only boot on arm64Ed Maste2017-07-301-9/+19
| | | | | | | | | Reviewed by: allanjude Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11721 Notes: svn path=/head/; revision=321734
* Fixed bsdinstall location of vfs.zfs.min_auto_ashiftSteven Hartland2017-06-201-1/+1
| | | | | | | | | | | | | | vfs.zfs.min_auto_ashift is a sysctl only not a tunable so updated bsdinstall to use the correct location /etc/sysctl.conf instead of /boot/loader.conf Reported by: Aaron Caza Reviewed by: allanjude MFC after: 2 days Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D11278 Notes: svn path=/head/; revision=320138
* bsdinstall: use consistent EFI configuration across platformsEd Maste2017-06-161-1/+1
| | | | | | | | | | | | | | | - increase arm64 EFI partition to 200M, as x86 - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86 - increase ZFS EFI partition to 200M PR: 201898 Reviewed by: allanjude, manu MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11239 Notes: svn path=/head/; revision=320007
* bsdinstall: Make ZFS min_auto_ashift adjustment persistentAllan Jude2017-06-121-0/+6
| | | | | | | | | | | Reported by: feld Reviewed by: dteske, tsoome MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D10895 Notes: svn path=/head/; revision=319863
* A failed installation once restarted will often error outAllan Jude2016-07-161-0/+9
| | | | | | | | | | | | | | | If an encrypted install is attempted and fails for any reason, the disk cannot be erased by the installer because the partition is in use by GELI At the start of the installation process, all ZFS pools are exported and all GELI instances are detached, to allow a restarted install to proceed PR: 210814 Reported by: jonathan MFC after: 10 days Notes: svn path=/head/; revision=302941
* Fix encrypted MBR installAllan Jude2016-07-161-1/+2
| | | | | | | | | | | | The pools are exported and reimported in order to write the bootcode This causes an error when the bootpool is later mounted by common code The bootpool is now imported with the -N flag to prevent mounting Reported by: Michael Dexter MFC after: 5 days Notes: svn path=/head/; revision=302940
* Fix an error in bsdinstall when ZFS installation uses a bootpoolAllan Jude2016-07-031-8/+11
| | | | | | | | | | | | | | | | | A separate bootpool is used when the selected partition type is MBR or when the disk is GELI encrypted and a UEFI loader is selected. BIOS avoids the bootpool by using bootcode and loader that support GELI. bsdinstall did not remount the bootpool after creating the main pool, which caused an error when mkdir tried to create /boot/zfs PR: 210717 Approved by: re (gjb) Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=302319
* Fix bsdinstall for root-on-zfs with MBR partitioningAllan Jude2016-06-101-9/+5
| | | | | | | | | | | | | | | Fix an error where vfs.root.mountfrom was not always set as required when creating a bootpool. After the recent geliboot changes, it was only set if the main pool was encrypted. Also resolve an error where the bootpool was unmounted twice causing bsdinstall to stop with an error message about the failed command. Approved by: re (gjb) Sponsored by: BSDCan Hacker Lounge Notes: svn path=/head/; revision=301787
* Only set kern.geom.part.mbr.enforce_chs=0 once, instead of once per diskAllan Jude2016-05-241-1/+1
| | | | | | | Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=300546
* Add support for RAID 1+0 (striped mirrors) to bsdinstall/zfsbootAllan Jude2016-05-241-5/+40
| | | | | | | Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=300545
* Only export and re-import the root pool if installing on MBRAllan Jude2016-05-231-22/+26
| | | | | | | | | This step is required in order to dd the boot2 bits into the ZFS partition Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=300523
* Fix missing pool name in zfs set commandAllan Jude2016-05-231-1/+1
| | | | Notes: svn path=/head/; revision=300521