Create a FreeBSD install disk with dd on OS X

I need to create a bootable FreeBSD install disk and the downloaded file happened to be on a Mac laptop. Since OS X is based on BSD, it also comes with dd utility. After a USB is inserted, I need to identify the disk. This can be done using diskutil command: $ sudo diskutil list /dev/disk0 (internal): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme 251.0 GB disk0 1: EFI EFI 314.6 MB disk0s1 2: Apple_APFS Container disk1 250.7 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.7 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 98.6 GB disk1s1 2: APFS Volume Preboot 21.4 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *2.1 GB disk2 1: Apple_partition_map 4.1 KB disk2s1 2: Apple_HFS 2.4 MB disk2s2 From the above output, the USB drive is /dev/disk2. Now, I can use dd to copy the image file to the USB drive using the following command: ...

February 9, 2018 · 1 min · 199 words · kenno

MySQL server has gone away – how to get it back

Has MySQL/MariaDB server ever run away from you? If it hasn’t, you’re lucky or you’re likely to use PostgreSQL instead. Today I’m trying to restore a database from backup (database dump) onto a new MariaDB server. This is what happened: # mysql -u db_user -p db4 < db4-4.4.2_02-08-2018.sql Enter password: ERROR 2006 (HY000) at line 354: MySQL server has gone away The database size is 1.7G, and this should not surprised a database administrator. But it did surprise me because: firstly I’m not a db admin, and secondly I had this issue before just a few weeks ago. So here is a blog post to make sure I won’t forget it for the 3rd time. Basically, I just need to increase the max_allowed_packet size from the default 16MB to something bigger. I chose 128MB. ...

February 8, 2018 · 1 min · 182 words · kenno

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. nas:~ # zpool status [136/462] pool: zroot state: ONLINE scan: scrub repaired 0 in 0h0m with 0 errors on Tue Jan 23 23:54:42 2018 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 gpt/zfs0 ONLINE 0 0 0 errors: No known data errors So I’ve been reluctant to do anything about it. Until tonight, when I accidentally list the partition of that drive (ada4): ...

February 3, 2018 · 2 min · 332 words · kenno

Blacklisting Local Disk from Multipath

In my previous post, I wrote about my quest to identify a disk presented by the Dell server itself. At the end of the post, I mentioned that I should be able to resume with creating a LVM volume on the new disk. LVM stands for Logical Volume Management. There is a good tutorial available at this page if you’re interested in – How To Use LVM To Manage Storage Devices on Ubuntu 16.04. ...

January 28, 2018 · 3 min · 474 words · kenno

How to identify a disk on a Dell server

I have a Dell R730 server at work, which connects to a back-end storage with optical fiber cables. In addition, the server itself also has 6 disks. Two of the disks have already been configured as RAID1 and has the operating system installed on it. Today, I want to configure the remaining 4 disks as RAID10, and setup logical volume on it. The first part was easy. All I had to do was to login to the Integrated Dell Remote Access Controller (iDRAC), and create a new Virtual Disk from the 4 physical disks. The second part is a bit tricky. As the server is connected to the stroage server, it sees a lot of disks. ...

January 24, 2018 · 4 min · 765 words · kenno