mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

General support questions
Post Reply
barry_devops
Posts: 4
Joined: 2019/02/08 19:02:45

mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by barry_devops » 2019/02/08 19:05:30

I rebuilt kernel rpms successfully and trying to install it. I get

blkid: invalid option -- 'u'

error. I found out that it comes from dracut.

Code: Select all

makeinitrd /boot/initramfs-${KVER}.img ${KVER} --force (actually calls dracut)
dracut /boot/initramfs-${KVER}.img ${KVER} --force
Both returns the same error. Looks like blkid has no such option but why dracut is trying to use this option?

Though it creates initramfs under /boot somehow. But it doesn't boot.

I use Centos 7.6 image, the kernel is from elrepo vmlinuz-4.20.6-1.el7.x86_64.

User avatar
TrevorH
Forum Moderator
Posts: 26331
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by TrevorH » 2019/02/08 21:12:14

What's the output from which blkid run as root?

BTW, the command is mkinitrd not makeinitrd and it's officially deprecated and dracut should be used directly - that's why it's just a wrapper script.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

barry_devops
Posts: 4
Joined: 2019/02/08 19:02:45

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by barry_devops » 2019/02/08 22:52:48

it is /sbin/blkid

I found the problem. For the record, something in my rpm rebuild process is overwriting blkid with an old version. I start to build OS from kickstart. I'll check its configuration.

blkid in my centos box is version 2003. -u and -k options were introduced in late versions.

Thanks.

User avatar
TrevorH
Forum Moderator
Posts: 26331
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by TrevorH » 2019/02/08 23:55:58

We ship

blkid from util-linux 2.23.2 (libblkid 2.23.0, 25-Apr-2013)

and it knows the -u switch.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

barry_devops
Posts: 4
Joined: 2019/02/08 19:02:45

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by barry_devops » 2019/02/08 23:58:02

I found the root cause.

I am adding e2fsprogs from kernel.org to my cents box. And apparently that package has an old version of blkid and overwrites util-linux blkid.

barry_devops
Posts: 4
Joined: 2019/02/08 19:02:45

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by barry_devops » 2019/02/09 00:23:25

Centos has its own e2fsprogs package and it has no problem. I believe the package manager removes this binary from the rpm. But I have to use its new version which is not available with default centos 7.6 box so I installed it from the source.

There is a conflict between e2fsprogs and util-linux in terms of this binary.

Haystack
Posts: 8
Joined: 2019/02/12 11:38:26

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by Haystack » 2019/05/21 14:24:33

This issue has just rendered all of my servers unbootable after a kernel upgrade, because it has broken dracut so it can't make a new initramfs. e2fsprogs is installed from "anaconda" which I believe just means it was installed by the CentOS installer. I don't get why it only just happened now though. I've been running these servers for months. What should I do? Uninstall e2fsprogs?

User avatar
TrevorH
Forum Moderator
Posts: 26331
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by TrevorH » 2019/05/21 14:44:07

I suspect the anaconda stuff that you have installed is not from CentOS repos but rather a developer version from the anaconda people. They add their own directory to the front of $PATH so their stuff is found first. Edit where they set that and move their path to the end of $PATH.

What's the output from which e2fsck ?
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Haystack
Posts: 8
Joined: 2019/02/12 11:38:26

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by Haystack » 2019/05/21 15:40:07

TrevorH wrote:
2019/05/21 14:44:07
I suspect the anaconda stuff that you have installed is not from CentOS repos but rather a developer version from the anaconda people. They add their own directory to the front of $PATH so their stuff is found first. Edit where they set that and move their path to the end of $PATH.

What's the output from which e2fsck ?
I've not installed anything except from CentOS and epel repos and I didn't install e2fsprogs myself as far as I can remember. My PATH did not have anything unexpected on it. I'm generally pretty aware of what is in my PATH.

which e2fsck gives me /sbin//e2fsck

Anyways I managed to fix it already. I reinstalled util-linux and it overwrote the super old version of blkid with the proper one, and then I was able to regenerate the initramfs with dracut as I would usually.

User avatar
TrevorH
Forum Moderator
Posts: 26331
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mkinitrd returns blkid: invalid option — 'u' on Centos 7.6

Post by TrevorH » 2019/05/21 16:02:41

Actually it was the blkid comand which was wrong so look for duplicate copies of that and see where the rogue one comes from.

No package will ever overwrite a file that was supplied by one that is already installed (and is not obsoleted or superceded by the to-be-installed package) - i.e. packages that try to supply files that are already owned by an already installed package will get an error during yum install/update.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply