Sample Header Ad - 728x90

How to check for file system consistency after power outage

1 vote
0 answers
992 views
What can I do to check if a file system (data in files and the hardware) is intact or corrupt after a computer is shutdown abruptly due to power outage? My home desktop computer was shut down by sudden power outage. The computer automatically rebooted itself after the power is back, and I then shut it down manually in the regular way. The computer runs Ubuntu 18.10, Linux 4.18.0. It has a SSD and a HDD, where the SSD holds the boot, root, and all the essential partitions, and the HDD holds one partition for data files. I think all the file systems are ext4. I want to determine if there was a corruption in any file, and if the SSD or HDD had a physical damage. I think I can use smartmontools to check the physical damage. I am lacking a clue about how to check the data integrity. It looks that fsck can do some checks on the file system, but it looks I need to unmount the partition to inspect. How can I run fsck to inspect the SSD? Can I use a USB boot stick which has Ubuntu on it? I would appreciate any pointers. ---- **Edit** The 'duplicate question' link nominally answered my question, and I am closing this question. Among the several methods suggested in the link and the comments to this question, what I actually did is the following. I booted the computer, and ran $ sudo tune2fs -c 1 /dev/sda4 where /dev/sda4 is the SSD. Then, I rebooted. The system started up, showed something about the disk check for a few seconds, and presented the normal log-in screen. I also did $ sudo tune2fs -c 1 /dev/sdb1 for the HDD. Upon reboot, the start up screen showed a progress for about a minute, and then the normal log-in screen came up. I'm not really sure if there was no error, if a problem was fixed silently, or if there was an error, but I assume the lack of explicit warning indicates that there was no error. Thank you for the comments and the link.
Asked by norio (225 rep)
Sep 28, 2019, 02:53 AM
Last activity: Sep 29, 2019, 01:03 AM