diff --git a/release/powerpc/generate-hfs.sh b/release/powerpc/generate-hfs.sh index 50f77933f273..e88db0ad771e 100755 --- a/release/powerpc/generate-hfs.sh +++ b/release/powerpc/generate-hfs.sh @@ -1,61 +1,61 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # # Because of licensing concerns, and because it is overkill, we do not # distribute hfsutils as a build tool. If you need to regenerate the HFS # template (e.g. because the boot block or the CHRP script have grown), # you must install it from ports. HFS_SIZE=400 #Size in 2048-byte blocks of the produced image LOADER_SIZE=500k # Generate 800K HFS image OUTPUT_FILE=hfs-boot dd if=/dev/zero of=$OUTPUT_FILE bs=2048 count=$HFS_SIZE hformat -l "FreeBSD Install" $OUTPUT_FILE hmount $OUTPUT_FILE # Create and bless a directory for the boot loader hmkdir ppc hattrib -b ppc hcd ppc # Make the CHRP boot script, which gets loader from the ISO9660 partition cat > bootinfo.txt << EOF FreeBSD/powerpc bootloader FreeBSD $FreeBSD: head/stand/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10 -31 00:52:31Z nwhitehorn $ MacRISC MacRISC3 MacRISC4 " screen" output boot &device;:,\ppc\loader &device;:0 EOF echo 'Loader START' | dd of=loader.tmp cbs=$LOADER_SIZE count=1 conv=block hcopy bootinfo.txt :bootinfo.txt hcopy loader.tmp :loader hattrib -c chrp -t tbxi bootinfo.txt humount rm bootinfo.txt rm loader.tmp bzip2 $OUTPUT_FILE echo 'HFS boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu rm $OUTPUT_FILE.bz2 diff --git a/share/man/man4/ccd.4 b/share/man/man4/ccd.4 index 9727fb68064f..0c2bc99682a0 100644 --- a/share/man/man4/ccd.4 +++ b/share/man/man4/ccd.4 @@ -1,284 +1,284 @@ .\" $NetBSD: ccd.4,v 1.5 1995/10/09 06:09:09 thorpej Exp $ .\" .\" Copyright (c) 1994 Jason Downs. .\" Copyright (c) 1994, 1995 Jason R. Thorpe. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project .\" by Jason Downs and Jason R. Thorpe. .\" 4. Neither the name of the author nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd January 23, 2025 .Dt CCD 4 .Os .Sh NAME .Nm ccd .Nd Concatenated Disk driver .Sh SYNOPSIS .Cd "device ccd" .Sh DESCRIPTION The .Nm driver provides the capability of combining one or more disks/partitions into one virtual disk. .Pp This document assumes that you are familiar with how to generate kernels, how to properly configure disks and devices in a kernel configuration file, and how to partition disks. .Pp In order to compile in support for the .Nm , you must add a line similar to the following to your kernel configuration file: .Pp .Dl "device ccd # concatenated disk devices" .Pp As of the .Fx 3.0 release, you do not need to configure your kernel with .Nm but may instead use it as a kernel loadable module. Simply running .Xr ccdconfig 8 will load the module into the kernel. .Pp A .Nm may be either serially concatenated or interleaved. To serially concatenate the partitions, specify the interleave factor of 0. Note that mirroring may not be used with an interleave factor of 0. .Pp There is a run-time utility that is used for configuring .Nm Ns s . See .Xr ccdconfig 8 for more information. .Ss The Interleave Factor If a .Nm is interleaved correctly, a .Dq striping effect is achieved, which can increase sequential read/write performance. The interleave factor is expressed in units of .Dv DEV_BSIZE (usually 512 bytes). For large writes, the optimum interleave factor is typically the size of a track, while for large reads, it is about a quarter of a track. (Note that this changes greatly depending on the number and speed of disks.) For instance, with eight 7,200 RPM drives on two Fast-Wide SCSI buses, this translates to about 128 for writes and 32 for reads. A larger interleave tends to work better when the disk is taking a multitasking load by localizing the file I/O from any given process onto a single disk. You lose sequential performance when you do this, but sequential performance is not usually an issue with a multitasking load. .Pp An interleave factor must be specified when using a mirroring configuration, even when you have only two disks (i.e., the layout winds up being the same no matter what the interleave factor). The interleave factor will determine how I/O is broken up, however, and a value 128 or greater is recommended. .Pp .Nm has an option for a parity disk, but does not currently implement it. .Pp The best performance is achieved if all component disks have the same geometry and size. Optimum striping cannot occur with different disk types. .Pp For random-access oriented workloads, such as news servers, a larger interleave factor (e.g., 65,536) is more desirable. Note that there is not much .Nm can do to speed up applications that are seek-time limited. Larger interleave factors will at least reduce the chance of having to seek two disk-heads to read one directory or a file. .Ss Disk Mirroring You can configure the .Nm to .Dq mirror any even number of disks. See .Xr ccdconfig 8 for how to specify the necessary flags. For example, if you have a .Nm configuration specifying four disks, the first two disks will be mirrored with the second two disks. A write will be run to both sides of the mirror. A read will be run to either side of the mirror depending on what the driver believes to be most optimal. If the read fails, the driver will automatically attempt to read the same sector from the other side of the mirror. Currently .Nm uses a dual seek zone model to optimize reads for a multi-tasking load rather than a sequential load. .Pp In an event of a disk failure, you can use .Xr dd 1 to recover the failed disk. .Pp Note that a one-disk .Nm is not the same as the original partition. In particular, this means if you have a file system on a two-disk mirrored .Nm and one of the disks fail, you cannot mount and use the remaining partition as itself; you have to configure it as a one-disk .Nm . You cannot replace a disk in a mirrored .Nm partition without first backing up the partition, then replacing the disk, then restoring the partition. .Ss Linux Compatibility The .Tn Linux compatibility mode does not try to read the label that .Tn Linux Ns ' .Xr md 4 driver leaves on the raw devices. You will have to give the order of devices and the interleave factor on your own. When in .Tn Linux compatibility mode, .Nm will convert the interleave factor from .Tn Linux terminology. That means you give the same interleave factor that you gave as chunk size in .Tn Linux . .Pp If you have a .Tn Linux .Xr md 4 device in .Dq legacy mode, do not use the .Dv CCDF_LINUX flag in .Xr ccdconfig 8 . Use the .Dv CCDF_NO_OFFSET flag instead. In that case you have to convert the interleave factor on your own, usually it is .Tn Linux Ns ' chunk size multiplied by two. .Pp Using a .Tn Linux RAID this way is potentially dangerous and can destroy the data in there. Since .Fx does not read the label used by .Tn Linux , changes in .Tn Linux might invalidate the compatibility layer. .Pp However, using this is reasonably safe if you test the compatibility before mounting a RAID read-write for the first time. Just using .Xr ccdconfig 8 without mounting does not write anything to the .Tn Linux RAID. Then you do a -.Nm fsck.ext2fs Pq Pa ports/sysutils/e2fsprogs +.Nm fsck.ext2fs Pq Pa ports/filesystems/e2fsprogs on the .Nm device using the .Fl n flag. You can mount the file system read-only to check files in there. If all this works, it is unlikely that there is a problem with .Nm . Keep in mind that even when the .Tn Linux compatibility mode in .Nm is working correctly, bugs in .Fx Ap s .Nm ex2fs implementation would still destroy your data. .Sh WARNINGS If just one (or more) of the disks in a .Nm fails, the entire file system will be lost unless you are mirroring the disks. .Pp If one of the disks in a mirror is lost, you should still be able to back up your data. If a write error occurs, however, data read from that sector may be non-deterministic. It may return the data prior to the write or it may return the data that was written. When a write error occurs, you should recover and regenerate the data as soon as possible. .Pp Changing the interleave or other parameters for a .Nm disk usually destroys whatever data previously existed on that disk. .Sh FILES .Bl -tag -width ".Pa /dev/ccd*" .It Pa /dev/ccd* .Nm device special files .El .Sh SEE ALSO .Xr dd 1 , .Xr ccdconfig 8 , .Xr config 8 , .Xr disklabel 8 , .Xr fsck 8 , .Xr mount 8 , .Xr newfs 8 .Sh HISTORY The concatenated disk driver was originally written at the University of Utah. diff --git a/share/man/man4/smbfs.4 b/share/man/man4/smbfs.4 index f60a9618bc3f..df64bdc3884f 100644 --- a/share/man/man4/smbfs.4 +++ b/share/man/man4/smbfs.4 @@ -1,99 +1,99 @@ .\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2020 Gordon Bergling .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd April 6, 2022 .Dt SMBFS 4 .Os .Sh NAME .Nm smbfs .Nd server message block (SMB1/CIFS) file system .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "option NETSMB" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent smbfs_load="YES" .Ed .Sh DESCRIPTION The SMB driver is an implementation of the CIFS (Common Internet Filesystem) network protocol. .Pp .Bf -symbolic The .Nm filesystem driver supports only the obsolete SMBv1 protocol. .Nm has known bugs and likely has security vulnerabilities. .Nm and userspace counterparts .Xr smbutil 1 and .Xr mount_smbfs 8 may be removed from a future version of .Fx . Users are advised to evaluate the -.Pa sysutils/fusefs-smbnetfs +.Pa filesystems/smbnetfs port instead. .Ef .Sh SEE ALSO .Xr smbutil 1 , .Xr mount_smbfs 8 .Sh STANDARDS .Rs .%U https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/ .%T Common Internet File System (CIFS) Protocol .%R MS-CIFS .%D December 2018 .Re .Pp .Rs .%U https://tools.ietf.org/html/draft-heizer-cifs-v1-spec-00 .%T Common Internet File System Protocol (CIFS/1.0) .%D June 13, 1996 .%A I. Heizer .%A P. Leach .%A D. Perry .Re .Sh HISTORY The .Nm device driver first appeared in .Fx 4.4 . .Sh AUTHORS .An -nosplit The .Nm device driver was written by .An Boris Popov Aq Mt bp@FreeBSD.org . The manual page was contributed by .An Gordon Bergling Aq Mt gbe@FreeBSD.org . diff --git a/stand/powerpc/boot1.chrp/generate-hfs.sh b/stand/powerpc/boot1.chrp/generate-hfs.sh index c83306ed885d..dc2b12d8f826 100755 --- a/stand/powerpc/boot1.chrp/generate-hfs.sh +++ b/stand/powerpc/boot1.chrp/generate-hfs.sh @@ -1,60 +1,60 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # # Because of licensing concerns, and because it is overkill, we do not # distribute hfsutils as a build tool. If you need to regenerate the HFS # template (e.g. because the boot block or the CHRP script have grown), # you must install it from ports. HFS_SIZE=1600 #Size in 512-byte blocks of the produced image CHRPBOOT_SIZE=2k BOOT1_SIZE=64k # Generate 800K HFS image OUTPUT_FILE=hfs.tmpl dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$HFS_SIZE hformat -l "FreeBSD Bootstrap" $OUTPUT_FILE hmount $OUTPUT_FILE # Create and bless a directory for the boot loader hmkdir ppc hattrib -b ppc hcd ppc # Make two dummy files for the CHRP boot script and boot1 echo 'Bootinfo START' | dd of=bootinfo.txt.tmp cbs=$CHRPBOOT_SIZE count=1 conv=block echo 'Boot1 START' | dd of=boot1.elf.tmp cbs=$BOOT1_SIZE count=1 conv=block hcopy boot1.elf.tmp :boot1.elf hcopy bootinfo.txt.tmp :bootinfo.txt hattrib -c chrp -t tbxi bootinfo.txt humount rm bootinfo.txt.tmp rm boot1.elf.tmp # Locate the offsets of the two fake files BOOTINFO_OFFSET=$(hd $OUTPUT_FILE | grep 'Bootinfo START' | cut -f 1 -d ' ') BOOT1_OFFSET=$(hd $OUTPUT_FILE | grep 'Boot1 START' | cut -f 1 -d ' ') # Convert to numbers of blocks BOOTINFO_OFFSET=$(echo 0x$BOOTINFO_OFFSET | awk '{printf("%x\n",$1/512);}') BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}') echo '# This file autogenerated by generate-hfs.sh - DO NOT EDIT' > Makefile.hfs echo "BOOTINFO_OFFSET=0x$BOOTINFO_OFFSET" >> Makefile.hfs echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.hfs bzip2 $OUTPUT_FILE echo 'HFS template boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu rm $OUTPUT_FILE.bz2 diff --git a/tools/test/stress2/misc/ext2fs.sh b/tools/test/stress2/misc/ext2fs.sh index f4d33116faed..e93da12419b0 100755 --- a/tools/test/stress2/misc/ext2fs.sh +++ b/tools/test/stress2/misc/ext2fs.sh @@ -1,57 +1,57 @@ #!/bin/sh # # Copyright (c) 2012 Peter Holm # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Deadlock seen: http://people.freebsd.org/~pho/stress/log/ext2fs.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart mke2fs -m 0 /dev/md$mdstart > /dev/null mount -t ext2fs /dev/md$mdstart $mntpoint chmod 777 $mntpoint export runRUNTIME=10m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart diff --git a/tools/test/stress2/misc/ext2fs2.sh b/tools/test/stress2/misc/ext2fs2.sh index 748e45a33ffa..07ff5d5058fb 100755 --- a/tools/test/stress2/misc/ext2fs2.sh +++ b/tools/test/stress2/misc/ext2fs2.sh @@ -1,56 +1,56 @@ #!/bin/sh # # Copyright (c) 2014 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # "panic: ext2_dirbad: /mnt: bad dir ino ...: mangled entry" seen. # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191895 . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -x /usr/local/sbin/mke2fs ] || exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount -f $mntpoint mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart gpart create -s bsd md$mdstart > /dev/null gpart add -t freebsd-ufs md$mdstart > /dev/null mke2fs /dev/md${mdstart}a # No panic seen when disabling hashed b-tree lookup for large directories # tune2fs -O ^dir_index /dev/md$mdstart mount -t ext2fs /dev/md${mdstart}a $mntpoint export RUNDIR=$mntpoint/stressX export runRUNTIME=10m # Run tests for 10 minutes (cd ..; ./run.sh disk.cfg) while mount | grep "$mntpoint " | grep -q md$mdstart; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart diff --git a/tools/test/stress2/misc/ext2fs3.sh b/tools/test/stress2/misc/ext2fs3.sh index fd129a235102..5c904d218a5f 100755 --- a/tools/test/stress2/misc/ext2fs3.sh +++ b/tools/test/stress2/misc/ext2fs3.sh @@ -1,68 +1,68 @@ #!/bin/sh # # Copyright (c) 2017 Dell EMC Isilon # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # ext2fs(4) test scenario with a 1k block size # "panic: ext2_reallocblks: alloc mismatch" seen. # "Fatal trap 12: page fault while in kernel mode" seen. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -r /usr/src/tools/regression/fsx/fsx.c ] || exit 0 . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 dir=/tmp odir=`pwd` cd $dir cc -o fsx -Wall -Wextra -O2 -g /usr/src/tools/regression/fsx/fsx.c || exit 1 rm -f fsx.c cd $odir mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart mke2fs -m 0 -b 1024 /dev/md$mdstart > /dev/null mount -t ext2fs /dev/md$mdstart $mntpoint chmod 777 $mntpoint cp /tmp/fsx $mntpoint cd $mntpoint ./fsx -S 2016 -N 2000 ./TEST_FILE cd $here while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart exit 0 diff --git a/tools/test/stress2/misc/ext3fs.sh b/tools/test/stress2/misc/ext3fs.sh index e5a0d9a09481..210008ce3942 100755 --- a/tools/test/stress2/misc/ext3fs.sh +++ b/tools/test/stress2/misc/ext3fs.sh @@ -1,61 +1,61 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2018 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Simple ext3 test. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart mke2fs -t ext3 -m 0 -b 2048 /dev/md$mdstart > /dev/null mount -t ext2fs /dev/md$mdstart $mntpoint || exit 1 chmod 777 $mntpoint export runRUNTIME=5m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' & sleep 300 ../tools/killall.sh wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart diff --git a/tools/test/stress2/misc/ext4fs.sh b/tools/test/stress2/misc/ext4fs.sh index ac5656ed7be0..2e2ac8d77440 100755 --- a/tools/test/stress2/misc/ext4fs.sh +++ b/tools/test/stress2/misc/ext4fs.sh @@ -1,64 +1,64 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2018 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Simple ext4 test. # "panic: buf_vlist_add: Preallocated nodes insufficient" seen: # https://people.freebsd.org/~pho/stress/log/mjguzik036.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart mke2fs -t ext4 -m 0 -b 2048 /dev/md$mdstart > /dev/null mount -t ext2fs /dev/md$mdstart $mntpoint || exit 1 chmod 777 $mntpoint export runRUNTIME=5m export RUNDIR=$mntpoint/stressX su $testuser -c 'cd ..; ./run.sh marcus.cfg' & sleep 300 ../tools/killall.sh wait while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart diff --git a/usr.sbin/autofs/autofs/special_media b/usr.sbin/autofs/autofs/special_media index b397a8889623..917abae05595 100755 --- a/usr.sbin/autofs/autofs/special_media +++ b/usr.sbin/autofs/autofs/special_media @@ -1,138 +1,138 @@ #!/bin/sh # # # Print newline-separated list of devices available for mounting. # If there is a filesystem label - use it, otherwise use device name. print_available() { local _fstype _fstype_and_label _label _p for _p in ${providers}; do _fstype_and_label="$(fstyp -l "/dev/${_p}" 2> /dev/null)" if [ $? -ne 0 ]; then # Ignore devices for which we were unable # to determine filesystem type. continue fi _fstype="${_fstype_and_label%% *}" if [ "${_fstype}" != "${_fstype_and_label}" ]; then _label="${_fstype_and_label#* }" # Replace plus signs and slashes with minuses; # leading plus signs have special meaning in maps, # and multi-component keys are just not supported. _label="$(echo ${_label} | sed 's,[+/],-,g')" echo "${_label}" continue fi echo "${_p}" done } # Print a single map entry. print_map_entry() { local _fstype _p _fstype="$1" _p="$2" case "${_fstype}" in "exfat") if [ -f "/usr/local/sbin/mount.exfat" ]; then echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/exfat first" exit 1 fi ;; "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/ntfs first" exit 1 fi ;; "msdosfs") echo "-fstype=${_fstype},sync :/dev/${_p}" ;; "ext2fs") echo "-fstype=${_fstype},async :/dev/${_p}" ;; *) echo "-fstype=${_fstype} :/dev/${_p}" ;; esac } # Determine map entry contents for the given key and print out the entry. print_one() { local _fstype _fstype_and_label _label _key _p _key="$1" _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" if [ $? -eq 0 ]; then print_map_entry "${_fstype}" "${_key}" return fi for _p in ${providers}; do _fstype_and_label="$(fstyp -l "/dev/${_p}" 2> /dev/null)" if [ $? -ne 0 ]; then # Ignore devices for which we were unable # to determine filesystem type. continue fi _fstype="${_fstype_and_label%% *}" if [ "${_fstype}" = "${_fstype_and_label}" ]; then # No label, try another device. continue fi _label="${_fstype_and_label#* }" # Replace plus signs and slashes with minuses; # leading plus signs have special meaning in maps, # and multi-component keys are just not supported. _label="$(echo ${_label} | sed 's,[+/],-,g')" if [ "${_label}" != "${_key}" ]; then # Labels don't match, try another device. continue fi print_map_entry "${_fstype}" "${_p}" done # No matching device - don't print anything, autofs will handle it. } # Obtain a list of (geom-provider-name, access-count) pairs, turning this: # # z0xfffff80005085d00 [shape=hexagon,label="ada0\nr2w2e3\nerr#0\nsector=512\nstripe=0"]; # # Into this: # # ada0 r2w2e3 # # XXX: It would be easier to use kern.geom.conftxt instead, but it lacks # access counts. pairs=$(sysctl kern.geom.confdot | sed -n 's/^.*hexagon,label="\([^\]*\)\\n\([^\]*\).*/\1 \2/p') # Obtain a list of GEOM providers that are not already open - not mounted, # and without other GEOM class, such as gpart, attached. In other words, # grep for "r0w0e0". Skip providers with names containing slashes; we're # not interested in geom_label(4) creations. providers=$(echo "$pairs" | awk '$2 == "r0w0e0" && $1 !~ /\// { print $1 }') if [ $# -eq 0 ]; then print_available exit 0 fi print_one "$1" exit 0