Commit graph

163 commits

Author SHA1 Message Date
nothingnesses
be1a6b8a05 bcachefs: fix subvolume mounting 2025-12-14 04:58:58 +00:00
Michael Hoang
f2bba803a7 treewide: reformat 2025-12-14 04:58:58 +00:00
fidgetingbits
e65362ceef feat(mdadm): add extraArgs option 2025-12-10 00:31:19 +00:00
Bert Proesmans
a799338d17 fix(luks); Passthrough filesystems of content for unmounting 2025-11-20 14:10:46 +00:00
Bert Proesmans
fa7a23d0ef fix(nodev); Set device default to fstype config
The value for device is copied into the SOURCE column of findmnt.
By default this is "none". The mount and unmount scripts
branch on SOURCE=fsType specifically, and the existence of "none"
in the SOURCE column causes wrong branches to be executed.
For a list of special filesystems, the default value "none"
is replaced by the value for fsType.
2025-11-20 14:10:46 +00:00
Bert Proesmans
d9e12a2c7f fix(zpool); Ignore shadow-mount error during recreate of zpool at existing non-empty path 2025-11-20 14:10:46 +00:00
Bert Proesmans
d8a3e367bd Fix(mdadm); unmount not passing through filesystems set from content 2025-11-20 14:10:46 +00:00
Bert Proesmans
436fd911cf Fix(zfs_fs); Mount/Unmount with encryption
- Fix typo against full dataset path argument
- Make unmount with encryption keys idempotent
2025-11-20 14:10:46 +00:00
Edwin Mackenzie-Owen
fec5efebfc gpt: trigger udev after marking hybrid mbr partitions as bootable
Even though we don't depend on the MBR bootable flag in the following
steps, not running udevadm trigger and waiting for settle can cause
/dev/disk/by-partlabel entries to be absent when formatting filesystems
immediately after modifying the partition table.
2025-10-31 08:24:29 +00:00
Sergey Kazenyuk
31fe7eda26 gpt: add partition attributes 2025-09-07 14:37:19 +00:00
lassulus
4073ff2f48 types.luks: fix password check 2025-08-18 12:26:12 +00:00
Mitch Fossen
d74db625a5 remove quotes from --label creation for bcachefs
fixes device groups, for example where the disko config given looks like:

label = "fast.dev1";

after formatting, the device has a literal label of "fast.dev1" which
breaks bcachefs device groups:

echo fast > /sys/fs/bcachefs/<id>/options/foreground_target

gives the error Invalid argument, echo fast.dev1 fails as well

echo "\"fast\"" fails the same, however echo "\"fast.dev1\"" succeeds

after this, device labels and groups work as expected and any component
of the label can be used for a *_target
2025-06-05 18:16:20 +00:00
Jörg Thalheim
6bb82b77ce luks: drop unnecessary subshell 2025-05-08 09:13:14 +00:00
Philipp Schmitt
06fb9283ca Unlock luks devices once and only once 2025-05-08 09:13:14 +00:00
Philipp Schmitt
cbc1f418d0 Improve luks device detection 2025-05-08 09:13:14 +00:00
Philipp Schmitt
aa5d53aee8 Add disk.destroy option 2025-05-08 09:13:14 +00:00
Kyle Petryszak
8d78963819 fix: addresses: https://github.com/koverstreet/bcachefs/issues/812 2025-05-07 17:27:41 +00:00
nothingnesses
7b63642358 Make bcachefs subvolumes boot-time mount tests pass + more tests 2025-05-04 20:24:55 +00:00
nothingnesses
ca27b88c88 Add bcachefs type with encryption and multi-disk support
This update introduces a bcachefs type with encryption support and advanced formatting options.
It includes a new example (`examples/bcachefs-multi-disk.nix`) to demonstrate multi-disk setups and available options.

Key changes:

- Deterministic UUID generation.
- Addressed limitations with multi-disk root setups due to bcachefs and systemd issues.
- Provided a systemd-mount alternative for fileSystems configuration.
- Added subvolume support and updated scripts for clarity and functionality.

---------

Co-authored-by: Jonas Heinrich <onny@project-insanity.org>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Kyle Petryszak <6314611+ProjectInitiative@users.noreply.github.com>

Update
* Add examples
* Improve descriptions

Remove debugging

Remove comment

