pkgs icon indicating copy to clipboard operation
pkgs copied to clipboard

Enable "lvcreate --type cache"

Open kshpytsya opened this issue 8 months ago • 2 comments

I believe the following line is responsible for dm-cache not being supported. Please enable it.

https://github.com/siderolabs/pkgs/blob/fadf1e22a263b3429fa8fd540b4ff5a71ce8ded2/lvm2/pkg.yaml#L30

kshpytsya avatar Jun 20 '25 20:06 kshpytsya

I don't think it would be enough, as it requires extra tools, e.g.:

│ +     # cache_check_executable = "/usr/sbin/cache_check"

Please note that as long as Linux kernel supports it, you can bring your tools in a container, you don't have to use host tools.

smira avatar Jun 30 '25 17:06 smira

For some reason Talos (1.10.1) doesn't pick up externally created (booted into a live CD of some other Linux distro, tried several, used arch doc on LVM for reference) LVM RAID1+cache volumes. Once I do lvconvert --uncache vg0/raid0 in that Live CD and reboot into Talos, the volumes are picked up.

With cache:

talosctl get discoveredvolumes
NODE             NAMESPACE   TYPE               ID          VERSION   TYPE        SIZE     DISCOVERED   LABEL                                    PARTITIONLABEL
192.168.56.101   runtime     DiscoveredVolume   loop0       1         disk        78 MB    squashfs
192.168.56.101   runtime     DiscoveredVolume   nvme0n1     1         disk        22 GB    gpt
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p1   1         partition   1.2 GB   vfat         EFI                                      EFI
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p2   1         partition   1.0 MB   talosmeta                                             META
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p3   1         partition   105 MB   xfs          STATE                                    STATE
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p4   1         partition   2.0 GB   xfs          EPHEMERAL                                EPHEMERAL
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p5   1         partition   18 GB    lvm2-pv      ffOeCQ-6JDI-DOWP-aYHn-eiJ3-4wSe-PN0paA
192.168.56.101   runtime     DiscoveredVolume   sda         1         disk        107 GB   lvm2-pv      uLGhx4-meoB-vzx2-rzzx-OXhL-yDtc-z4NjEc
192.168.56.101   runtime     DiscoveredVolume   sdb         1         disk        107 GB   lvm2-pv      NZ550X-dfv3-o2oh-uhE4-cJoe-d9AT-iF6gOC

without cache:

talosctl get discoveredvolumes
NODE             NAMESPACE   TYPE               ID          VERSION   TYPE        SIZE     DISCOVERED   LABEL                                    PARTITIONLABEL
192.168.56.101   runtime     DiscoveredVolume   dm-0        1         disk        4.2 MB
192.168.56.101   runtime     DiscoveredVolume   dm-1        1         disk        107 GB   xfs
192.168.56.101   runtime     DiscoveredVolume   dm-2        1         disk        4.2 MB
192.168.56.101   runtime     DiscoveredVolume   dm-3        1         disk        107 GB   xfs
192.168.56.101   runtime     DiscoveredVolume   dm-4        1         disk        107 GB   xfs
192.168.56.101   runtime     DiscoveredVolume   loop0       1         disk        78 MB    squashfs
192.168.56.101   runtime     DiscoveredVolume   nvme0n1     1         disk        22 GB    gpt
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p1   1         partition   1.2 GB   vfat         EFI                                      EFI
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p2   1         partition   1.0 MB   talosmeta                                             META
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p3   1         partition   105 MB   xfs          STATE                                    STATE
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p4   1         partition   2.0 GB   xfs          EPHEMERAL                                EPHEMERAL
192.168.56.101   runtime     DiscoveredVolume   nvme0n1p5   1         partition   18 GB    lvm2-pv      ffOeCQ-6JDI-DOWP-aYHn-eiJ3-4wSe-PN0paA
192.168.56.101   runtime     DiscoveredVolume   sda         1         disk        107 GB   lvm2-pv      uLGhx4-meoB-vzx2-rzzx-OXhL-yDtc-z4NjEc
192.168.56.101   runtime     DiscoveredVolume   sdb         1         disk        107 GB   lvm2-pv      NZ550X-dfv3-o2oh-uhE4-cJoe-d9AT-iF6gOC

(Notice the dm-* not present with cache)

Trying to manage volumes from a Docker (e.g. debian) in Talos fail due to inability to access udev socket.

I believe I have seen some error messages in dmesg I could attribute to inability to deal with cache, but now I cannot reproduce that.

P.S. All the relevant kernel modules (dm-* just in case) are loaded:

# Configures the kernel.
kernel:
    # Kernel modules to load.
    modules:
        - name: dm-cache
        - name: dm-cache-smq
        - name: dm-raid
        - name: dm-thin-pool

kshpytsya avatar Jul 01 '25 11:07 kshpytsya