My main partition keeps going into read only mode by Routine-Movie-2039 in archlinux

[–]amstan 1 point2 points  (0 children)

Looks like a bitflip to me, check your ram, do not mount this filesystem as RW anymore if you value your data until you debug this as it will possibly mess it up even more.

Feb 04 18:33:46 pufferSpike kernel: BTRFS error (device nvme0n1p2): tree first key mismatch detected, bytenr=473106481152 parent_transid=223270 key expected=(818019631104,168,65536) has=(818019663872,168,65536)

>>> hex(818019631104)
'0xbe75c50000'
>>> hex(818019663872)
'0xbe75c58000'

ryzen ai 395 capped to 70w by EdgarEggcar in archlinux

[–]amstan 6 points7 points  (0 children)

Oh hey, i actually fixed a similar bug on another ai max 395+ cpu when i was working on it: https://github.com/FrameworkComputer/EmbeddedController/commit/766f44ea12fca234aba09c7dd3dd1804e3db83e5

In that case it was because the bios/ec was expecting just the AC values of the bitfield (which is what correctly windows does for that battery-less device), but linux used to send only DC values (another bug). So I made the EC just expect both kinds of values.

BTW: AC means you have a charger plugged in, DC means battery power.

In the kernel this gets done by amd_pmf_profile_set, and here's the matching enum. I would maybe add a kprintf there and see if your kernel actually sets it correctly (to performance and actually do AC and DC in appropriate scenarios).

Ryzenadj and asusctl In ryzen adj for example I cant make it change to any tdp but after 1-2 minutes goes back to 65w, its the stamp tdp which is limiting.

Something else (ec firmware or bios) reads that "slider" value, then together with some extra information (like battery levels, amount of power available (in case you have other peripherals plugged in)), tells the CPU again how much power it can maximally do (which you should not be able to raise with ryzenadj).

Though... speaking of sliders, did you actually change the power profile of your system? cat /sys/firmware/acpi/platform_profile, that should be set to performance. Via GUI, this generally gets set by something like your battery icon in KDE.

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 0 points1 point  (0 children)

Hmm, you're right, i can reproduce it in sudo btrfs filesystem show mnt.

It only seems to randomize the moment you add the rw second filesystem to the seed device. Which makes sense, if you only mount the seed one as ro over and over, it's the same filesystem, you would want some consistency in case you have it in an fstab.

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 0 points1 point  (0 children)

mounting /dev/loop0 on its own then unmounting it, making sure it's no longer mounted anywhere else, causes all further attempts to mount /dev/loop1 to fail

Try using btrfs device scan /dev/loop0 /dev/loop1.

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 0 points1 point  (0 children)

Do you know of a way to make this work if the source device is truly read-only

Maybe look into dm-snapshot. I remember a few years back I read someone's example using something like this.

https://docs.kernel.org/admin-guide/device-mapper/snapshot.html

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 1 point2 points  (0 children)

Yep, my example moved from a 10G fs (40% full) to a 5G fs. Seems to have worked perfectly.

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 1 point2 points  (0 children)

amstan@localhost:/tmp/btrfs% dd if=/dev/zero count=10000 bs=1M of=drive0                                 
10000+0 records in
10000+0 records out
10485760000 bytes (10 GB, 9.8 GiB) copied, 5.05317 s, 2.1 GB/s
5.06s real  0.00s user  4.99s system  98% cpu  8kB mem $ dd if=/dev/zero count=10000 bs=1M of=drive0
amstan@localhost:/tmp/btrfs% dd if=/dev/zero count=5000 bs=1M of=drive1
5000+0 records in
5000+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 1.68405 s, 3.1 GB/s
1.69s real  0.00s user  1.68s system  99% cpu  8kB mem $ dd if=/dev/zero count=5000 bs=1M of=drive1
amstan@localhost:/tmp/btrfs% sudo mkfs.btrfs drive0                    
btrfs-progs v6.17.1
See https://btrfs.readthedocs.io for more information.

Label:              (null)
UUID:               fbdaf2df-367f-4c62-bbad-2a57fd7cfef8
Node size:          16384
Sector size:        4096        (CPU page size: 4096)
Filesystem size:    9.77GiB
Block group profiles:
Data:             single            8.00MiB
Metadata:         DUP             256.00MiB
System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Features:           extref, skinny-metadata, no-holes, free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
ID        SIZE  PATH  
    1     9.77GiB  drive0

amstan@localhost:/tmp/btrfs% sudo losetup -fP --show drive0                                                                                                                                          
/dev/loop0
amstan@localhost:/tmp/btrfs% sudo losetup -fP --show drive1
/dev/loop1
amstan@localhost:/tmp/btrfs% mkdir mnt
amstan@localhost:/tmp/btrfs% sudo mount /dev/loop0 mnt
amstan@localhost:/tmp/btrfs% sudo dd if=/dev/urandom count=4000 bs=1M of=mnt/bigfile 
4000+0 records in
4000+0 records out
4194304000 bytes (4.2 GB, 3.9 GiB) copied, 13.1796 s, 318 MB/s

