About the author

My name is Solène Rapenne. I like to learn and share my knowledge with other. With this blog I can share my experiences and issues. Some of my interests : '(BSD OpenBSD h+ Lisp Emacs cli-tool gaming internet-infrastructure Crossbow). I love % and lambda characters. OpenBSD Developer solene@.

Contact : solene on Freenode or solene+www at dataswamp dot org

This website is generated using cl-yag. A gopher version is available here

If you like what I write, you can give me a tip at donate at perso dot pw through Paypal.

Display manually installed packages on FreeBSD

Written by Solène, on 16 August 2017.
Tags: #freebsd

If you want to show the packages installed manually (and not installed as dependency of another package), you have to use “pkg query” and compare if %a (automatically installed == 1) isn’t 1. The second string will format the output to display the package name:

$ pkg query -e "%a != 1" "%n"

FreeBSD and Perc H720P Mini raid controller

Written by Solène, on 25 May 2016.
Tags: #freebsd #hardware

I had a problem with my 3 latests R430 Dell server which all have a PERC H730P Mini raid controller. The installer could barely works and slowly, and 2 servers were booting and crashing with FS corruption while the latest just didn’t boot and the raid was cleared.

It is a problem with a driver of the raid controller. I don’t understand exatly the problem but I found a fix.

From man page mfi(4)

A tunable is provided to adjust the mfi driver's behaviour when attaching
to a card.  By default the driver will attach to all known cards with
high probe priority.  If the tunable hw.mfi.mrsas_enable is set to 1,
then the driver will reduce its probe priority to allow mrsas to attach
to the card instead of mfi.

In order to install the system, you have to set hw.mfi.mrsas_enable=1 on the install media, and set this on the installed system before booting it.

There are two ways for that:

  • if you use a usb media, you can mount it and edit /boot/loader.conf and add hw.mfi.mrsas_enable=1
  • at the boot screen with the logo freebsd, choose 3) Espace to boot prompt, type set hw.mfi.mrsas_enable=1 and boot

You will have to edit /boot/loader.conf to add the line on the installed system from the live system of the installer.

I have been struggling a long before understanding the problem. I hope this message could save time to somebody else.

Resize live UFS filesystem

Written by Solène, on 17 May 2016.
Tags: #freebsd

I am using FreeBSD in virtual machines and sometimes I need to increase the disk capacity of the storage. From your VM Host, increase the capacity of the storage backend, then on the FreeBSD system (10.3 when writing), you should see this in the last line of dmesg.

GEOM_PART: vtbd0 was automatically resized.
  Use `gpart commit vtbd0` to save changes or `gpart undo vtbd0` to revert them.

Here is the gpart show output on the system:

>       34  335544253  vtbd0  GPT  (160G)
        34       1024      1  freebsd-boot  (512K)
      1058  159382528      2  freebsd-ufs  (76G)
 159383586    8388540      3  freebsd-swap  (4.0G)
 167772126  167772161         - free -  (80G)

The process is a bit harder here because I have my partition swap at the end of the storage, so if I want to increase the size of the ufs partition, I will need to remove the swap partition, increase the data partition and recreate the swap. This is not that hard but having the freebsd-ufs partition at the end would have been easier.

  1. swapoff the device : swapoff /dev/vtbd0p3
  2. delete the swap partition : gpart delete -i 3 vtbd0
  3. resize the freebsd-ufs partition : gpart resize -i 2 -a 4k -s 156G vtbd0
  4. create the swap : gpart add -t freebsd-swap -a 4k vtbd0
  5. swapon : swapon /dev/vtbd0p3
  6. tell UFS to resize : growfs /

If freebsd-ufs was the latest in the gpart order, only steps 3 and 6 would have been necessary.

Sources: FreeBSD Handbook and gpart(8)

How to add a route through a specific interface on FreeBSD

Written by Solène, on 02 May 2016.
Tags: #freebsd #network

If someday under FreeBSD you have a system with multiple IP address on the same network and you need to use a specific IP for a route, you have to use the -ifa parameter in the route command.

In our example, we have to use the address 192.168.1.140 to access the network 192.168.30.0 through the router 192.168.1.1, this is as easy as the following.

route add -net 192.168.30.0 192.168.1.1 -ifa 192.168.1.140

You can add this specific route like any other route in your rc.conf as usual, just add the -ifa X.X.X.X parameter.