Skip to content

fix: update no longer deletes ISOs and other user files - #104

Merged
Mexit merged 1 commit into
Mexit:masterfrom
dywedir:fix/update-preserve-isos
Oct 2, 2026
Merged

Mexit merged 1 commit into
Mexit:masterfrom
dywedir:fix/update-preserve-isos

Conversation

@dywedir

@dywedir dywedir commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Since v0.14.0 (532bd52), updating a drive from Linux (./multios-usb.sh -u /dev/sdX, or option [1] Update in the menu) deletes everything in ISOs/, plus any other files the user keeps on the data partition outside MultiOS-USB/.

The updater builds a staging directory and mirrors it onto the root of the data partition:

rsync ... --delete --exclude='config_priv' --exclude='tools_priv' "$data_stage"/ "${part_data}"/

build_data_stage creates an empty ISOs/ in the stage, so --delete removes every image from ISOs/ on the drive. Top-level files and directories that are not part of the stage are removed as well. The menu text says "config_priv/tools_priv/ISOs are never touched".

The Windows installer is not affected: it mirrors only part_2\MultiOS-USB into <data>:\MultiOS-USB.

Fix

Mirror only MultiOS-USB/ into MultiOS-USB/, which is what the Windows updater already does. ISOs/ is still created if it is missing. The excludes are now anchored (/config_priv, /tools_priv) so they match only the top-level directories.

Testing

Reproduced and verified by running the update block of the script against scratch directories laid out like a data partition (not on a real device):

Path on the drive Before After
ISOs/ubuntu.iso, ISOs/sub/debian.iso deleted kept
my_docs/notes.txt (user file in the partition root) deleted kept
MultiOS-USB/tools_priv/my.efi, MultiOS-USB/config_priv/mine.cfg kept kept
stale file in MultiOS-USB/config/ removed removed
modified MultiOS-USB/config/grub.config restored restored

🤖 Generated with Claude Code

The updater mirrored the whole staging directory onto the root of the
data partition with `rsync --delete`, excluding only config_priv and
tools_priv. Since the staged ISOs/ directory is empty, every image in
ISOs/ was removed, along with anything else the user kept on the data
partition outside MultiOS-USB/.

Mirror only MultiOS-USB/ into MultiOS-USB/ instead, and anchor the
excludes so they match just the top-level config_priv and tools_priv.

Regression from 532bd52 (first released in v0.14.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused sync preserves user data while retaining deletion of stale managed files.

Review effort: Balanced
Findings: None

What changed in this PR

Restricts Linux updates to managed MultiOS-USB/ content, preserving user files elsewhere on the data partition.

Changes:

  • Syncs only the staged MultiOS-USB/ directory.
  • Anchors private-directory exclusions.
  • Creates ISOs/ only when missing.
File Description
multios-usb.sh Prevents updates from deleting ISOs and unrelated user files.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Mexit
Mexit merged commit 236a97d into Mexit:master Oct 2, 2026
Mexit added a commit that referenced this pull request Oct 2, 2026
@dywedir
dywedir deleted the fix/update-preserve-isos branch October 3, 2026 06:25
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