You are not logged in.

#1 Yesterday 21:20:42

shadefenseofficial
Member
Registered: 2026-02-23
Posts: 6

BTRFS Error after adding a partition

I am using QEMU with Arch Linux. I shrunk my root partition and added another partition, but on the next boot, it boots into the initramfs emergency shell.

These are my boot messages:

[27.276323] BTRFS error (device sda3): device total_bytes should be at most 34683330560 but found 42631954432
[27.283551] BTRFS error (device sda3): failed to read chunk tree: -22
[27.315590] BTRFS error (device sda3): open_ctree failed: -22
[FAILED] Failed to mount /sysroot.
See 'systemctl status sysroot.mount' for details.
[DEPEND] Dependency failed for Initrd Root File System.
[DEPEND] Dependency failed for Mountpoints Configured in the Real Root.
[OK] Stopped target Basic System.
[OK] Reached target Initrd File Systems
[OK] Stopped target System Initialization.
[OK ] Started Emergency Shell.
[OK ] Reached target Emergency Mode.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, or "exit"
to continue bootup.

Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.

Press Enter to continue.

When I press Enter, nothing happens. I am using the basic image on the arch-boxes Arch Linux GitLab. I might be able to boot into the installation ISO, but I don't know how to fix this.

Offline

#2 Yesterday 21:27:04

mpan
Member
Registered: 2012-08-01
Posts: 1,570
Website

Re: BTRFS Error after adding a partition

How did you shrink the partition and the filesystem?

Emphasis on the latter of the two: the error suggests it has not been done.


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 Yesterday 21:39:37

shadefenseofficial
Member
Registered: 2026-02-23
Posts: 6

Re: BTRFS Error after adding a partition

I used resizepart on parted.

Edit: I guess I didn't think to resize the filesystem

Last edited by shadefenseofficial (Yesterday 22:52:02)

Offline

#4 Yesterday 23:10:51

mpan
Member
Registered: 2012-08-01
Posts: 1,570
Website

Re: BTRFS Error after adding a partition

For the future reference, the process goes like this:

  • Initial situation

    ┌─ partition ──────────────────┐
    │██████████filesystem██████████│
    └──────────────────────────────┘
  • Shrink filesystem:

    ┌─ partition ──────────────────┐
    │█████filesystem█████          │
    └──────────────────────────────┘
  • Shrink the containing partition:

    ┌─ partition ────────┐
    │█████filesystem█████│
    └────────────────────┘

In your situation: if you only shrank the partition and wrote nothing after it, very likely nothing is lost. Partitioning data only indicates where things start and end, and Btrfs sanely bailed out. Just restore the old partition size (42631954432 bytes). Or make it bigger, it should also work. Then you should be able to follow the normal path.


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

Board footer

Powered by FluxBB