You are not logged in.

#1 2020-12-29 07:25:21

fire100265
Member
Registered: 2020-10-05
Posts: 95

[SOLVED] I think my root partition is corrupted

Hi,

I was resizing my root partition with cfdisk when I got errors about my root partition. It cannot be mounted. Running btrfs check gives me this:

Opening filesystem to check...
bad tree block 215475978240, bytenr mismatch, want=215475978240, have=0
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system

dmesg gives me:

[   20.429514] BTRFS: device label Arch devid 1 transid 28534 /dev/sdb4 scanned by systemd-udevd (575)
[  114.514825] BTRFS info (device sdb4): disk space caching is enabled
[  114.514829] BTRFS info (device sdb4): has skinny extents
[  114.538568] BTRFS error (device sdb4): bdev /dev/sdb4 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0
[  114.538652] BTRFS error (device sdb4): failed to read block groups: -5
[  114.565988] BTRFS error (device sdb4): open_ctree failed

Btrfs rescue did nothing. Is there anything I can do short of reinstalling Arch? I have no backups as well. Help is appreciated.

Last edited by fire100265 (2020-12-30 05:31:07)

Offline

#2 2020-12-29 11:22:16

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I think my root partition is corrupted

I honestly think it's for the better if I reinstall. Other people with this problem had to resort to reinstalling the OS. Is there any hope for me?

Offline

#3 2020-12-29 13:22:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,231

Re: [SOLVED] I think my root partition is corrupted

If you didn't resize the filesystem before resizing the partition (... I'm assuming you shrank it) you basically broke the filesystem. The only thing I'd suggest is to try and resize the partition to it's original size but I'm assuming the damage has already been done. If you intend to shrink you always need to shrink the filesystem first.

Offline

#4 2020-12-29 13:25:27

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I think my root partition is corrupted

I already tried that. It didn't work unfortunately. Is the only available option a complete reinstall?

Last edited by fire100265 (2020-12-29 13:25:37)

Offline

#5 2020-12-29 13:38:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,231

Re: [SOLVED] I think my root partition is corrupted

I know too little about btrfs to know whether there is another option so you might have to wait for someone else to chime in, but just for the future you always need to shrink the FS before shrinking the partition and the reverse for the growing case.

Offline

#6 2020-12-29 19:52:38

xerxes_
Member
Registered: 2018-04-29
Posts: 1,065

Re: [SOLVED] I think my root partition is corrupted

Don't give up so fast (unless you have no time)! It's great opportunity to gain some experience in repairing btrfs, even if it would be unsuccessful.

Do image of that partition (you should start with that first!), make btrfs filesystem change size to fit it in partition, if it isn't already. The best would be orginal size or something similar.

And see this links FIRST:
https://btrfs.wiki.kernel.org/index.php/Restore
https://www.mail-archive.com/linux-btrf … 91854.html
https://ownyourbits.com/2019/03/03/how- … partition/
https://www.suse.com/support/kb/doc/?id=000018769
https://serverfault.com/questions/74230 … -partition
https://forum.rockstor.com/t/btrfs-erro … start/5569

It looks like repairing btrfs is harder, especially if it haven't it's own copy on other drives.

Last edited by xerxes_ (2020-12-29 19:59:16)

Offline

#7 2020-12-30 00:21:59

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I think my root partition is corrupted

I already tried all of that. Btrfs restore only restored /opt and a few files in /etc. Btrfsck gave me the same errors that everything else gave me. It couldn't be checked.
Edit: a reinstall seems like the only option at this point.

Last edited by fire100265 (2020-12-30 00:22:22)

Offline

#8 2020-12-30 05:30:47

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I think my root partition is corrupted

I reinstalled Arch. I'll mark this thread as solved.

Offline

Board footer

Powered by FluxBB