Prevent modification of partitions/devices in use
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 974
- Forks
- 296
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 9
Description
Feature Request
Desired Feature
When Ignition is told to delete or modify a partition or whole device that is in use, it will run sgdisk and do the operation, even if, e.g., the partition is used by device mapper for a dm-verity mount or similar. Whether the boot fails depends on the OS but it might be that it succeeds but subsequent boots would fail.
Best would be if Ignition won't modify partitions/devices if it sees that they are in use. Logic to detect that with lsblk can be found in https://github.com/coreos/ignition/pull/1717#issuecomment-1798297712
Other Information
sgdisk doesn't update the kernel partition objects if any of the partitions on a device is in use. But even with https://github.com/coreos/ignition/pull/1717 that adds updating the kernel partition objects when possible (I think deletion of partitions in use is not possible), the above problem still exists and we should prevent modifying partitions when they are in use.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Ignition code that invokes sgdisk and the lsblk-based detection logic referenced in the issue comment. Trace how partition and whole-device modifications are selected, then verify that in-use targets are skipped while unused targets retain current behavior. Done means device-mapper and similar in-use devices cannot be modified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100