After resizing the VM disk at the host level, OPNsense does not automatically
use the extra space. gpart show may report the disk as corrupt. This is
expected.
What is actually happening is the backup GPT header is still at the old end of
the disk.
Fix
Enter the console shell.
Repair GPT metadata. This does not touch data.
gpart recover ada0
Resize the root partition. On a default UFS install this is freebsd-ufs,
usually partition 3.
gpart resize -i 3 ada0
Grow the filesystem.
growfs /
Verify.
df -h
Notes
Applies to UFS installs
The corruption warning after a disk resize is normal
I spent two days trying to recover. Most of the advice is to salvage the files and rebuild the filesystem.
Potential cause is bitflip in memory. I recently upgraded my RAM to 16GB × 4. I did not test it and just plugged it in. After a couple of days, my filesystem got corrupted.
List btrfs devices
btrfs fi show
Unmount volume and stop services in DSM
synostgvolume --unmount /volume2# I forgot the correct command, but it should resemble something like --unmount-with-packages
This is supposed to stop services and unmount the volume, but it was not working for me.
Trying out btrfs check --repair
I tried btrfs check --repair as a last resort. But I’m blocked by the following error. I was not able to figure out how to fix it.
couldn't open RDWR because of unsupported option features (800000000000003).
Mounting DSM volumes in Ubuntu
apt-get updateapt-get install -y mdadm lvm2 # Initiate mdadmmdadm -AsfR # Assemble or activate an array, scan for MD superblocks, etc.vgchange -ay # Activate volume groupcat /proc/mdstat # List active RAID arraysbtrfs fi show # List btrfs devicesbtrfs check /dev/mapper/vg1000-lv
Attempted to mount the volume in Ubuntu because I could not unmount it in DSM. I could not do anything aside from btrfs check because of an unknown feature error. I’m thinking DSM have custom code baked into their Btrfs bundle.
couldn't open RDWR because of unsupported option features (0x800000000000003)ERROR: cannot open file system
Summary
I decided to back up everything and rebuild my volume. It was originally built last July 2020 and has gone through a lot of changes such as disk size increase (adding new disks). There were a lot of errors in btrfs check too.
It’s hard to continue using it with doubt if the error will not happen again.
The bad key order corruption was likely to be from memory bitflip. I’ll do a memtest on the host machine before doing anything else.
Cutting my losses by not spending more time on this issue. I learned a bit about Btrfs which is good because I will still use it. I have a better idea next time what to check.
Writing this down so I have reference in the future.
I had an idea to
emulate an NVME
and try to use it as cache in Synology DSM. I get to a point where it tried to
mount the cache, then I get a segfault.
Another setup to try. I have a bunch of various size disk that I do not know what’s the best setup for.
mergerfs combines different disk with different filesystem and show it as a single mount. Files are still flat. Disks can still be mounted individually.
SnapRAID can be used to setup a parity drive to allow recovery if one drive fails.
The idea is to combine the two technology. Mergerfs to combine disks + SnapRAID for data redundancy.
I have multiple, different size hard drives. It’s hard to plan how to utilize it with data safety in mind. Usually, hard drives need to be the same specification to use as RAID.
I’ve been seeing GlusterFS and I was curious if it fits my use-case.
My understanding is it’s a distributed file system that takes care of replication across hosts. So a setup with 3 different servers, with 3 (or more) different disk sizes should work. Increasing the cluster size means adding additional servers with more disks.
I am seriously considering this for my homelab. I don’t have time for it now though, but it’s on my list to try.
Grabe. I did not expect that it will take 4 days to add 2x 10TB volume to my NAS.
Two days in
I wrote this on 2022-12-19, while it was still running.
I’ve upgraded my family’s NAS to add another 2x 10TB drives.
I added the drive 2 days ago. Up until now, it’s still in progress. I did not expect it’ll be this slow. Good thing, I’m not in a rush.
Start and finish
Started at 2022-12-15 18:27:19
Finished at 2022-12-19 22:06:27
I also realized the importance of UPS. Between adding the volume and completion, there was 20 seconds of electric interruption. That would have risk data corruption kung namatay yung NAS in the middle of the operation.