To check for errors on /dev/xvda2 in Ubuntu, you can use the fsck (file system check) command. First, you need to unmount the file system:
sudo umount /dev/xvda2
Then, run the fsck command:
sudo fsck -f /dev/xvda2
The -f option forces a check even if the file system is marked as clean. If any errors are found, fsck will attempt to repair them. After the check is complete, you can remount the file system:
sudo mount /dev/xvda2