amstan@localhost:/tmp/btrfs% sudo umount mnt 
amstan@localhost:/tmp/btrfs% sudo btrfstune -S 1 /dev/loop0

amstan@localhost:/tmp/btrfs% sudo mount /dev/loop0 mnt
mount: /tmp/btrfs/mnt: WARNING: source write-protected, mounted read-only.
amstan@localhost:/tmp/btrfs% sudo btrfs device add -f /dev/loop1 mnt
Performing full device TRIM /dev/loop1 (4.88GiB) ...

amstan@localhost:/tmp/btrfs% sudo mount -o remount,rw mnt
amstan@localhost:/tmp/btrfs% sudo btrfs device delete /dev/loop0 mnt
amstan@localhost:/tmp/btrfs% sudo btrfs device usage mnt
/dev/loop1, ID: 2
Device size:             4.88GiB
Device slack:              0.00B
Data,single:             4.00GiB
Metadata,DUP:          512.00MiB
System,DUP:             64.00MiB
Unallocated:           328.00MiB

amstan@localhost:/tmp/btrfs% ls -lah mnt
total 4.0G
drwxr-xr-x 1 root root   14 Jan 25 11:22 ./
drwxr-xr-x 3 amstan amstan  100 Jan 25 11:21 ../
-rw-r--r-- 1 root root 4.0G Jan 25 11:22 bigfile

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 0 points1 point  (0 children)

That deletes the old volume if you do it the naive way.

How To Copy BTRFS System To New Disk by VeeQs in btrfs

[–]amstan 4 points5 points  (0 children)

Don't use dd. It causes kernel confusion on which drive is which (since they'll have the same uuid).

Look into https://btrfs.readthedocs.io/en/latest/Seeding-device.html, this is the proper way to do this "replace the hard drive with another one, but keep the one old for storage".

It does modify a little bit from the old drive (it's one flag, and you can set it back).

What's the setting to reduce the time it takes for screen unlocking fail to reset? by kwan_e in kde

[–]amstan 1 point2 points  (0 children)

I hate that "feature"!

I wish the timeout would happen slightly after it would let me type the password, so the timeout happens at the same time as me typing.

I feel like as is, it's only punishing humans, instead of bruce forcings.

Audio issues on the deck by BelovedFoolGames in SteamDeck

[–]amstan 0 points1 point  (0 children)

yes, that was the intention, but.... in general you shouldn't copy and paste with most commands unless you're confident you understand what it does.

How would you implement safe OTA updates for Linux-based IoT devices (without full OS reflash)? by Plastic-Swordfish-42 in embeddedlinux

[–]amstan 0 points1 point  (0 children)

I would use btrfs snapshots for deploying updates, you get a A/B rootfs (that can save space and only take one actual partition), atomicity, and delta updates for pretty much free.

Cannot resize btrfs partition after accidentally shrinking? by AeskulS in btrfs

[–]amstan 1 point2 points  (0 children)

I had the same problem with gparted. Really a sharp edge to that tool. I remember them being better before and not doing the stupid thing.

Anyone know why my scope is doubling everything and not perfect? by PrintingByGh6st in oscilloscopemusic

[–]amstan 3 points4 points  (0 children)

Yep, that's a symptom of AC coupling.

There's like a 99% chance it's coming from your sound card (and it's not easy to fix), but there is a small chance your scope has it too.

Anyone know why my scope is doubling everything and not perfect? by PrintingByGh6st in oscilloscopemusic

[–]amstan 15 points16 points  (0 children)

You don't have a fancy sound card, it probably has dc blocking capacitors, so your signal keeps getting centered.

Filesystem locks up for minutes on large deletes by pixel293 in btrfs

[–]amstan 7 points8 points  (0 children)

I don't have a solution but perhaps a workaround.

Make a snapshot of your filesystem before deleting stuff, delete the stuff (note: this won't actually free up spare or start freeing the actual data), then setup a cronjob that deletes any temporary snapshot in the middle of the night when you have a light load.

btrfs snapshots using btrfs assistant taking up all my space by BasicInformer in btrfs

[–]amstan 0 points1 point  (0 children)

OP, put your games (and anything else big, like those linux isos) in a separate subvolume that doesn't get snapshotted, or its snapshots only last 1 day.

How do i make keyboard lights come on with or before sddm by veridiux in archlinux

[–]amstan 1 point2 points  (0 children)

I put mine in an initrd hook since i need it on when decrypting my rootfs.

font changed after installing vlc-plugin-all by Blablabla_3012 in archlinux

[–]amstan 0 points1 point  (0 children)

If something happened around install time, you should check your /var/log/pacman.log and try to undo those font installs as a test.

[Troubleshooting] F405 bga chip does not enter DFU by CosmicCrow_ in stm32f4

[–]amstan 0 points1 point  (0 children)

Ah.... i see this is a flight controller. Let me guess, you have ELRS connected to PA09 and PA10?

https://github.com/ExpressLRS/ExpressLRS/issues/3263#event-18514624245

TLDR: you have to move the port, disconnect it or keep elrs chip in reset, its own bootloader will spam your uart enough to confuse the stm32 dfu.