Resizing a GPT Partition

One of my virtual machines runs out of disk space in the root (/) partition, and I want to remove the /home partition and using this free space to resize the root partition. Nowadays, for any serious systems, I’d use LVM with XFS on top. However, for this test VM, I have a virtual disk with 4 partitions without LVM. Managing partition on LVM is much easier than working the disk partition directly....

September 10, 2020 · 3 min · 556 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. 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

Install Grub on GPT

I came across a problem with grub being broken recently on a system running Ubuntu 16.04. This happened after the grub2 package got upgraded. This post will explain how I solved the problem. If you have similar issues, please do not just copy and paste the commands and execute on your machine. First read on, and try to understand it. Usually, when this happened in the past, we just need to chroot into the system and reinstall grub....

September 25, 2017 · 4 min · 690 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