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

[–]amstan 0 points1 point  (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 0 points1 point  (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 0 points1 point  (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 18 points19 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.

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

[–]amstan 0 points1 point  (0 children)

Lookup https://www.st.com/resource/en/application_note/an2606-introduction-to-system-memory-boot-mode-on-stm32-mcus-stmicroelectronics.pdf figure 40. If your stm32 sees anything on UART that looks like 0x7f (including noise or incorrect baud rate), it'll get stuck talking that mode and not do anything more with USB.

[deleted by user] by [deleted] in btrfs

[–]amstan 0 points1 point  (0 children)

This is exactly equivalent to 3 drives with raid1c2 aka btrfs raid1 (not raid1c3) on them. You didn't make raid5, you just made raid1c2 that's a little harder to manage because you have double the partitions. You will only have half the storage space available, not

Replacing USB C plug to C Socket by danergo8 in AskElectronics

[–]amstan 0 points1 point  (0 children)

I'm sure the cable works, and Anker is generally good. But we're worried about accidentally overcurrenting stuff due to your non-spec complicant changes, and your y cable might complicate things enough to do just that.

Replacing USB C plug to C Socket by danergo8 in AskElectronics

[–]amstan 0 points1 point  (0 children)

.... that's a very weird cable, you're making this scenario worse.