Re: btrfs check, btrfsck, fsck.btrfs

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

 



Chris Murphy posted on Tue, 20 May 2014 10:56:26 -0600 as excerpted:

> Should the initrd/initramfs no longer include btrfsck, and instead
> include btrfs and fsck.btrfs?

btrfs (the program) should be included in any case as btrfs device scan 
should be run (normally triggered via udev rules when a btrfs filesystem 
block device is detected) to enable mounting multi-device btrfs' (the 
filesystem) from within the initr*.

That's already the case with dracut's btrfs module, anyway, and has been 
for some time.

> In btrfs-progs 3.14 there is now a 1K /sbin/fsck.btrfs placeholder file.

To be more exact, it's a nearly noop shell-script (basically copied from 
fsck.xfs) that simply verifies that the passed in filename exists.  If it 
does, in auto-mode (if called automatically via a passno > 0 in fstab), 
it exits without error.  In non-auto-mode, it simply points the user at 
btrfs check.  If the device doesn't exist, it exits with "8" as the error 
status.  No check other than that the last parameter passed in is 
actually an existing file, not even whether it's actually a device or 
not, is done.

As btrfs (the filesystem) doesn't need a pre-mount check, the 
recommendation is to set passno to 0 for btrfs in any case, in which case 
fsck.btrfs shouldn't be needed at all.

As such, fsck.btrfs really shouldn't be needed in an initr*, since 
whatever's creating the initr* shouldn't be running a pre-mount auto-fsck 
against btrfs in any case, as to do so is certainly a bug.

(Tho with compression the incremental size of a single shell-script just 
over 1 KiB in size before compression should be trivial.)

> btrfs and btrfsck files are the same binary, the difference is btrfsck
> only can do check/repair. Including btrfs instead allows more
> flexibility to use additional subcommands, and it's also consistent with
> fsck.btrfs which references btrfs not btrfsck.

Ideally, btrfsck would be a symlink to btrfs in btrfs-progs, and 
potentially not included in an initr* at all, or if included, likewise 
included as a symlink.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux