how to do a fsck on a linux filesystem

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

how to do a fsck on a linux filesystem

#1 Post by labbe5 »

https://setaoffice.com/2010/05/17/runni ... countered/

You need to have utils-linux installed to do fsck.

Unmount your device, then do :
fsck -y /dev/sdb1

Note : depending on your device, it may be anything from sdb1 to sdbx. The flag -y is added to have your filesystem corrected automatically.
Do another pass to have a confirmation that your filesystem is cleaned.

To check your hard drive, you need to use a portable OS, such as Puppy or Dog, because it must be unmounted to do a fsck.

Further reading :
http://www.thegeekstuff.com/2012/08/fsc ... -examples/
https://www.howtogeek.com/howto/37659/t ... utilities/
Last edited by labbe5 on Mon 23 Oct 2017, 13:24, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#2 Post by bigpup »

Thanks for the info!

In every version of Puppy I have used.
fsck is built in.

Simply do this:

File system check at terminal
Drive has to be unmounted.
Drive id to reflect what drive to check

Code: Select all

e2fsck /dev/sda1
To see options enter e2fsck in terminal.
root# e2fsck
Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] 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
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#3 Post by perdido »

How to do an fsck automatically every boot
http://www.murga-linux.com/puppy/viewto ... e3d#756151

.

.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#4 Post by tallboy »

The flag -y is added to have your filesystem corrected automatically.
NEVER let anything happen automatically to your system without making a backup first!

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply