Bug 33376

Summary: RESOLVED error when using /forcefsck
Product: Mageia Reporter: Ricard Alfe <ricardalfe>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Normal CC: lewyssmith
Version: 9   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Ricard Alfe 2024-07-06 20:30:33 CEST
Description of problem:

Hello, For various reasons I wanted to perform a disk analysis and I had a small error with the disk analysis through creating the /forcefsck file. I get the following error on reboot, which does not disappear until the forcefsck file is deleted.

e2fsck: invalid option  --  ‘ ‘ 

------
------
-----
-----
drakut warning; e2fsck renturned with 16
drakut warning:  *** an error ocurred during the file system check
drakut warning: *** dropping you to a shell; the system will try
drakut warning: *** to mount the filesystem(s), when you leave the shell


I know that there are other ways and that in general it is directed towards another way of carrying out forced analyses. If this is the case of widespread abandonment I would appreciate a comment.


Version-Release number of selected component (if applicable):

Linux a.b 6.6.28-desktop-1.mga9 #1 SMP PREEMPT_DYNAMIC Wed Apr 17 17:19:36 UTC 2024 x86_64 GNU/Linux

How reproducible:
yes

Steps to Reproduce:
1. touch /forcefsck
2.
3.
Comment 1 Lewis Smith 2024-07-08 21:46:13 CEST
Did you create /forcefsck to do fsck on the next re-boot? Did that happen? Or are you saying that if the file exists, the fsck fails as you note?
That is, the presence of this file causes an fsck error.

I found this advice:

1. "All you need to do is just create empty file called /forcefsck"
"sudo touch /forcefsck"
which looks like what you did. However:
"The old convenient trick of creating a file /forcefsck to force a file check on reboot does not work anymore since systemd took over initialisation"

2. View and modify PASS value in /etc/fstab
"The last column, which is column number 6, is the fsck PASS column. This is used by fsck to determine whether fsck should check the filesystem before it is mounted and in which order the given partitions in /etc/fstab should be checked. Possible entries for fstab PASS column are 0, 1 and 2. Here is what each number means.

0 – disabled, that is do not check filesystem
1 – partition with this PASS value has a higher priority and is checked first. This value is usually set to the root / partition
2 – partitions with this PASS value will be checked last
The connection between fstab PASS value, last checked value, and number of mounts value is as follows:

During the system boot, the first value which is checked is fstab PASS value. If this value is 0, then no other values are checked and fsck will NOT perform filesystem check. However, if the PASS value found in /etc/fstab is any other than 0, that is 1 or 2, then values of maximum mounts and total mounts are checked."

3. In conjunction with that,
 $ sudo tune2fs -c n <device-id>
"To ensure that your file system is checked on the next reboot, we need to manipulate the filesystem’s “Maximum mount count” parameter. The following tune2fs command will ensure that filesystem /dev/sdX is checked every time your Linux system reboots. Please note that for this to happen the fsck’s PASS value in /etc/fstab must be set to a positive integer as discussed above.
 $ sudo tune2fs -c 1 /dev/sdX
Note that this will continue to force fsck after every system reboot until you revert the setting.

Alternatively we can set fsck after every 10 reboots:
 $ sudo tune2fs -c 10 /dev/sdX
Or to disable the setting, use the value -1.
 $ sudo tune2fs -c -1 /dev/sdX
OR
 $ sudo tune2fs -c 0 /dev/sdX"

Component: New RPM package request => RPM Packages
CC: (none) => lewyssmith

Comment 2 Ricard Alfe 2024-07-16 17:52:41 CEST
thanks for the reply. My intention was a quick system check to rule out system problem, creating /forcefsck
Comment 3 Ricard Alfe 2024-07-16 17:55:12 CEST
I have already understood that this system already works.
Ricard Alfe 2024-07-16 17:56:23 CEST

Summary: error when using /forcefsck => RESOLVED error when using /forcefsck

Comment 4 Ricard Alfe 2024-07-16 17:58:40 CEST
I have already understood that this system NOT already works.
Comment 5 Lewis Smith 2024-07-17 21:27:46 CEST
You changed the title to RESOLVED; thank you, so closing. It can always be re-opened with new information.

Status: NEW => RESOLVED
Resolution: (none) => INVALID