linux repair partition fsck check disk before clonezilla image

Clonezilla kept making bad images of my main partition, which I only found out about when trying to restore them (in this case to a different computer)

Here’s how I went about fixing the partitions in question:

  1. Download archlinux iso and put on usb drive using Yumi
  2. Boot into archlinux
  3. Find the partition number and partition type.
    parted

    1. sudo parted
    2. print
      • Near top is the drive being looked at, i.e. /dev/sda
      • The first column is the partition number which would translate to, i.e. /dev/sda1 or /dev/sda7
      • The File system column gives information needed for the fsck command.
      • Only fsck on ext<x> file systems (use windows for fat32 or ntfs)
    3. quit
  4. Check for mounted partitions (we don’t want to fsck on mounted partitions)
    mounted partitions

    1. df -aTh
      1. In the case of the image above we could not fsck /dev/sda6, /dev/sda7, or /dev/sda1
      2. The image above is from an active linux mint 17 session.
      3. When booting from ArchLinux you should not see any of the /dev/sda partitions mounted
    2. no need to exit
  5. Unmount if needed
    1. umount /dev/<partition>
    2. Example: umount /dev/sda6
  6. Check the partition integrity
    No screen shot because I couldn’t do that in Arch Linux

    1. fsck.ext4 /dev/sda7
    2. Obviously, change the ext4 to the type matching in the the parted screen.
    3. Obviously, change the sda7 to match the parted screen
    4. There will be a report

In my case the fsck reported something like the block had a date in the future. While it reported this it also fixed it. Running the fsck command on that partition again did not show the same error message.

I just hope that this fixed my problem creating a good image with clonezilla!