FreeBSD Recover GTP Table

Recently one of my servers that runs FreeBSD 11.1 keeps hanging on boot. Usually, the 2nd hard reboot will fix it. The root file system on this server is using ZFS and the ZFS pool report it as healthy. So I’ve been reluctant to do anything about it. Until tonight, when I accidentally list the partition of that drive (ada4): Ahh.. [CORRUPT] partition table it seems. I think the reason the server can still boot because GPT keeps the partition tables in two places (yes, one of the more reason to use GPT over MBR)....

February 3, 2018 · 1 min · 127 words · kenno

How to unban IP from PF firewall

This post is probably more relevant to my use case of PF firewall running on FreeBSD 11.1, and I need to remind myself how to unblock an IP from the block list. Here’s a snippet of what’s in /etc/pf.conf: table persist # Don't send rejections. Just drop. set block-policy drop # Exempt the loopback interface to prevent services utilizing the # local loop from being blocked accidentally. set skip on lo0 # all incoming traffic on external interface is normalized and fragmented # packets are reassembled....

November 17, 2017 · 2 min · 269 words · kenno

Changing a User’s Password on FreeBSD

Before getting into how to change a user’s password on FreeBSD, let’s have a quick revision on how that can be done on a Linux system. As a user we can change the password by typing: Or with a root account, we can change/set the password for another user: How about a FreeBSD? It should be the same way as how it’s done on Linux right? Right? Well, not quite....

January 10, 2017 · 1 min · 114 words · kenno

FreeBSD 11 Blank Screen After Login via SLiM

After rebooting my FreeBSD 11.0, I wasn’t able to login to Mate desktop manager via SLiM (Login Manager). I spent sometimes to try to fix it, but failed. I’ll try it again later when I have a bit of free time. Here’s a quick note of a work around, so I won’t forget what I’ve done. Disable loading slim on start up by editing /etc/rc.conf and commented out the following line: Run this command manually to start mate-session: So, it appears SLiM is the culprit here since Mate-session can be started up manually....

January 9, 2017 · 1 min · 93 words · kenno

FreeBSD upgrade pool zroot

Today I successfully upgraded my FreeBSD home nas server from 10.3 to 11.0. This is the final release of version 11.0, though the official announcement is expected to be made on September 28. After the system upgrade, I need to also upgrade the 2 zpools (tank and zroot) so they can have new features. Upgrading tank was easy, all I needed to do was running this command: # zpool upgrade tank This system supports ZFS pool feature flags....

September 27, 2016 · 2 min · 288 words · kenno

Fix corrupted GPT on FreeBSD

One of the disks in my FreeBSD server reported an issue: Jul 14 18:00:56 nas kernel: GEOM: da0: the primary GPT table is corrupt or invalid. Jul 14 18:00:56 nas kernel: GEOM: da0: using the secondary instead -- recovery strongly advised. Jul 14 18:00:56 nas kernel: GEOM: diskid/DISK-67304734999999999999: the primary GPT table is corrupt or invalid. Jul 14 18:00:56 nas kernel: GEOM: diskid/DISK-67304734999999999999: using the secondary instead -- recovery strongly advised....

July 14, 2016 · 2 min · 235 words · kenno

FreeBSD git fatal: Unable to find remote helper for 'https'

I just found out that git is not fully functional on my FreeBSD (11) box. It was installed from port (using portmaster git). I can clone a repo using SSH key, but not with HTTPS. I’m not quite sure if it’s always been this way. Here is how to fix it: Reinstall curl # pkg remove curl # portmaster curl Reinstall git # pkg remove git # portmaster git Why did I install git from port?...

July 1, 2016 · 1 min · 94 words · kenno

Installing Pip with Python 3.5 on FreeBSD

Here is a quick note serves as a self-reminder on how to get pip working or installed on FreeBSD 10.3. First, ensure that Python 3 package is installed. Python 3 is provided by python35 package. # pkg install python35 However, there is no package for pip, at least at the time of this writing, on FreeBSD. To have it installed, run the following command: # python3.5 -m ensurepip We should as well update pip to new version:...

May 6, 2016 · 1 min · 84 words · kenno

Mouse not working in Xorg on FreeBSD

After installing Mate desktop environment on a fresh FreeBSD 10.2 box, mouse was not working. This is what I have in my /etc/rc.conf: ... moused_enable="YES" hald_enable="YES" dbus_enable="YES" Some suggests that the order of hald and dbus to be swapped around. I tried that, and it still didn’t work. A bit of more Googlings, I found out a working solution [1]. I need to install: xf86-input-mouse. Here’s how I did it:...

February 19, 2016 · 1 min · 105 words · kenno

PF firewall rule for DNS server

A reminder to readers, most of these blog posts are to remind me what I have done or fixed some problems. What works for me may not work for you. Most of the time, they aren’t even the best practice. Here’s a snippet of the PF firewall rule on my FreeBSD box which acts as a DNS server. Basically, the firewall opens up UDP port 53 to allow LAN access it....

July 9, 2015 · 1 min · 131 words · kenno