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: avoid external probing effects from other devices #370

Merged

Conversation

blaggacao
Copy link
Contributor

@blaggacao blaggacao commented Sep 15, 2023

Context

partprobe without [DEVICE] probes all devices and thus those devices can have external effects.

One such external effect is, for example, the following error that had been observed when using a usb live stick device (potentially damaged or otherwise not entirely appropriatly set up).

Error: Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

Proposed Solution

  • Strictly specify the [DEVICE] in scope where possible

Review Note

disko on  fix/external-effects-on-partprobe took 2m55srg 'partprobe'
lib/make-disk-image.nix
21:    parted # for partprobe
46:    partprobe

lib/types/mdadm.nix
45:        partprobe /dev/md/${config.name}
78:        pkgs.parted # for partprobe

lib/types/table.nix
94:          partprobe ${config.device}
104:          partprobe ${config.device}

lib/types/gpt.nix
110:          partprobe ${config.device}
154:          pkgs.parted # for partprobe

lib/types/zfs_volume.nix
53:        partprobe /dev/zvol/${config._parent.name}/${config.name}
77:        pkgs.parted # for partprobe

lib/make-disk-image.nix seemed ambiguous, but I understand it's also "just" for VM tests and hence a controlled environment (i.e. no external effects).

@Lassulus
Copy link
Collaborator

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Sep 15, 2023

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 0faae8a

@mergify mergify bot merged commit 0faae8a into nix-community:master Sep 15, 2023
@blaggacao blaggacao deleted the fix/external-effects-on-partprobe branch September 15, 2023 20:44
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.

2 participants