fsck needs /dev in path to check an ext4 partition

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

 



Hello

Apologies I am not using 2.36.1 yet. I'm on latest Ubuntu LTS, but it's using 2.34



I noticed fsck only works if I write as "/dev/sdb1" not just "sdb1" I was in /dev/ as root, so it shouldn't need long path?


These work as expected when called from /dev/ as user root

# fsck.ext4 sdb1  
# fsck.ext4 /dev/sdb1  

This does not work:
# fsck sdb1

Looking at the output, it seems like fsck sometimes goes through to e2fsck and otherwise goes through to fsck.ext4 and then fails.
If I call fsck.ext4 directly it does work.

Could fsck be changed to not require the full /dev/sdb1 path?

Seems a bit risky it defaults to trying to check a device without anything being specified.

# fsck
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
/dev/sda5 is mounted.
e2fsck: Cannot continue, aborting.


root@abc:/dev# fsck sdb1
fsck from util-linux 2.34
Usage: fsck.ext4 [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
		[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
		[-E extended-options] [-z undo_file] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list
 -z undo_file         Create an undo file



root@abc:/dev# fsck -p /dev/sdb1
fsck from util-linux 2.34
Ext4fste: clean, 458/237104 files, 117884/947120 blocks

Cheers, Jonny



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux