What to do if pvcreate produces a lot of WARNING and cannot be created

There may be various events, but in my case

# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
nvme0n1         259:0    0 238.5G  0 disk
├─nvme0n1p1     259:1    0   499M  0 part
├─nvme0n1p2     259:2    0   100M  0 part /boot/efi
├─nvme0n1p3     259:3    0    16M  0 part
├─nvme0n1p4     259:4    0 124.4G  0 part
├─nvme0n1p5     259:5    0     1G  0 part /boot
└─nvme0n1p6     259:6    0 112.5G  0 part
  └─fedora-root 253:0    0 112.5G  0 lvm  /
nvme2n1         259:7    0 465.8G  0 disk
nvme1n1         259:8    0 465.8G  0 disk
├─nvme1n1p1     259:9    0   200G  0 part
└─nvme1n1p2     259:10   0 265.8G  0 part
# pvcreate /dev/nvme1n1p1
  WARNING: wrong checksum 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong magic number in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong version 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong start sector 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: bad metadata header on /dev/nvme1n1p1 at 4096.
  WARNING: scanning /dev/nvme1n1p1 mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/nvme1n1p1 with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/nvme1n1p1 PVID daz9jwK4OFToj1nBaNX5eiSwm6uf5W3X
  WARNING: wrong checksum 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong magic number in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong version 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: wrong start sector 0 in mda header on /dev/nvme1n1p1 at 4096
  WARNING: bad metadata header on /dev/nvme1n1p1 at 4096.
  WARNING: scanning /dev/nvme1n1p1 mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/nvme1n1p1 with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/nvme1n1p1 PVID daz9jwK4OFToj1nBaNX5eiSwm6uf5W3X
  Command failed with status code 5.

I got an error like this and could not create it normally (I get the same error even if I hit another lvm command such as pvs after that)

Since I was playing with mdadm and stratis just before, it was useless to delete the partition header by mdadm --zero-superblock or zap with gdisk, so I checked various things and found that the header is different from the extra partition header. Remained and seemed to read it (probably)

https://stackoverflow.com/questions/28421676/unable-to-remove-volume-group-due-to-incorrect-metadata-area-header-checksum

It was solved when it was carried out as follows with reference to.

# gdisk /dev/nvme1n1
...Omitted but x->zap with z
# dd if=/dev/zero of=/dev/nvme1n1 bs=1024k count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB, 10 MiB) copied, 0.0238877 s, 439 MB/s
# gdisk /dev/nvme1n1
...Omitted, but normal except for specifying 8e00 for GUID
# pvcreate /dev/nvme1n1p1
  Physical volume "/dev/nvme1n1p1" successfully created.
# pvs
  PV             VG     Fmt  Attr PSize   PFree
  /dev/nvme0n1p6 fedora lvm2 a--  112.47g      0
  /dev/nvme1n1p1        lvm2 ---  200.00g 200.00g

Congratulations

Recommended Posts

What to do if pvcreate produces a lot of WARNING and cannot be created
What to do if pip cannot be installed
What to do if the package dependency cannot be repaired
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if mod_fcgid cannot resolve UnicodeEncodeError
What to do if a UnicodeDecodeError occurs in pip
What to do if pip gives a DistributionError in Homebrew
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do if you get a Cannot retrieve metalink for repository error in yum
What to do if ʻObject arrays cannot be loaded when allow_pickle = False` occurs in numpy.load ()
What to do if you cat or tail a binary file and the terminal is garbled
What to do if yum breaks
What to do if you get angry with'vertices' must be a 2D list ... in matplotlib arrow
What to do if you get a minus zero in Python
[Django] What to do if the model you want to create has a large number of fields
What to do if you grep a text file and it becomes Binary file (standard input) matches
What to do if you get a UnicodeDecodeError with pip install
What to do if Insecure Platform Warning appears when running Python
What to do if pip --user returns an error in a virtual environment created with pyenv
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
What to do if you get the error Target WSGI script'/var/www/xxx/xxx.wsgi' cannot be loaded as python module
[Memorandum] What to do when a warning appears after executing pip list
What to do if there is a decimal in python json .dumps
What to do if ipython and python start up with different versions
What to do if you get a TypeError with numpy min, max
What to do if fprintd requires a password when registering your fingerprint
What to do when a warning message is displayed in pip list
Connect a lot of Python or and and
What to do if you are told "Import Error: cannot import name'HTTPSHandler'" when building a virtual environment using virtualenv
What to do if an error occurs when loading a python project created with poetry into VS Code
Notes on what to do if "macOS 11 or later required!" Appears in Big Sur or pyarrow2.0.0 cannot be installed
What to do if you get a "No versions found" error in pipenv
How to put a lot of pipelines together and put them away at once
What to do if the latest Jupyter Notebook and nb extensions don't work
What to do when a warning appears around Python integration in Neovim's CheckHealth
[Note] What to do if the Qt library conflicts between pyqt and opencv
What to do if Django can't load an image from a static folder
What to do if a Unicode Encode Error occurs in Sublime Text Python
[Ubuntu 18.04 LTS] What to do when the screen resolution cannot be selected [NVIDIA]
What to do if NotADirectoryError: [Errno 20] Not a directory:'xdg-settings' appears in jupyter notebook
What to do if a version error occurs in the selenium Chrome driver
What to do if (base) is displayed at the beginning of the Mac terminal
What to do if pipreqs results in UnicodeDecodeError
Python tricks: a combination of enumerate () and zip (), checking if a string can be converted to a number, sorting the string as a number
What to do if you can't pipenv shell
Note: What to do if pip install fails
Make a chatbot and practice to be popular.
What to do if rails s doesn't work
What to do if a communication error occurs due to proxy when installing with package management of pip, npm, gem
What to do when PermissionError of tempfile.mkstemp occurs
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame
What to do if you get "(35,'SSL connect error')" in pycurl (one of them)
What to do if the progress bar is not displayed in tqdm of python
How to install and use pyenv, what to do if you can't switch python versions
What to do if you run python in IntelliJ and end with an error
What to do if you install openCV3 and make a symbolic link, but when you do "import cv2", "No module named'cv2'" appears
What to do if you have corrected the mistake in the IP address of the zone file but cannot connect to the DNS server
What to do if pip install fails in Xcode 5.1