![]() You can check the exit code of the last run command using echo $? command. 4 - File system errors left uncorrected.If you are using fsck on multiple devices, it will return the bit-wise OR of the two sums. Your exit code will be a sum of these codes if you analyze one disk. This is a list of the codes that may be returned from fsck after inspecting a disk. Understanding exit codes for the fsck command The UUID is a fixed value assigned to your device and will not be affected by these system changes. While fsck accepts a device name like /dev/sda, you may elect to enter the UUID to avoid confusion with mounting and unmounting devices. Running fsck on a normal, healthy drive looks like this: sudo fsck /dev/sda2 If you try running fsck on a mounted device, you should see an error like this: sudo fsck /dev/sda3 dev/nvme0n1p3 98564096 500117503 401553408 191.5G Linux filesystem Unmount the device before running fsckĭo not run fsck on a mounted device, you will need to unmount the target first to avoid damage to your files. Sector size (logical/physical): 512 bytes / 512 bytes This way, you can specify which device to be checked with fsck command. You can use fdisk or df command to list the hard drive in Linux. ![]() You will need to run the command either as root user or use it with sudo. ![]() If you do not specify a filesystem, the system will analyze your fstab file ( /etc/fstab) for the devices to scan. The fsck command follows a pattern similar to most Linux commands. These do not need to be specified, but you may be able to find more advanced options in the man pages of these more precise commands. Typically, you would want to run this command if your system will not boot, a device (external drives or storage media) is not functioning properly, or if you have seen evidence of file corruption.įsck is a actually a "front-end" for a number of file system specific checkers like fsck.vfat, fsck.ext2, etc. There are several scenarios where you may want to use fsck. This utility is used for checking and (optionally) repairing the file system. Sometimes bad things happen to good systems.įortunately, you're a Linux user and you have fsck (file system check) to help with a potentially corrupted filesystem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |