Re: fsck needs /dev in path to check an ext4 partition

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

 



Hello Adrian!

On 15/01/2021 20:15, John Paul Adrian Glaubitz wrote:
> Hello Jonny!
> 
> On 1/15/21 9:06 PM, Jonny Grant wrote:
>> 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
> 
> That's because it must be:
> 
> # fsck.ext4 ./sdb1
> 
> Filenames are expanded by your shell in this case, not by the fsck utilities.
> 
> Adrian

My apologies, I had just used # fdisk sdb
that does work # fsck.ext4 ./sdb1

However, fsck still has the issue even with # fsck ./sdb1
It only works with the full path. I'm sure I used to always just call fsck.

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#
root@abc:/dev# fsck /dev/sdb1
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Ext4fs: clean, 458/237104 files, 117884/947120 blocks





[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