aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/en/books/faq/_index.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/content/en/books/faq/_index.adoc')
-rw-r--r--documentation/content/en/books/faq/_index.adoc108
1 files changed, 54 insertions, 54 deletions
diff --git a/documentation/content/en/books/faq/_index.adoc b/documentation/content/en/books/faq/_index.adoc
index f613326964..654d55232c 100644
--- a/documentation/content/en/books/faq/_index.adoc
+++ b/documentation/content/en/books/faq/_index.adoc
@@ -337,7 +337,7 @@ After choosing the format and compression mechanism, download the compressed fil
For example, the split HTML version of the FAQ, compressed using man:bzip2[1], can be found in [.filename]#doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2# To download and uncompress that file, type:
-[source,bash]
+[source,shell]
....
# fetch https://download.freebsd.org/ftp/doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2
# tar xvf book.html-split.tar.bz2
@@ -445,14 +445,14 @@ If Windows(R) is installed first, then yes. FreeBSD's boot manager will then man
This depends upon the boot manager. The FreeBSD boot selection menu can be reinstalled using man:boot0cfg[8]. For example, to restore the boot menu onto the disk _ada0_:
-[source,bash]
+[source,shell]
....
# boot0cfg -B ada0
....
The non-interactive MBR bootloader can be installed using man:gpart[8]:
-[source,bash]
+[source,shell]
....
# gpart bootcode -b /boot/mbr ada0
....
@@ -576,7 +576,7 @@ See the complete list in the Hardware Notes for FreeBSD link:{u-rel121-hardware}
The default console driver, man:vt[4], provides the ability to use a mouse pointer in text consoles to cut & paste text. Run the mouse daemon, man:moused[8], and turn on the mouse pointer in the virtual console:
-[source,bash]
+[source,shell]
....
# moused -p /dev/xxxx -t yyyy
# vidcontrol -m on
@@ -627,7 +627,7 @@ bindkey ^[[3~ delete-char # for xterm
Some sound cards set their output volume to 0 at every boot. Run the following command every time the machine boots:
-[source,bash]
+[source,shell]
....
# mixer pcm 100 vol 100 cd 100
....
@@ -739,7 +739,7 @@ The computer has two or more clocks, and FreeBSD has chosen to use the wrong one
Run man:dmesg[8], and check for lines that contain `Timecounter`. The one with the highest quality value that FreeBSD chose.
-[source,bash]
+[source,shell]
....
# dmesg | grep Timecounter
Timecounter "i8254" frequency 1193182 Hz quality 0
@@ -750,7 +750,7 @@ Timecounters tick every 1.000 msec
Confirm this by checking the `kern.timecounter.hardware` man:sysctl[3].
-[source,bash]
+[source,shell]
....
# sysctl kern.timecounter.hardware
kern.timecounter.hardware: ACPI-fast
@@ -767,7 +767,7 @@ Or the BIOS may modify the TSC clock-perhaps to change the speed of the processo
In this example, the `i8254` clock is also available, and can be selected by writing its name to the `kern.timecounter.hardware` man:sysctl[3].
-[source,bash]
+[source,shell]
....
# sysctl kern.timecounter.hardware=i8254
kern.timecounter.hardware: TSC -> i8254
@@ -948,7 +948,7 @@ There are a number of possible causes for this problem:
The name of the scheduler currently being used is directly available as the value of the `kern.sched.name` sysctl:
-[source,bash]
+[source,shell]
....
% sysctl kern.sched.name
kern.sched.name: ULE
@@ -988,7 +988,7 @@ When the disks are formatted with UFS, never use anything but man:dump[8] and ma
For example, to move [.filename]#/dev/ada1s1a# with [.filename]#/mnt# as the temporary mount point, type:
-[source,bash]
+[source,shell]
....
# newfs /dev/ada1s1a
# mount /dev/ada1s1a /mnt
@@ -998,7 +998,7 @@ For example, to move [.filename]#/dev/ada1s1a# with [.filename]#/mnt# as the tem
Rearranging partitions with `dump` takes a bit more work. To merge a partition like [.filename]#/var# into its parent, create the new partition large enough for both, move the parent partition as described above, then move the child partition into the empty directory that the first move created:
-[source,bash]
+[source,shell]
....
# newfs /dev/ada1s1a
# mount /dev/ada1s1a /mnt
@@ -1010,7 +1010,7 @@ Rearranging partitions with `dump` takes a bit more work. To merge a partition l
To split a directory from its parent, say putting [.filename]#/var# on its own partition when it was not before, create both partitions, then mount the child partition on the appropriate directory in the temporary mount point, then move the old single partition:
-[source,bash]
+[source,shell]
....
# newfs /dev/ada1s1a
# newfs /dev/ada1s1d
@@ -1069,7 +1069,7 @@ FreeBSD includes the Network File System NFS and the FreeBSD Ports Collection pr
The secondary DOS partitions are found after _all_ the primary partitions. For example, if `E` is the second DOS partition on the second SCSI drive, there will be a device file for "slice 5" in [.filename]#/dev#. To mount it:
-[source,bash]
+[source,shell]
....
# mount -t msdosfs /dev/da1s5 /dos/e
....
@@ -1110,14 +1110,14 @@ This cannot be accomplished with the standard boot manager without rewriting it.
If the drive already has a file system on it, use a command like this:
-[source,bash]
+[source,shell]
....
# mount -t msdosfs /dev/da0s1 /mnt
....
If the drive will only be used with FreeBSD systems, partition it with UFS or ZFS. This will provide long filename support, improvement in performance, and stability. If the drive will be used by other operating systems, a more portable choice, such as msdosfs, is better.
-[source,bash]
+[source,shell]
....
# dd if=/dev/zero of=/dev/da0 count=2
# gpart create -s GPT /dev/da0
@@ -1126,14 +1126,14 @@ If the drive will only be used with FreeBSD systems, partition it with UFS or ZF
Finally, create a new file system:
-[source,bash]
+[source,shell]
....
# newfs /dev/da0p1
....
and mount it:
-[source,bash]
+[source,shell]
....
# mount /dev/da0s1 /mnt
....
@@ -1185,7 +1185,7 @@ By default, man:mount[8] will attempt to mount the last data track (session) of
As `root` set the sysctl variable `vfs.usermount` to `1`.
-[source,bash]
+[source,shell]
....
# sysctl vfs.usermount=1
....
@@ -1205,7 +1205,7 @@ For example, to allow users to mount the first USB drive add:
All users can now mount devices they could read onto a directory that they own:
-[source,bash]
+[source,shell]
....
% mkdir ~/my-mount-point
% mount -t msdosfs /dev/da0 ~/my-mount-point
@@ -1213,7 +1213,7 @@ All users can now mount devices they could read onto a directory that they own:
Unmounting the device is simple:
-[source,bash]
+[source,shell]
....
% umount ~/my-mount-point
....
@@ -1294,7 +1294,7 @@ Deduplication can also lead to some unexpected situations. In particular, deleti
This could happen because the pool is 100% full. ZFS requires space on the disk to write transaction metadata. To restore the pool to a usable state, truncate the file to delete:
-[source,bash]
+[source,shell]
....
% truncate -s 0 unimportant-file
....
@@ -1333,7 +1333,7 @@ The primary configuration file is [.filename]#/etc/defaults/rc.conf# which is de
For example, if to start man:named[8], the included DNS server:
-[source,bash]
+[source,shell]
....
# echo 'named_enable="YES"' >> /etc/rc.conf
....
@@ -1354,7 +1354,7 @@ This is normally caused by editing the system crontab. This is not the correct w
To delete the extra, incorrect crontab:
-[source,bash]
+[source,shell]
....
# crontab -r
....
@@ -1366,7 +1366,7 @@ This is a security feature. In order to `su` to `root`, or any other account wit
To allow someone to `su` to `root`, put them in the `wheel` group using `pw`:
-[source,bash]
+[source,shell]
....
# pw groupmod wheel -m lisa
....
@@ -1461,7 +1461,7 @@ If the root partition cannot be mounted from single-user mode, it is possible th
When using man:vt[4], the default console driver, this can be done by setting the following man:sysctl[8]:
-[source,bash]
+[source,shell]
....
# sysctl kern.vt.kbd_reboot=0
....
@@ -1471,7 +1471,7 @@ When using man:vt[4], the default console driver, this can be done by setting th
Use this man:perl[1] command:
-[source,bash]
+[source,shell]
....
% perl -i.bak -npe 's/\r\n/\n/g' file(s)
....
@@ -1480,7 +1480,7 @@ where _file(s)_ is one or more files to process. The modification is done in-pla
Alternatively, use man:tr[1]:
-[source,bash]
+[source,shell]
....
% tr -d '\r' < dos-text-file > unix-file
....
@@ -1494,7 +1494,7 @@ Yet another way to reformat DOS text files is to use the package:converters/dosu
Go into single-user mode and then back to multi-user mode:
-[source,bash]
+[source,shell]
....
# shutdown now
# return
@@ -1519,7 +1519,7 @@ Short answer: the security level is greater than 0. Reboot directly to single-us
Long answer: FreeBSD disallows changing system flags at security levels greater than 0. To check the current security level:
-[source,bash]
+[source,shell]
....
# sysctl kern.securelevel
....
@@ -1533,7 +1533,7 @@ Short answer: the system is at a security level greater than 1. Reboot directly
Long answer: FreeBSD disallows changing the time by more that one second at security levels greater than 1. To check the security level:
-[source,bash]
+[source,shell]
....
# sysctl kern.securelevel
....
@@ -1585,7 +1585,7 @@ There are a couple of kinds of "free memory". The most common is the amount of m
To see what man:newsyslog[8] will do, use the following:
-[source,bash]
+[source,shell]
....
% newsyslog -nrvv
....
@@ -1616,7 +1616,7 @@ Use package:x11/xorg-minimal[], which builds and installs only the necessary Xor
Install Xorg from FreeBSD packages:
-[source,bash]
+[source,shell]
....
# pkg install xorg
....
@@ -1663,7 +1663,7 @@ link sysmouse mouse
This link can be created by restarting man:devfs[5] with the following command (as `root`):
-[source,bash]
+[source,shell]
....
# service devfs restart
....
@@ -1734,7 +1734,7 @@ For security reasons, the default setting is to not allow a machine to remotely
To enable this feature, start X with the optional `-listen_tcp` argument:
-[source,bash]
+[source,shell]
....
% startx -listen_tcp
....
@@ -1847,7 +1847,7 @@ Assuming all Windows keyboards are standard, the keycodes for these three keys a
To have the left kbd:[Windows] key print a comma, try this.
-[source,bash]
+[source,shell]
....
# xmodmap -e "keycode 115 = comma"
....
@@ -1919,14 +1919,14 @@ Yes. For instructions on how to use NAT over a PPP connection, see the link:{han
If the alias is on the same subnet as an address already configured on the interface, add `netmask 0xffffffff` to this command:
-[source,bash]
+[source,shell]
....
# ifconfig ed0 alias 192.0.2.2 netmask 0xffffffff
....
Otherwise, specify the network address and netmask as usual:
-[source,bash]
+[source,shell]
....
# ifconfig ed0 alias 172.16.141.5 netmask 0xffffff00
....
@@ -1938,7 +1938,7 @@ More information can be found in the FreeBSD link:{handbook}#configtuning-virtua
Some versions of the Linux(R) NFS code only accept mount requests from a privileged port; try to issue the following command:
-[source,bash]
+[source,shell]
....
# mount -o -P linuxbox:/blah /mnt
....
@@ -1965,7 +1965,7 @@ If the kernel is compiled with the `IPFIREWALL` option, be aware that the defaul
If the firewall is unintentionally misconfigured, restore network operability by typing the following as `root`:
-[source,bash]
+[source,shell]
....
# ipfw add 65534 allow all from any to any
....
@@ -1979,7 +1979,7 @@ For further information on configuring this firewall, see the link:{handbook}#fi
Possibly because network address translation (NAT) is needed instead of just forwarding packets. A "fwd" rule only forwards packets, it does not actually change the data inside the packet. Consider this rule:
-[source,bash]
+[source,shell]
....
01000 fwd 10.0.0.1 from any to foo 21
....
@@ -2030,14 +2030,14 @@ This kernel message indicates that some activity is provoking it to send a large
The first number in the message indicates how many packets the kernel would have sent if the limit was not in place, and the second indicates the limit. This limit is controlled using `net.inet.icmp.icmplim`. This example sets the limit to `300` packets per second:
-[source,bash]
+[source,shell]
....
# sysctl net.inet.icmp.icmplim=300
....
To disable these messages without disabling response limiting, use `net.inet.icmp.icmplim_output` to disable the output:
-[source,bash]
+[source,shell]
....
# sysctl net.inet.icmp.icmplim_output=0
....
@@ -2059,7 +2059,7 @@ A packet is coming from outside the network unexpectedly. To disable them, set `
Configure your kernel with these settings:
-[source,bash]
+[source,shell]
....
include GENERIC
ident GENERIC-IPV6ONLY
@@ -2109,7 +2109,7 @@ A UNIX(R) process is owned by a particular userid. If the user ID is not the `ro
To check the status of the securelevel on a running system:
-[source,bash]
+[source,shell]
....
# sysctl -n kern.securelevel
....
@@ -2152,7 +2152,7 @@ See link:{handbook}#serialconsole-setup/[this section of the Handbook].
As the FreeBSD kernel boots, it will probe for the serial ports for which the kernel is configured. Either watch the boot messages closely or run this command after the system is up and running:
-[source,bash]
+[source,shell]
....
% grep -E '^(sio|uart)[0-9]' < /var/run/dmesg.boot
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
@@ -2215,7 +2215,7 @@ The built-in man:tip[1] and man:cu[1] utilities can only access the [.filename]#
Alternatively, everyone can be configured to run man:tip[1] and man:cu[1] by typing:
-[source,bash]
+[source,shell]
....
# chmod 4511 /usr/bin/cu
# chmod 4511 /usr/bin/tip
@@ -2241,7 +2241,7 @@ The simple answer is that free memory is wasted memory. Any memory that programs
Symlinks do not have permissions, and by default, man:chmod[1] will follow symlinks to change the permissions on the source file, if possible. For the file, [.filename]#foo# with a symlink named [.filename]#bar#, this command will always succeed.
-[source,bash]
+[source,shell]
....
% chmod g-w bar
....
@@ -2255,7 +2255,7 @@ When changing modes of the file hierarchies rooted in the files instead of the f
`-R` does a _recursive_ man:chmod[1]. Be careful about specifying directories or symlinks to directories to man:chmod[1]. To change the permissions of a directory referenced by a symlink, use man:chmod[1] without any options and follow the symlink with a trailing slash ([.filename]#/#). For example, if [.filename]#foo# is a symlink to directory [.filename]#bar#, to change the permissions of [.filename]#foo# (actually [.filename]#bar#), do something like:
-[source,bash]
+[source,shell]
....
% chmod 555 foo/
....
@@ -2517,14 +2517,14 @@ To proceed:
. Write down the instruction pointer value. Note that the `0x8:` part at the beginning is not significant in this case: it is the `0xf0xxxxxx` part that we want.
. When the system reboots, do the following:
+
-[source,bash]
+[source,shell]
....
% nm -n kernel.that.caused.the.panic | grep f0xxxxxx
....
+
where `f0xxxxxx` is the instruction pointer value. The odds are you will not get an exact match since the symbols in the kernel symbol table are for the entry points of functions and the instruction pointer address will be somewhere inside a function, not at the start. If you do not get an exact match, omit the last digit from the instruction pointer value and try again:
+
-[source,bash]
+[source,shell]
....
% nm -n kernel.that.caused.the.panic | grep f0xxxxx
....
@@ -2547,21 +2547,21 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
. Change to the [.filename]#/usr/src# directory:
+
-[source,bash]
+[source,shell]
....
# cd /usr/src
....
. Compile the kernel:
+
-[source,bash]
+[source,shell]
....
# make buildkernel KERNCONF=MYKERNEL
....
. Wait for man:make[1] to finish compiling.
+
-[source,bash]
+[source,shell]
....
# make installkernel KERNCONF=MYKERNEL
....
@@ -2585,7 +2585,7 @@ FreeBSD crash dumps are usually the same size as physical RAM. Therefore, make s
Once the crash dump has been recovered , get a stack trace as follows:
-[source,bash]
+[source,shell]
....
% kgdb /usr/obj/usr/src/sys/MYKERNEL/kernel.debug /var/crash/vmcore.0
(kgdb) backtrace