Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
33
rated 0 times [  33] [ 0]  / answers: 1 / hits: 16680  / 1 Year ago, sun, january 29, 2023, 4:47:54

Recently, I've been compelled to restart my computer a lot. When I boot, Ubuntu now starts scanning my hard drives for errors, but assures me that I can cancel if I want by pressing 'c'.



Why does Ubuntu do this? If it's necessary, why is it something I can cancel? If it's not necessary, why force me to do it? On what basis is the number of restarts decided?


More From » boot

 Answers
4

A disc check is forced by the system every 30 restarts. If you skip the disc check it will do it the next time you restart (unless you manually remove forcecheck).



You can force this yourself by putting a file forcefsck in / by issuing a



touch /forcecheck


from the terminal.



It is not necessary to always do a check when it's prompted but should be done every now and then. You can cancel it if it is not the right moment for you at that time and let it do the file system check when it is more convenient.



You can also use tune2fs to alter this behaviour.



sudo tune2fs -c 60 /dev/sdXY


will set this to 60 restarts.
You can also change this to a time period with -i:



sudo tune2fs -i 30d /dev/sdXY


for 30 days or 1m for 1 month or 10w for 10 weeks.



(replace /dev/sdXY by the device name for the partition like /dev/sda1. You can get this name by running sudo blkid or ls -lA /dev/disk/by-label if the partition is labelled)



sudo dumpe2fs /dev/sda1


will show loads and loads of information. Part of this includes:



Filesystem created:       Thu Feb 12 09:06:50 2009
Last mount time: Fri Aug 26 07:19:34 2011
Last write time: Fri Aug 26 07:19:34 2011
Mount count: 2
Maximum mount count: 25
Last checked: Fri Aug 12 07:22:16 2011
Check interval: 15552000 (6 months)
Next check after: Wed Feb 8 06:22:16 2012

[#43589] Tuesday, January 31, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lotceptin

Total Points: 374
Total Questions: 106
Total Answers: 118

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
;