Archive for the tag 'Fsck'

SBDavid

fsck - how much % fsck is completed

fsck - how much % fsck is completed

-C [ "fd" ]
Display completion/progress bars for those filesystem checkers (currently only for ext2 and ext3) which support them. Fsck will manage the filesystem checkers so that only one of them will display a progress bar at a time. GUI front-ends may specify a file descriptor fd, in which case the progress bar information will be sent to that file descriptor.

Note : Make sure that partition is not mounted while running fsck.

Many time due to big partition size ,we have to wait for the long time at that time we think fsck process is stuck at that time we can use the following fsck command because its showing the % for the fsck process, so that we are able to see how much % fsck is completed and remaining.

fsck -y -C0 /dev/sdb1
SBDavid

How can I force fsck on next boot

How can I force fsck on next boot

You can force an automatic full check by changing the check interval using tune2fs (-c and/or -i).

-c max-mount-counts

Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.

-i interval-between-checks[d|m|w]

Adjust the maximal time between two filesystem checks. No postfix or d result in days, m in months, and w in weeks. A value of zero will disable the time-dependent checking.

It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic full e2fsck(8) checking of the filesystem.

# tune2fs -c 1 /dev/hda2

The above command would tell the init scripts to run fsck on hda2 at every boot.

# tune2fs -i 1d /dev/hda2

The above command would tell the init scripts to run fsck on hda2 after 1 day.

If you only want to run fsck on the next boot, please execute the following as the root user.

# cd /
# touch forcefsck

This will only run the file system check on the next reboot. By touching the file “forcefsck” in the / directory, it will force the system to perform a full file system check.

The file “forcefsck” will be deleted automatically after fsck is finished.

fsck - check and repair a Linux file system

fsck - check and repair a Linux file system

fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems.

If no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in /etc/fstab serially.

This is equivalent to the -As options.

The exit code returned by fsck is the sum of the following conditions:

0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared library error

The exit code returned when multiple file systems are checked is the bit-wise OR of the exit codes for each file system that is checked.

Force fsck on next boot on Red Hat Enterprise Linux

If you only want to run fsck on the next boot, execute the following as the root user:

# cd /
# touch forcefsck

The file “forcefsck” will be deleted automatically after fsck is finished.

This will only run the file system check on the next reboot. By touching the file “forcefsck” in the / directory, it will force the system to perform a full file system check.

You can force an automatic full check by changing the check interval using tune2fs (-c and/or -i). For example:

The below command would tell the init scripts to run fsck on hda2 at every boot.

# tune2fs -c 1 /dev/hda2

*tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems

-c max-mount-counts

Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.

-C mount-count

Set the number of times the filesystem has been mounted. If set to a greater value than the max-mount-counts parameter set by the -c option, e2fsck(8) will check the filesystem at the next reboot.

-i interval-between-checks[d|m|w]

Adjust the maximal time between two filesystem checks. No post fix or d result in days, m in months, and w in weeks. A value of zero will disable the time-dependent checking.

It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic full e2fsck(8) checking of the filesystem.

SBDavid

Fsck.ext3: Unable to resolve UUID

Fsck.ext3: Unable to resolve UUID

If you are getting the FSCK error fsck.ext3: Unable to resolve ‘UUID=”0415c1ac-8f7a-49e3-9638-bbab4ceefe9b”‘ on system booting, then you can try following steps to resolve that.

1. Use following command to get the UUID of current partitions.

blkid

2. Open the /etc/fstab file and check the UUID in the fstab and the result of blkid are same.

$ sudo blkid |grep /dev/sda
/dev/sda1: TYPE=”swap” UUID=”0415c1ac-8f7a-49e3-9638-bbab4ceefe9b”
/dev/sda2: LABEL=”Dreamlinux” UUID=”5845b99a-14e0-4bd5-b17a-05a8085b16f3″ TYPE=”ext3″

3. Edit the /etc/fstab and change the UUID to that got from the blkid

That will solve the issue.