coreos / coreos/ignition

Prevent modification of partitions/devices in use

Open
#1,745 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.