[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unknown option: -a to fsck.btrfs



On Sat, Jun 22, 2013 at 03:29:36PM +0100, Dan Dart wrote:
> Recently after an upgrade to my Debian system (and after a certain
> number of mounts) whose rootfs is on btrfs, my system now goes to
> maintenance shell mode because it can't run fack against the root fs.
> 
> Whilst attempting to fsck all my disks, it stumbled on fsck.btrfs:
> 
> Unknown option: -a
> usage: btrfs [--help] [--version] <group> [<group>...] <command> [<args>]
> 
> Is this a bug in the way the filesystem is calling it, the fact that
> fsck.btrfs only currently works on unmounted (not RO mounted) or am I
> doing something stupid here (like for instance having btrfs on rootfs
> isn't considered sensible yet)?

Well, *I* wouldn't use btrfs for / at this point, unless I was
doing it specifically to test something. If you read the btrfs
man page, it says:

       Btrfs filesystem is currently under heavy
       development,  and not suitable for any uses other than
       benchmarking and review. 

Your initrd tries to mount your root filesystem, and if it
determines that it is dirty or past the expiration of time or
runs since last fsck, it helpfully tries to run an automated
fsck for you.

Unfortunately, btrfs doesn't have a fsck that accepts:

-a     Automatically repair the file system without any
questions

and so it falls over.

You can avoid this problem, but it's a hack:

rm /sbin/fsck.btrfs
cp /bin/true /sbin/fsck.btrfs

Now, you should regularly run a btrfs scrub of each btrfs
filesystem. Put it in cron and run it weekly or monthly.

Run btrfsck by hand when scrub tells you there's a problem.

And read the btrfs wiki at https://btrfs.wiki.kernel.org/

-dsr-


Reply to: