Today's article lets you force an fsck on system start...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,830
Reaction score
10,405
Credits
97,859
You can check your drives for errors with fsck, assuming they're unmounted and ext* formatted partitions.

I wrote this well after I'd eaten and drank my fill. Somehow, that ended up being a giant article. I am not sure how that happened.


It's a long one. That's okay. Words are good.
 


Good article David and handy too.

I've never had to use fsck or tune2fs.....but it's now in my stock of 'How To's' for Linux.
 
I've never ran fsck...once in a blue moon I might run SMART only because everything seems fine...maybe because it's an SSD.
m1212.gif


I remember in the dark days of windowz running chkdsk on a HDD which took forever and was a waste of time...the last thing I need is taking longer to Boot running a test.
m09010.gif
 
I've never had to use fsck or tune2fs.....but it's now in my stock of 'How To's' for Linux.

It's always good to check 'em once in a while. Glad ya liked the article.

I've never ran fsck...

It's worth checking once in a while. It's about filesystem health, not about the hardware's health. Well, bad fsdk results could mean a hardware issue but that's not really the objective of the test.

Today's filesystems are fairly robust. If you regularly lose power, this might be something you'd run more often.
 
I did some research and found for me it's easier to run this with the live session...
2023-11-26-00-58.png


m1212.gif
 
I did some research and found for me it's easier to run this with the live session...
2023-11-26-00-58.png


m1212.gif

That's definitely one way to go about it - and it'll work.

I'm not sure how often you should check these sort of things, but they probably should be checked once in a while.

I wasn't paying attention and just ran a dd command against my root drive.

Fortunate for me, I have recent backups that I can restore from.
 
lsblk:
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 232.4G 0 part /

The syntax to enable fsck on system start
Code:
<pre><font color="#8AE234"><b>brian@brian-desktop</b></font>:<font color="#729FCF"><b>~</b></font>$ sudo tune2fs -c &lt;frequency&gt; /dev/nvme0n1p2
bash: frequency: No such file or directory


So the terminal command becomes: 

sudo tune2fs -c 1 nvme0n1p2        ....(correct ?)

It returns :
brian@brian-desktop:~$ sudo tune2fs -c 1 nvme0n1p2
tune2fs 1.46.5 (30-Dec-2021)
tune2fs: No such file or directory while trying to open nvme0n1p2
Couldn't find valid filesystem superblock.
brian@brian-desktop:~$

Didn't hold my tongue correctly ?
 
lsblk:
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 232.4G 0 part /

The syntax to enable fsck on system start
Code:
<pre><font color="#8AE234"><b>brian@brian-desktop</b></font>:<font color="#729FCF"><b>~</b></font>$ sudo tune2fs -c &lt;frequency&gt; /dev/nvme0n1p2
bash: frequency: No such file or directory


So the terminal command becomes:

sudo tune2fs -c 1 nvme0n1p2        ....(correct ?)

It returns :
brian@brian-desktop:~$ sudo tune2fs -c 1 nvme0n1p2
tune2fs 1.46.5 (30-Dec-2021)
tune2fs: No such file or directory while trying to open nvme0n1p2
Couldn't find valid filesystem superblock.
brian@brian-desktop:~$

Didn't hold my tongue correctly ?
The command needs the device name: /dev/nvme0n1p2 :)
 
See ?!....I knew it....I wasn't holding my tongue right.

brian@brian-desktop:~$ sudo tune2fs -c 1 /dev/nvme0n1p2
[sudo] password for brian:
tune2fs 1.46.5 (30-Dec-2021)
Setting maximal mount count to 1
brian@brian-desktop:~$
 
I would assume this will only give a 'report' of some sort if there is a problem ??

The 'interruption' to my boot time was some fraction of a second
 
Disk destroyer?

Yup...

It's looking like my most recent backups are corropted. This would be my fault fot not verifying it,

Fortunately, I have backups of backups. I just need to get motivated to fix things.
 

Members online


Latest posts

Top