Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem with missing part. labels. #358

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

rudolfvesely
Copy link
Contributor

After sgdisk I got:

Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

And then:

mkswap: cannot open /dev/disk/by-partlabel/...: No such file or directory

This is a simple solution to this problem.

@Mic92
Copy link
Member

Mic92 commented Sep 11, 2023

I would have expected that udev also would do this. Can you confirm that after this change, the problem goes away?

@rudolfvesely
Copy link
Contributor Author

I've just tested it and it solves the problem. I've encountered this issue after mkswap on top of randomEncryption after partition with luks. I didn't have any problems with mkswap on top of randomEncryption after non-encrypted partition.

@phaer
Copy link
Member

phaer commented Sep 11, 2023

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at fc6f863

@mergify mergify bot merged commit fc6f863 into nix-community:master Sep 11, 2023
@phaer
Copy link
Member

phaer commented Sep 11, 2023

Thanks! I remember having similar experiences in the past, where udevadm --settle wasn't sufficient and partprobe seemingly needed. Also think it does not hurt and could easily be removed if it proves unecessary

@rudolfvesely
Copy link
Contributor Author

Thank you for merging it.

Have you considered to wait for a label to show up? Because they do after a second when all tasks are propagated.

wait=0
until [[ ${wait} -eq 5 ]] || [[ -b /dev/disk/by-label/nixos ]]; do
    echo "wait loop #$(( wait ++ ))"
    sleep 1
done
[[ ${wait} -lt 5 ]]

or via

inotifywait

Maybe as a separate phase between _create and _mount.

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