Question: 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?

Answer: 
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](https://askubuntu.com/users/93977/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.
You can use the [fsck](http://linux.die.net/man/8/fsck) command. Make sure to execute the fsck on an unmounted file systems to avoid any data corruption issues.

Just press `Ctrl`+`Alt`+`T` on your keyboard to open Terminal. When it opens, run the command(s) below:

```
fsck /dev/sdaX

```

Make sure to replace the X with you device number.

The following are the possible exit codes for fsck command.

```
0 – No errors
1 – Filesystem errors corrected
2 – System should be rebooted
4 – Filesystem errors left uncorrected
8 – Operational error
16 – Usage or syntax error
32 – Fsck canceled by user request
128 – Shared-library error

```

You may also take a look at [10 Linux Fsck Command Examples to Check and Repair Filesystem](http://www.thegeekstuff.com/2012/08/fsck-command-examples/)

Source:[fsck Man Page](http://linux.die.net/man/8/fsck)