Saturday, April 27, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 12804  / 2 Years ago, fri, september 23, 2022, 5:00:28

I just changed around the partition table of an Ubuntu 12.04 Desktop and everything seems to be working fine. I want to perform similar changes on another (more important) system.



The machine boots so I'm guessing everything worked well.



Is there a more comprehensive way to check that the partition table is ok and the filesystem is consistent?


More From » partitioning

 Answers
7

If you have a MBR partition table, you can use fdisk:



sudo fdisk -l


This command will print out the partition table and will also automatically perform some consistency checks. If instead you have a GPT partition table, you can use gdisk (thanks Rod Smith for pointing that out):



sudo gdisk /dev/something


where /dev/something is the path to your disk device file (e.g. /dev/sda). From the gdisk interface you will be able to press v to run consistency checks.






About the filesystem, there are many ways to perform the check, the one I prefer is this:



sudo touch /forcefsck


This way, once you reboot the computer, the filesystem is checked for errors. This is a nice way of doing it because you don't need to worry about the dangers of running fsck.



It's worth noting that the file /forcefsck will be automatically deleted as soon as the check has completed.


[#29829] Sunday, September 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
guialk

Total Points: 300
Total Questions: 144
Total Answers: 121

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;