Skip to content

Conversation

@ElFronthe
Copy link

Hello, using this script, we periodically encountered the problem that "uuid" was not defined on some sections. In the process of studying the problem, it became clear that partition have uuid, but lsblk cannot determine it and gives an empty string. At the same time, BLKID handles uuid detection, I suggest adding BLKID as a fallback way to get uuid to minimize situations when uuid is present but cannot be detected.

@Foxboron
Copy link
Member

Foxboron commented Oct 3, 2022

Did you run genfstab inside arch-chroot?

@ElFronthe
Copy link
Author

We use this script not only for installing archlinux we install ubuntu debian centos hosts with arch style installation, so we run this script inside custom livecd with rocky linux 8 not in chroot.
we test this changes and problem goes away.
image
situation when no uuid displays look like this, sda2 have ext4 fs and mounted with mount /dev/sda2 /mnt/boot command.

@YHNdnzj
Copy link
Contributor

YHNdnzj commented Oct 3, 2022

You can use uuid=$(blkid -s UUID -o value "$1" 2>/dev/null) to get UUID, which I believe is simpler and more readable. Also, maybe use [[ ]] instead since it's used all other places?

@ElFronthe
Copy link
Author

thanks for the clarifications on the blkid syntax, your example is much more concise.

@YHNdnzj
Copy link
Contributor

YHNdnzj commented Oct 8, 2022 via email

@ElFronthe
Copy link
Author

I will try to get this bug again. It happen not on all hardware.

YHNdnzj added a commit to YHNdnzj/arch-install-scripts that referenced this pull request Oct 25, 2022
lsblk uses libudev to get device information, but udev isn't always
present in the environment where genfstab is run. On the contrary, blkid
uses libblkid and gets those informations direct, which shall be
preferred.

Fixes #24
Closes archlinux#26
Foxboron added a commit that referenced this pull request Mar 26, 2023
udev doesn't work in the chroot which prevents some tools like lsblk to
retrieve the UUID of devices. This can be a bit problematic so instead
of having /run mounted as a tmpfs, do a bind-mound from the rootfs and
include `--make-private`.

This is similar to the previous implemention.

Fixes https://github.com/archlinux/arch-install-scripts/issues/24
Fixes #26
@Foxboron
Copy link
Member

Closing in favour of the --make-private implementation.

#52

@Foxboron Foxboron closed this Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants