Partclone "error exit" on older PCs

  • Re: Partclone won't image our Dells

    ubuntu 14.04
    Fog 1.2.0

    In our case, a debug download revealed a message immediately after partclone exists with the “error exit” message: /dev/sda1 not found. The partition did not exist. Why?

    For WIndows XP, fog writes a boot sector to the hard drive (that’s Stage 1 preparation). The boot sector being written is from a file /usr/share/fog/mbr/xp.mbr inside the init.xz image. That boot sector has a partition table containing a single partition starting at 32.3kB and ending at 80.0GB. If you hard drive is 79.99GB instead – as may be the case with older computers – that partition goes beyond the end of the disk, thus making the partition table invalid. Hence /dev/sda1 isn’t there and partclone fails.

    Here’s how we solved it:
    – Find the init.xz image (/var/www/fog/service/ipxe/init.xz)
    – Unpack and mount the image (
    – Use dd to copy xp.mbr onto an HDD (in this case, an additional, say 200 GB, virtual HDD)
    (e.g. dd if=xp.mbr of=/dev/sdc bs=512 count=1)
    – Use parted on that HDD (resizepart 1 35.0GB) – should be larger than your largest image, but smaller than your smallest HDD
    – Use dd to copy the boot sector from the HDD back into the xp.mbr file
    – Unmount and repack init.xz


  • Confirmed Windows XP.

    Image was created with Fog 1.2.0 from a reference machine. I know there’s been talk about a fix, but I posted here for the benefit of folks who use the released 1.2.0 and are trying to image older computers with smaller HDDs.

  • Senior Developer

    If the image was made with anything before 1.0.0 released its most likely the image is still in part image format, but the install of 1.2.0 was likely performed, then the old data imported to the 1.2.0 server. I would see about changing the image format from partclone to partimage and see if it starts working. What is the image type as well? If it’s xp/vista I’m aware there was a problem with 1.2.0 which was fixed shortly after release but only performed on the development release.