btrfs advice needed
I've got a corrupted btrfs partition. Does the archlinux install disk have btrfsck on it? If yes, I'll probably need to run btrfs --repair /dev/sda2 on the system. If repair goes badly, I'll have to reinstall the system. I would like to know how to prevent btrfs corruption in the first place. -- Jude <jdashiel at panix dot com> "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." Ed Howdershelt 1940.
On Fri, Nov 10, 2023 at 09:13:07PM -0500, Jude DaShiell wrote:
I've got a corrupted btrfs partition. Does the archlinux install disk have btrfsck on it? If yes, I'll probably need to run btrfs --repair /dev/sda2 on the system. If repair goes badly, I'll have to reinstall the system.
Hi, Jude. The arch iso does indeed have btrfs-progs, but running a --repair is not always the correct course of action for a broken btrfs mount. For certain issues, it can make things worse. I would suggest asking for advice on the btrfs kernel mailing list: linux-btrfs@vger.kernel.org You should give the exact error messages / dmesg output you get when attempting to mount the btrfs partition.
I would like to know how to prevent btrfs corruption in the first place.
Generally speaking, btrfs is fairly robust against corruption. There are a few things that it is more sensitive to than other filesystems, however. Faulty RAM can cause metadata corruptions that render a btrfs filesystem unmountable. It's often advised to do a memtest on your system if you get unexpected filesystem errors. Cheap storage media that lies about FLUSH command completions is very likely to corrupt btrfs in the event of a system crash or unexpected poweroff. And the parity raid modes (raid 5 / 6) are still considered experimental and cannot be relied upon for repairing corrupted data. --Sean
On Sat, 11 Nov 2023 at 03:31, Jude DaShiell <jdashiel@panix.com> wrote:
I've got a corrupted btrfs partition.
That sucks; sorry!
Does the archlinux install disk have btrfsck on it?
Yes
I would like to know how to prevent btrfs corruption in the first place.
Use a more stable filesystem? đ Really sorry, but you walked right into that one. It sucks that it got corrupted, and I believe it's less prone to corruption than it used to be, but personally I still avoid it because it's only just reaching maturity. I hope you have some backups of anything important. All the best, Paul
Is ext4 the most stable available? -- Jude <jdashiel at panix dot com> "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." Ed Howdershelt 1940. On Sat, 11 Nov 2023, Paul Dann wrote:
On Sat, 11 Nov 2023 at 03:31, Jude DaShiell <jdashiel@panix.com> wrote:
I've got a corrupted btrfs partition.
That sucks; sorry!
Does the archlinux install disk have btrfsck on it?
Yes
I would like to know how to prevent btrfs corruption in the first place.
Use a more stable filesystem? đ Really sorry, but you walked right into that one. It sucks that it got corrupted, and I believe it's less prone to corruption than it used to be, but personally I still avoid it because it's only just reaching maturity. I hope you have some backups of anything important.
All the best, Paul
On 11/11/23 12:55 PM, Jude DaShiell wrote:
Is ext4 the most stable available?
I don't know how one would define "the most stable". But I've been using XFS for many years, and ext4 for a few years as well, and I've never suffered a corruption with either one. DR
On Sat, Nov 11, 2023 at 11:59:05AM +0000, Paul Dann wrote:
I would like to know how to prevent btrfs corruption in the first place.
Use a more stable filesystem? đ Really sorry, but you walked right into that one. It sucks that it got corrupted, and I believe it's less prone to corruption than it used to be, but personally I still avoid it because it's only just reaching maturity. I hope you have some backups of anything important.
I would say that the core of btrfs is definitely stable* and usable, and I use it as the root filesystem on all of my laptops, desktops, servers, and a few ARM single-board computers. I have never had it randomly corrupt without there being some failure of the underlying storage, and in fact I find that btrfs is more likely to show you issues with your storage early, when you still have the chance to recover things. For example, in Jude's post to the btrfs-dev mailing list, this log line:
[ 1.647025] BTRFS info (device sda2): bdev /dev/sda2 errs: wr 0, rd 0, flush 0, corrupt 16, gen 0
tells you that this particular filesystem has seen 16 silent corruptions. In other words, the disk returned blocks that were different from what was written without giving any explicit errors. Almost no other filesystem will give you that kind of information. As an aside to Jude, your message to the btrfs mailing list does not include any actual error messages. Does the partition actually mount successfully? If so, then there is likely nothing to repair, and I would focus on trying to find the cause of the corruptions (typically faulty RAM or a failing hard drive). --Sean * So long as you do not use parity raid or quotas.
Yes, /dev/sda2 mounts successfully. -- Jude <jdashiel at panix dot com> "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." Ed Howdershelt 1940. On Sun, 12 Nov 2023, Sean Greenslade wrote:
On Sat, Nov 11, 2023 at 11:59:05AM +0000, Paul Dann wrote:
I would like to know how to prevent btrfs corruption in the first place.
Use a more stable filesystem? đ Really sorry, but you walked right into that one. It sucks that it got corrupted, and I believe it's less prone to corruption than it used to be, but personally I still avoid it because it's only just reaching maturity. I hope you have some backups of anything important.
I would say that the core of btrfs is definitely stable* and usable, and I use it as the root filesystem on all of my laptops, desktops, servers, and a few ARM single-board computers. I have never had it randomly corrupt without there being some failure of the underlying storage, and in fact I find that btrfs is more likely to show you issues with your storage early, when you still have the chance to recover things.
For example, in Jude's post to the btrfs-dev mailing list, this log line:
[ 1.647025] BTRFS info (device sda2): bdev /dev/sda2 errs: wr 0, rd 0, flush 0, corrupt 16, gen 0
tells you that this particular filesystem has seen 16 silent corruptions. In other words, the disk returned blocks that were different from what was written without giving any explicit errors. Almost no other filesystem will give you that kind of information.
As an aside to Jude, your message to the btrfs mailing list does not include any actual error messages. Does the partition actually mount successfully? If so, then there is likely nothing to repair, and I would focus on trying to find the cause of the corruptions (typically faulty RAM or a failing hard drive).
--Sean
* So long as you do not use parity raid or quotas.
participants (4)
-
David Rosenstrauch
-
Jude DaShiell
-
Paul Dann
-
Sean Greenslade