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

Support for “in-place” updates? #295

Open
nbraud opened this issue Jul 15, 2023 · 10 comments
Open

Support for “in-place” updates? #295

nbraud opened this issue Jul 15, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@nbraud
Copy link

nbraud commented Jul 15, 2023

It would be great to apply changes to the disko config on an already-installed system, when possible losslessly.

Currently, I need to add (for instance) new ZFS datasets (or change some options on them) both in the declarative config, and then imperatively (by calling zfs create manually)

I believe that would be super helpful for use cases where wiping all the storage isn't practical, like:

  • personal computers, whose users presumably have data stored locally they do not wish to lose;
  • database & storage servers, where copying data back from other replicas or backups may take a while and/or incur significant load;
  • even on application servers that do not hold stateful data, wiping storage has significant side-effects: it would change the host SSH keys, clear caches on a web frontend, etc.
@Lassulus
Copy link
Collaborator

hello, yes I'm working on it. although it's a bit complicated to detect the current setup and decide which changes are destructive and which are not. The solution I'm working towards will have a _check for each type which could output if the system differs from the configured setup. We then need to find out which changes the _create step does are non-destructive and execute those.

All in all this is a feature which is coming, although I have no definite timeline on it. But I haven't decided on an interface yet. probably there will be a kind of mode selection (with modes like: non-destructive, force, force-non-critical, etc)

@nbraud
Copy link
Author

nbraud commented Jul 15, 2023

Great to hear you were already on it, thanks <3

@nalves599
Copy link

@Lassulus Thank you for your amazing work!
Any updates on this? Do you have any draft or anything done?

@Lassulus
Copy link
Collaborator

ah, I have a WIP commit which adds this for some types: #435 although I'm not very happy with the implementation. it's a lot of duplicated code and it would be nicer to include this more into the create step

@CryoMyst
Copy link

CryoMyst commented Mar 1, 2024

I would personally like non-destructive options for disko to use.
I am working on NixOS Asahi which requires installing alongside the MacOS partitions (Which are essential to keep around) and throwing a new SSD in is not an option.
The installer prompts you to resize the existing MacOS partition so there is free space to install on and manage but it should never touch the existing partitions.

https://github.com/tpwrules/nixos-apple-silicon/blob/main/docs/uefi-standalone.md#partitioning-and-formatting

DANGER: Damage to the GPT partition table, first partition (iBootSystemContainer), or the last partition (RecoveryOSContainer) could result in the loss of all data and render the Mac unbootable and unrecoverable without assistance from another computer! Do not use your distro's automated partitioner or partitioning instructions!

@Lassulus
Copy link
Collaborator

alrighty, we now have #568 which "should" make the createScript non destructive, be careful to use the createScript and not the diskoScript (that one wipes the disks first). Also this code is not yet tested on a real setup, so take care to not lose your date! :)

@Ramblurr
Copy link

Ramblurr commented Apr 1, 2024

I'm interested in the use case of being able to declaratively define zfs datasets, not for the first install case, but for creating new datasets long after install.

Example: A NAS or server system where you want to be able to create a new dataset to store the data from some service you enable with a nixos module.

Is this currently possible? If so are there any relevant examples?

@iFreilicht iFreilicht added the enhancement New feature or request label Oct 7, 2024
@bcotton
Copy link

bcotton commented Feb 2, 2025

I'll throw another use case into this issue.

I recently had a ZFS mirrored boot disk fail, and I had to replace it. As Disco initially managed the root disks, I needed a way to partition just the one disk in the mirror.

I hand-rolled it, but missed the fact that the partitions have labels that the system, specifically swap, was looking for.

It would be nice to print out at least the commands needed to do this.

Thanks for the great tool!

@Ramblurr
Copy link

Ramblurr commented Feb 3, 2025

It would be nice to print out at least the commands needed to do this.

That's a great idea imo.

@2e0byo
Copy link

2e0byo commented Feb 18, 2025

you can sort of get the commands you need with disko --mode format --dry-run, although it's a matter of reading a script which wants to format everything and working out which changes to apply.

Still having just done exactly the same thing (with btrfs not zfs) it was handy to see what I'd missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants