Bug 625967 - Missing fsck.btrfs
Summary: Missing fsck.btrfs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: btrfs-progs
Version: 15
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Josef Bacik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 743777 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-21 00:55 UTC by Felipe Contreras
Modified: 2013-06-04 23:34 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-02 21:46:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
SPEC file patch to create fsck.btrfs -> btrfsck symlink (1.47 KB, patch)
2011-05-20 22:00 UTC, Ian Pilcher
no flags Details | Diff

Description Felipe Contreras 2010-08-21 00:55:26 UTC
It's used by tools like fsck, which is used by forcefsck and so on.

Comment 1 Ian Pilcher 2011-05-20 14:29:12 UTC
This is still missing in Fedora 15.  Adding a symlink gets rid of an
annoying boot-up message about missing fsck.btrfs.

Is there a reason for not adding this?  If not, it should be a trivial
fix.

Comment 2 Ian Pilcher 2011-05-20 22:00:50 UTC
Created attachment 500144 [details]
SPEC file patch to create fsck.btrfs -> btrfsck symlink

Comment 3 Rahul Sundaram 2011-05-20 22:10:25 UTC
Josef Bacik, 

Let me know if I can pull this patch and do a build for Rawhide.

Comment 4 Felipe Contreras 2011-05-21 00:43:06 UTC
Who cares if fsck.btrfs doesn't actually do anything?

Comment 5 Felipe Contreras 2011-06-09 11:56:41 UTC
Maybe this should be merged with bug #689512.

Comment 6 Shawn 2011-07-10 21:42:46 UTC
The issue is that systemd-units includes a service file that forces an fsck. I think every boot. That is great except my /home partition is formatted with btrfs and is LUKS encrypted. When the system boots it forces a fsck.btrfs on the LUKS partition. When the fsck fails then I get no partition. No partition means it drops out to a root login and no matter what I can't get it to boot further because it won't go with out the home directory. 

So I end up rebooting and about one in 5 to 7 times it boots in an order where LUKS gets to decrypt the partition before fsck messes things up. As this is my laptop my battery is usually 3/4 dead from constantly rebooting before I can finally get to the desktop.

If there isn't a working fsck.btrfs then systemd shouldn't be trying to force it. The forced relabel on systems that have selinux disabled is is in the same boat.

Comment 7 Michal Schmidt 2011-10-06 07:38:25 UTC
*** Bug 743777 has been marked as a duplicate of this bug. ***

Comment 8 Harald Hoyer 2011-10-06 08:11:04 UTC
Hmm, Josef mentioned, that no fsck should be done ever by systemd on btrfs devices. btrfsck should only be run by an administrator in case the mount fails.

Same applies to xfs, IIRC.

Comment 9 Kay Sievers 2011-10-06 10:56:32 UTC
You probably want to set the passno in /etc/fstab to 0 (see 'man fstab').
Btrfs filesystems are not supposed to be checked on bootup.

I don't think there is a tool missing in this context, btrfsck is a manual
repair tool.

Are we sure this bug can't be closed?

Comment 10 Ian Pilcher 2011-10-27 16:27:50 UTC
(In reply to comment #9)
> I don't think there is a tool missing in this context, btrfsck is a manual
> repair tool.

Can you expound on this statement a bit?

> Are we sure this bug can't be closed?

Does btrfsck actually do anything?  If so, then I would think that the
fsck.btrfs symlink should be present.  If not, then why is it there?

Comment 11 Kay Sievers 2012-01-20 20:34:14 UTC
Btrfs is usually not supposed to be checked by userspace before it is
mounted. There is no tool to be called, and no tool should be hooked up here
in the future. Userspace fsck for a COW filesystem sounds pretty much like
backwards logic.

A repair tool, which is run by the admin only, to help if things go really
wrong is very useful though.

This is the btrfs in-kernel stuff, which completes the picture:
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=c975dd469d748ce619c510050d4fb407c2398591

For the background on fsck, you might want to read what the zfs guys have to
say:
  http://www.osnews.com/story/22423

Comment 12 Ian Pilcher 2012-01-20 21:20:54 UTC
(In reply to comment #6)
> The issue is that systemd-units includes a service file that forces an fsck. I
> think every boot. That is great except my /home partition is formatted with
> btrfs and is LUKS encrypted. When the system boots it forces a fsck.btrfs on
> the LUKS partition. When the fsck fails then I get no partition. No partition
> means it drops out to a root login and no matter what I can't get it to boot
> further because it won't go with out the home directory. 

Shawn - Does setting passno to 0 for your /home partition fix your problem?

If it does, I would be fine with closing this.  (Although maybe fsck.btrfs could be a program that emits/logs some sort of explanatory message about why it shouldn't be used?)

Comment 13 Felipe Contreras 2012-02-02 21:46:21 UTC
Let's close this.

(In reply to comment #6)
> The forced relabel on systems that have selinux disabled is is in the same
> boat.

Indeed, I had exactly the same issue. Is there a bug report for that? It's one of the reasons I decided to stop using Fedora. Clearly, the move to systemd was rushed.

But that's a separate bug that should be tracked separately, and it's a systemd issue. The system should boot even if there's no fsck.*

A fsck.btrfs wrapper that explain why there isn't one would be nice, but nobody is stopping anybody from doing it *right now*.


Note You need to log in before you can comment on or make changes to this bug.