How to perform file system check


Sometimes you face the issue in which you are getting the error 'Read_only' for your drive. In such case, you need to perform file system check for the specific drive having error using the "fsck" command:

You can use the command below to perform fsck.

===========
# fsck -Cy /dev/sdaX - replace X with the partition number

-C : Displays completion/progress bars
-y : Cause the fsck to always attempt to fix any detected filesystem corruption
automatically (Assume "yes" to all questions)
============

Example:

# umount /dev/sdb
# fsck -Cy /dev/sdb
# mount /dev/sdb /backup

While trying to unmount the drive "Device busy" message was shown. You need to identify the process & kill that process like this:

# fuser -m /dev/sdb
/dev/sdb:            24519c      

# ps ax | grep 24519
24519 ?        DN     0:29 /usr/bin/updatedb -f
sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?securityfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?autofs

#kill -9 24519

Then umount.

Thank you.

Comments

Popular posts from this blog

SVN: File remains in conflict

HowTo: Enable extended logging for exim

12 tweakings for WHM/cPanel to speed up WordPress