Daily Shaarli

All links of one day in a single page.

August 19, 2021

ZFS - GPT table corrupt | The FreeBSD Forums

Q:

I have a NAS running FreeBSD 10.1 with 3 disks: ada2 is the boot device, ada0 and ada1 are a ZFS mirror.

dmesg shows this for the ZFS mirror:

GEOM: ada0: the primary GPT table is corrupt or invalid.

How can I recover the primary GPT tables for ada0 and ada1?

A:

Please post the output of zpool status. If ZFS uses the whole disks there won't be a GPT table (or any other partition scheme) at all.

A:

yes, ZFS uses the whole disks.

A:

In that case both ada0 and ada1 do not have a partition table.

You create a pool of directly to device ada0 ada1 - this led to the fact that the pool was created using the entire device (ignore partitions!) not the partition on it (to use every device possible! it is necessary for others to organize the loading of the OS!) and, of course, information about GPT was destroyed.

You should have created a zfs pool:
(for striped) zpool create tank ada0p3 ada1p3
(for mirror) zpool create tank mirror ada0p3 ada1p3
If You set the label in the command gpart add ... -l zdisk0 ada0 , so:
(for mirror) zpool create tank mirror /dev/gpt/zdisk0 /dev/gpt/zdisk1

Should be you case:
zpool status -v

AA:

Because disks can vary in exact size, ZFS leaves some space unused at the end of the disk. (I don't know of an easy way to find out how much. Somebody pointed me at the source once, but I can't find that now. I think it would have to be at least a megabyte to allow for disk variance, but that is an estimate.)

The backup copy of the GPT is stored at the very end of the disk. The boot code tries to verify GPT tables, and is likely finding that leftover backup GPT at the end of the disk.

The trick is clearing that backup GPT without damaging the ZFS data. Do not attempt to do that without a full, verified backup of that ZFS mirror. After that, use diskinfo -v ada0 to get the mediasize in sectors. The standard backup GPT is 33 blocks long, so erasing the last 33 blocks on the disk with dd(1) should be enough to avoid the error without interfering with the ZFS data. dd(1) does not have a way to say "the last n blocks", so the seek= option has to be used to seek to (mediasize in blocks - 33).

WARNING: make a full, verified backup of everything on the disk first!
....
Repeat the procedure for ada1. Do not just reuse the same dd(1) command because the two disks might not have identical block counts.

In the future, the easy way is to erase GPT metadata before reusing the disk. That can be done with gpart destroy (see gpart(8)).

https://forums.freebsd.org/threads/gpt-table-corrupt.52102/post-292341

At the very least make sure there's no partition scheme on the disks before adding them. If there is a gpart destroy adaX should clear it.

CODE RED: Joint Chiefs' Chairman Mark Milley Didn't See the Taliban's Speeding Truck – RedState

one would think General Milley, with several decades of experience, should have had the foresight to see this coming disaster. If he didn’t see the oncoming wreck, he should resign. If he did see it coming and testified to the contrary, he should resign.

If he truly didn’t see this disaster speeding toward him, he’s not fit for the position he holds and he should resign. //

My family has served in America’s military back to the Revolutionary War – the most recent being my eldest son who served as a SEAL for almost a decade. I don’t criticize the men and women in harm’s way, I am critical of those who lead them.

I am critical of politicians and inept generals. Milley is apparently both. In my estimation, he stopped being a “leader of men” when he testified about wanting to “understand white rage”, the “rage he claimed fueled the January 6th riot. That testimony barely 6 weeks ago focused wholly outside the charge of our military. His focus should be our enemies abroad. He should have been focused on a very real rage – that of the Taliban which would soon consume Afghanistan. He should have concentrated his “understanding on contingencies for getting Americans out of harm’s way before Afghanistan turned into a burning cauldron. Instead, we have thousands of Americans trapped outside the wire.

The Christian Influence Was Huge in Afghanistan; Now They Are Under Threat of Martyrdom – RedState
Deworming chemicals permanently changed Stradivarius violins | Popular Science

Chemicals used to prevent worms and rot seems to have changed the wood's structure. //

Some of the most sought-after violins on the planet may owe their sounds to deworming chemicals used by their Italian manufacturers 300 years ago. //

The authors are quick to note that they were working with wood shavings, not an entire instrument, so how a little sprinkle of metal changes, or even improves, sound remains to be seen. But what’s clear is that the violins are different from anything made since.

Pan Am Billboard – Reguengo do Fetal, Portugal - Atlas Obscura

THE GRAND PORTUGUESE TRADITION OF azulejo, hand-painted, glazed ceramic tilework depicting scenes, dates back hundreds of years. Artwork made with these ornamental tiles can be found everywhere from churches and palaces to schools and train stations. These tiles have even become a part of the history of Pan-American World Airway (1927-1991) advertising. //

The Pan Am billboard is located in Reguengo do Fetal, Batalha, on a slope of the mountain by the EN356 road that connects Batalha to Fátima. It was created in the 1960s, Pan Am’s golden era, and it was made by the historic Fábrica Aleluia azulejo company. (The same company also made another Pan Am billboard located near Aveiro.)

The billboard is composed of around 4,000 azulejos that sit in a frame of 92 square meters. The background is Pan Am’s distinctive shade of blue, the company’s lettering is on the center in its traditional font. There is one logo on either side of the lettering, and a tagline at the bottom that reads, “TORNA A SUA VIAGEM MARAVILHOSA” (“Makes your journey wonderful”).