Ask Your Question
2

how do you run a filesystem check?

asked 2014-08-12 19:17:09 -0600

KMPjcp3321 gravatar image

in fedora how do you run a filesystem check? Is this done from the terminal? This is something related to a answer I got for a shutdown error.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2014-08-13 01:27:41 -0600

abadrinath gravatar image

To perform a filesystem check, you have to use the tool fsck.

# fsck /dev/sda2
Keep in mind, the partition must be unmounted. Use
# umount /dev/sda2
to unmount the partition. However, in some cases, such as if you want to check your `/` partition (your root partition), you have to either use a Live CD of Fedora or perform the fsck at boot. To achieve that, execute
# cat /etc/fstab
The output of that should be close to:
#
# /etc/fstab
# Created by anaconda on Mon Apr 14 19:56:10 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
#UUID=6b266543-a497-44de-981f-ee460b85590a /                       ext4    defaults        1 0
UUID=48ce0f9f-eee1-4f72-b90e-1a28e6a83c8e /boot                   ext4    defaults        1 0
UUID=D58E-1C9A          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
UUID=448774a1-05f9-47e6-9fad-ac5ac4e10b64 /home                   ext4    defaults        1 1 #Note the last 1
UUID=a60856f9-2247-4d13-b4a8-a9e2ecd91aa4 /var                    ext4    defaults        1 0
UUID=0a0ff8de-5395-469d-8e51-a7982d4a3645 swap                    swap    defaults        0 0

The last 1 on the line mounting /home signifies that it will be checked during boot. After it is done, I suggest you keep checking the partition, but if wanted, change to a 0. Honesly, I am not performing important tasks on this machine, so I don't fsck any of my partitions.

HTH.

Note: All of this is done from a terminal

edit flag offensive delete link more
0

answered 2014-08-13 01:21:47 -0600

hedayat gravatar image

Yes, you can use fsck command in a shell to run a filesystem check. However, notice that the filesystem you want to check should not be mounted; e.g. if you want to check /, you shouldn't do it when you are running the OS. You should either run it from a Live disk or installation disk, or go to initrd shell when you want to boot the OS. For the latter, when you boot your system normally, in the Grub menu, you should edit the Fedora menu entry and add an rdshell option at the end of kernel boot command line (the line started with linux), and press F10 to boot into initrd shell. Then you should be able to run fsck.

edit flag offensive delete link more

Comments

@hedayat- accept this as correct? its better than mine :)

abadrinath gravatar imageabadrinath ( 2014-08-22 04:10:11 -0600 )edit

Thank you for your attention, and calling my answer the better. :) However, your answer has got 5 votes; how can I say that my answer should be accepted? :P

People clearly prefer your answer, so accept it :)

hedayat gravatar imagehedayat ( 2014-08-22 14:37:55 -0600 )edit

Fixed! @hedayat - can you delete comments? And can you accept my answer. I can't seem to accept it. It says I can only do that after two days (?!).

abadrinath gravatar imageabadrinath ( 2014-08-22 19:36:25 -0600 )edit

Looks like that I can delete my own comments (at least the button is there). I did. Why don't you wait 2 days?! ;) :D

hedayat gravatar imagehedayat ( 2014-08-22 23:24:40 -0600 )edit

what if its encrypted

noobusinghacks gravatar imagenoobusinghacks ( 2018-02-11 04:17:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-12 19:17:09 -0600

Seen: 7,923 times

Last updated: Aug 13 '14