Skip to content

Instantly share code, notes, and snippets.

@mzhboy
mzhboy / btrfs fix after power loss.md
Created January 9, 2026 13:40
Btrfs fix: partition not recognized after power loss

Btrfs fix: partition not recognized after power loss

Problem Background

Due to an unexpected power outage during a write operation, the Btrfs partition became unrecognizable by the system and couldn't be mounted properly. Strangely, the fdisk -l command showed completely incorrect partition sizes, but the parted tool could still correctly identify this as a Btrfs partition. This was a nerve-wracking data recovery experience, and here's my complete record of the repair process for future reference.

Repair Methods Attempted

Initial Diagnosis

@mzhboy
mzhboy / add_PowerShell5Here.reg
Created October 15, 2024 14:37
add `powershell5here` to right menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\directory\shell\PowerShell5Here]
@="PowerShell5 Here"
"Icon"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0"
[HKEY_CLASSES_ROOT\directory\shell\PowerShell5Here\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoLogo -Command \"Set-Location -LiteralPath '%V'\""
@mzhboy
mzhboy / ffmpeg.md
Last active April 12, 2023 07:41 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"