Use `unique` to dedup lists
2025-04-24 13:41:42 +00:00
Jeremy Fleischman
51d33bbb7f UI nit: remove unnecessary newline when prompting user for password 2025-04-18 01:42:02 +00:00
Jörg Thalheim
76c0a6dba3 udevadm settle: use timeout
there are cases where this can just indefinitly hang as we can see in VM
tests. Let's add a tie breaker.
2025-04-08 20:46:43 +00:00
Jörg Thalheim
8f806681d7 tree-wise: quote path correctlys 2025-04-08 15:36:04 +00:00
lassulus
fa5746ecea types disk: fix deviceOrdering 2025-02-15 15:53:51 +00:00
DavHau
ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
Rua
a825e29a3b Use regex for UUID, adjust documentation a bit 2025-02-15 01:27:47 +00:00
Rua
bf440582c4 Use concatMapStrings 2025-02-15 01:27:47 +00:00
Rua
54be8abff0 Add configration option for partition UUIDs 2025-02-15 01:27:47 +00:00
Leonie Marcy Vack
c53bfaa13a zfs_volume: fix eval of _unmount if content is null 2025-01-16 14:46:04 +01:00
Jörg Thalheim
7ea6edd857 zfs-with-vdevs: add an example for using absolute device paths
This is the only way to assign devices rather than fixed gpt partitions.
Without reading the code it's not very obvious how disko actually
assigns devices to zpools.
2024-12-24 14:45:56 +01:00
Jörg Thalheim
d8f3cfc582 zfs: run load-key on mount 2024-12-20 14:24:53 +01:00
neox
a0c967fef4 Add extraArgs to zfs_volume.
Update lib/types/zfs_volume.nix
2024-12-13 11:16:40 +01:00
Felix Uhl
67a130b984 tree-wide: Remove all uses of lib.mdDoc
This was deprecated in 24.05 already, and removed in 24.11.
2024-12-02 20:28:17 +01:00
Jörg Thalheim
aa006252c8 add unmount feature 2024-11-29 14:44:15 +01:00
Gary Guo
3e83c11038 Fix evaluation when a GPT partition is left unformatted 2024-11-25 02:10:48 +00:00
Jörg Thalheim
0433c7e883 also passthrough rootfs mountoptions 2024-11-24 18:39:57 +01:00
Jörg Thalheim
fd3e326e9a disable swap in disko-install
Update disko-install

Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-22 12:45:57 +01:00
Michon van Dooren
92ad678418
Add examples for all special zpool vdev types 2024-11-18 22:50:10 +01:00
Michon van Dooren
caad548415
Make vdev sort only move empty modes to the start 2024-11-18 22:49:51 +01:00
Michon van Dooren
d192ffd944
Fix zpool create for disk vdev after mirror vdev
A config like

```nix
{
  vdev = [
    {
      mode = "mirror";
      members = [ "data1" "data2" ];
    }
    {
      members = [ "data3" ];
    }
  ];
}
```

would result in the following command:

```shell
zpool create -f <name> mirror /dev/data1 /dev/data2 /dev/data3
```

which would result in a single vdev with a 3-way mirror, rather than a
vdev with a 2-way mirror and a second vdev with a single disk. By
reordering the vdevs to handle those with an empty mode first we
transform this into:

```shell
zpool create -f <name> /dev/data3 mirror /dev/data1 /dev/data2
```

which does have the desired outcome.
2024-11-18 01:33:49 +01:00
Michon van Dooren
6a472cc248
Fix zpool create with > 1 log/dedup/special vdev
The type keyword was included before every vdev:

```shell
zpool create -f <name> /dev/sda log mirror /dev/sdb /dev/sdc log mirror /dev/sdd /dev/sde
```

but this is incorrect and should instead be:

```shell
zpool create -f <name> /dev/sda log mirror /dev/sdb /dev/sdc mirror /dev/sdd /dev/sde
```
2024-11-17 22:19:33 +01:00
Michon van Dooren
9b56c1afdb
Add support for ZFS spare, log & dedup vdevs 2024-11-17 15:52:28 +01:00
Felix Uhl
9f97bd0995 lib: Fix jsonTypes evaluation
This will be very useful for generating documentation.

Backported from a5c646bd93 for #789
2024-11-16 08:21:10 +00:00
DavHau
58cd832497 lvm_vg: fix size=100% leading to crash
lvcreate -l does not accept a '100%' parameter which currently leads to a crash. THis change automatically changes `100%` to `100%FREE` leading to the intended behavior.
2024-10-26 11:42:42 +00:00
Felix Uhl
4be2aadf13 lib: use lib.escapeShellArg for concatenated paths 2024-10-22 09:10:08 +00:00
Felix Uhl
ca47da60e5 disko: fix improper handling of whitespace
Fixes #130

This should fix pretty much all cases where spaces or other special
characters would break disko due to improper quoting. I searched for all
instances of '.label', '.device' and '.name', so I believe I caught
whatever I could.

In some cases I changed single quotes to double quotes for consistency.

I know we don't usually fix bugs in the legacy table type, but it was so
easy I couldn't resist.
2024-10-22 09:10:08 +00:00
Felix Uhl
dcabccaad6 swap: fix partition type
Fixes #391
2024-10-16 17:05:43 +00:00
qbisi
ef408f7f9a options: add imageName option to disk type.
For disk type, option name used in disk partlabel
naming should be short. While setting a specialized
option imageName allow us to create image with long name
without side-effects.
2024-10-14 16:16:13 +00:00
Jörg Thalheim
91cd091669 zpool: fix default value for cache
we want an empty list instead of null
2024-10-01 08:55:41 +02:00
Felix Uhl
72c867c439 Run nix fmt 2024-09-26 15:36:54 +02:00
r-vdp
1f8e67e945
Always add dm-snapshot when LVM is used
The lvm_type is only set on RAID and thinly provisioned LVM volumes, but
regular LVM volumes without a type can also have snapshots.
2024-09-25 09:30:14 +02:00