Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] [OT] busybox fsck vs. fsck.ext4 ... experiences?

565 views
Skip to first unread message

tu...@posteo.de

unread,
Mar 29, 2017, 10:50:03 PM3/29/17
to
Hi,

Before doing the wrong decision:
How "secure" is it to use fsck of busybox in a limited environment
(SoC) to check sdcard partitions (etx4) occasionally instead of using
fsck.ext4 ?
Does someone has some experiences with this ?

Thanks a lot in advance for any help!
Cheers
Meino

Jonathan Callen

unread,
Mar 30, 2017, 7:00:02 PM3/30/17
to
The fsck applet provided by busybox is just the fsck(8) driver, which
calls the fsck.${FSTYPE} command to actually check the filesystem. You
still need fsck.ext4/e2fsck from e2fsprogs to actually do the check.

--
Jonathan Callen

tu...@posteo.de

unread,
Mar 30, 2017, 11:20:02 PM3/30/17
to
Hi Jonathan,

thanks for your reply! :)

That means, that one or both of the other binaries have to be
somewhere on the sdcard...
I have to search deeper ;)

Cheers
Meino

Adam Carter

unread,
Mar 31, 2017, 1:40:02 AM3/31/17
to
Wikipedia says "BusyBox is software that provides several stripped-down Unix tools in a single executable file."

Its also statically linked, so you dont need any libraries;
$ file /bin/busybox
/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, stripped, with debug_info

The fsck.*'s are built in

Nils Freydank

unread,
Mar 31, 2017, 5:10:04 AM3/31/17
to
[...]
> The fsck.*'s are built in

I agree:

% bb
~ $ which fsck
~ $ fsck -v
fsck (busybox 1.26.2, 2017-03-12 11:38:12 CET)


--
GPG fingerprint: '00EF D31F 1B60 D5DB ADB8 31C1 C0EC E696 0E54 475B'
Nils Freydank
signature.asc

tu...@posteo.de

unread,
Mar 31, 2017, 10:00:03 AM3/31/17
to
Ok, if its builtin then back to the initial question:
How does this implementation compares to the "official" stuff of
e2fsprogs and friends?
Any experiences with that ?

Thanks a lot for any help in advance!

Cheers
Meino

Jonathan Callen

unread,
Mar 31, 2017, 5:10:04 PM3/31/17
to
e2fsprogs provides two different executables that matter for this
discussion, fsck and e2fsck. There are also symlinks from fsck.ext2,
fsck.ext3, and fsck.ext4 pointing to e2fsck, so I will use these name
interchangeably. The busybox executable provides an implementation of
fsck, but not one for e2fsck. The fsck executable reads your /etc/fstab
file and calls the appropriate fsck.${FSTYPE} for each filesystem you
wish to check (and, in the case of busybox's implementation, tries to
call fsck.auto for filesystems not listed in /etc/fstab if you don't
otherwise tell it which filesystem type the filesystem is). Busybox
itself does not have any implementation of fsck.ext4, just the fsck
wrapper itself. You need an fsck.ext4 implementation to actually check
your filesystem, which can be provided by e2fsprogs's e2fsck. If you do
not have a fsck.ext4 executable, then busybox fsck will be unable to
actually do any check on your ext4 filesystem.

If your filesystem is not ext4, but instead something else, like vfat,
then you would need the appropriate fsck.vfat (or whatever), and could
use ether implementation of fsck to call it, but you would still need
fsck.vfat. The only exception to this is if you are using the minix
filesystem (which you probably aren't), in which case there is a
fsck.minix applet that can be compiled into busybox, but is not included
by default.

--
Jonathan Callen

Adam Carter

unread,
Mar 31, 2017, 9:10:02 PM3/31/17
to
Interesting that it includes fsck (any by the looks of https://busybox.net/BusyBox.html, also fsck.minix) but none of the other fsck's. The choice of mkfs is a different set, with mkfs.ext2, mkfs.minix, mkfs.reiser, mkfs.vfat included.

0 new messages