u/Afillatedcarbon

▲ 0 r/NixOS

I recently switched my /nix to a different drive after completely formatting the drive that was formally used by Windows 10 and it worked pretty well(I used btrfs for that zstd compression and the inode limit I read about for ext4).

I was doing fine till the I booted into windows and saw that the drive I wiped was still showing in the file manager and disk management with ntfs format and disk usage more than the /nix directory used. I was immediately suspicious, did the work I need to and rebooted into my nixos system and I seemingly couldn't rebuild or even use the nix shell anymore

https://preview.redd.it/fjgtbdd9llyg1.png?width=950&format=png&auto=webp&s=2c28dab13755cee61423fd18aea8b23164271086

https://preview.redd.it/gt1vet2bllyg1.png?width=961&format=png&auto=webp&s=72fd21f0d196172f7512be1c3c28fe2a809fecc4

I checked with btrfs' scrub and saw this

https://preview.redd.it/41zbahlellyg1.png?width=504&format=png&auto=webp&s=2e66e34d0378f3e8926b0c743553c79d0d5e6632

I was wondering how how big the damage was an I saw in dmesg that glibc, some font, and some dependencies were affected

```

❯ sudo dmesg | grep -i "checksum error"
[ 1521.891114] BTRFS warning (device sdd1): scrub: checksum error at logical 15859712 on dev /dev/sdd1, physical 15859712 root 5 inode 796 offset 0 length 4096 links 1 (path: store/0p6bhy7i6wmrxw02fchjps71mj8qq92j-opencore-amr-0.1.6.tar.gz.drv)
[ 1521.891186] BTRFS warning (device sdd1): scrub: checksum error at logical 15728640 on dev /dev/sdd1, physical 15728640 root 5 inode 766 offset 0 length 4096 links 1 (path: store/0mfk7fv32lhp6agimsm1ghgzx58c84pz-binutils-patchelfed-ld-wrapper-2.46.drv)
[ 1521.899922] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.899947] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.899969] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.899990] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.900011] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.900031] BTRFS warning (device sdd1): scrub: checksum error at logical 18481152 on dev /dev/sdd1, physical 18481152 root 5 inode 1320 offset 4096 length 4096 links 1 (path: store/1fc1a0wd7fg6vjihgsr42n4j0za0shjy-cairo-1.18.4.drv)
[ 1521.903897] BTRFS warning (device sdd1): scrub: checksum error at logical 19726336 on dev /dev/sdd1, physical 19726336 root 5 inode 1597 offset 0 length 4096 links 1 (path: store/1v21lknhr281yjlxywc8p05iif3ng9rc-source.drv)
[ 1521.903931] BTRFS warning (device sdd1): scrub: checksum error at logical 19660800 on dev /dev/sdd1, physical 19660800 root 5 inode 1581 offset 0 length 4096 links 1 (path: store/1s4axvz7zrvs0igm4bqvl61hk0sr6lx1-git-minimal-2.53.0.drv)
[ 1530.000497] BTRFS warning (device sdd1): scrub: checksum error at logical 2079850496 on dev /dev/sdd1, physical 3161980928 root 5 inode 249130 offset 45056 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM930.so)
[ 1530.000498] BTRFS warning (device sdd1): scrub: checksum error at logical 2079916032 on dev /dev/sdd1, physical 3162046464 root 5 inode 249131 offset 8192 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM932.so)
[ 1530.000570] BTRFS warning (device sdd1): scrub: checksum error at logical 2079916032 on dev /dev/sdd1, physical 3162046464 root 5 inode 249131 offset 8192 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM932.so)
[ 1530.000571] BTRFS warning (device sdd1): scrub: checksum error at logical 2079850496 on dev /dev/sdd1, physical 3161980928 root 5 inode 249130 offset 45056 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM930.so)
[ 1530.000615] BTRFS warning (device sdd1): scrub: checksum error at logical 2079850496 on dev /dev/sdd1, physical 3161980928 root 5 inode 249130 offset 45056 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM930.so)
[ 1530.000655] BTRFS warning (device sdd1): scrub: checksum error at logical 2079850496 on dev /dev/sdd1, physical 3161980928 root 5 inode 249130 offset 45056 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/IBM930.so)
[ 1530.000721] BTRFS warning (device sdd1): scrub: checksum error at logical 2081751040 on dev /dev/sdd1, physical 3163881472 root 5 inode 249189 offset 16384 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/NATS-DANO.so)
[ 1530.000741] BTRFS warning (device sdd1): scrub: checksum error at logical 2081882112 on dev /dev/sdd1, physical 3164012544 root 5 inode 249195 offset 20480 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/SJIS.so)
[ 1530.000766] BTRFS warning (device sdd1): scrub: checksum error at logical 2081751040 on dev /dev/sdd1, physical 3163881472 root 5 inode 249189 offset 16384 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/NATS-DANO.so)
[ 1530.000817] BTRFS warning (device sdd1): scrub: checksum error at logical 2081882112 on dev /dev/sdd1, physical 3164012544 root 5 inode 249195 offset 20480 length 4096 links 1 (path: store/5y5cwf866a2557qrpz2aff998kwc0ysp-glibc-2.42-61/lib/gconv/SJIS.so)
[ 1562.747742] BTRFS warning (device sdd1): scrub: checksum error at logical 15239282688 on dev /dev/sdd1, physical 16321413120 root 5 inode 397362 offset 2711552 length 4096 links 1 (path: store/a15nh1nd09cvncjy8hdh4km20hwp1c26-nerd-fonts-iosevka-3.4.0+33.2.1/share/fonts/truetype/NerdFonts/Iosevka/IosevkaNerdFontMono-ExtraLightItalic.ttf)
[ 1631.200855] BTRFS warning (device sdd1): scrub: checksum error at logical 43065868288 on dev /dev/sdd1, physical 45221740544 root 5 inode 1288631 offset 85786624 length 4096 links 1 (path: store/yl9g6k2xrxqz6fmscds7dwd5wzr56fkv-source-han-serif-2.003/share/fonts/opentype/source-han-serif/SourceHanSerif.ttc

```

So my solution to this problem was to reformat the /nix drive and use nixos-install to install everything again, which took a lot of time on my older system. After the nixos-instal;, my mount point for the /nix was the btrfs reformatted drive but it wouldn't boot because that drive was empty, turns out it installed everything to a different /nix directory on my root drive for some reaon(I still haven't figured out why, I did mount that partition under /mnt/nix and the uuid was correct). I had to go through the procedure that I did before to have a seperate /nix drive.

All in all it was /nix in the end, which is easily reproducible, but I wonder what would have happened if I lost my /home, I still don't have everything backed up there. Why does Microsoft do this? I even disabled fast boot a while ago but it still did this, was it a windows update that changed it back? I thought Windows 10 was more friendly towards linux than 11 but I seem mistaken. Very soon that Windows 10 drive is going to become my new /home mount point at this point.

I would like to know if there anything different I could have done here to save my /nix partition. Also does anyone whats happening to wherever spicetify gets it spotify snap from? My nixos-install couldn't continue and I had to remove spicetify to make it work.

reddit.com
u/Afillatedcarbon — 13 days ago