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

Unmount mode #862

Open
iFreilicht opened this issue Nov 6, 2024 · 4 comments
Open

Unmount mode #862

iFreilicht opened this issue Nov 6, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@iFreilicht
Copy link
Contributor

Originally posted by @Lassulus in #842 (comment)

What would be interesting (in the future in a new PR) would be a real unmount mode, where we don't destroy disks but just umount -Rl and deactivate the LVM/mdadm stuff for affected devices, something similiar to disk-deactivate but less destructive :)

I'm not opposed to this at all, but what would this generally be useful for?

@iFreilicht iFreilicht added the enhancement New feature or request label Nov 6, 2024
@Mic92
Copy link
Member

Mic92 commented Nov 21, 2024

It's useful if you want to flash a nixos installation to an external device and than remove the said device without reboot:

sudo disko-install --disk disk1 /dev/sda --mode mount --flake .#lenovo-t14-amd-debug

If you just remove the device as is, the zpool will still be around, if you forgot to remove it, you won't be able to use the zpool until reboot. Very annoying. Also had fun with swap: #890

@Lassulus
Copy link
Collaborator

so there are 2 ways unmounting can happen.

  1. a declarative way, where we have an unmount section in each type, which would run the defined script. We can only unmount disks/devices/fs which are created by disko that way. But building that is the easier solution
  2. a dynamic unmount, where we extract the currently mounted devices/fs/disks from the output of lsblk and other scripts. this would be similiar to what disk-deactivate does. This would be harder, but would be a more general solution :)

@Mic92
Copy link
Member

Mic92 commented Nov 21, 2024

I am currently implementing the first option because for veritysetup we also need to inject stuff that would be hard to do in generic way.

@Lassulus
Copy link
Collaborator

we can also add hooks for unmounting, which people could define in their config and would be run before/after unmounting the specified type.

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

3 participants