Image Upload: Shrinking EXT File System Fails

  • Hello!

    I am using CloneDeploy 1.2.0 installed on a Ubuntu 16.04 base. After installing, I successfully PXE booted a client (Lenovo ThinkPad laptop) from the network and using the OnDemand menu, I tried to upload the image of the client to the server (On Demand > Upload > New Image). However, when it reached the point where it tried to shrink the filesystem, it threw a syntax error. The client HDD has a fresh install of Ubuntu GNOME 16.10 and nothing else on it. The error it threw was:

    expr: syntax error
    expr: syntax error
    Warning, EXT File System Did Not Shrink Properly.
    /bin/cd_pull: line 354: * 1000 * 1000 : syntax error: operand expected (error token is "* 1000 * 1000")

    I have tried pre-creating the image from the web interface and forcing it as Block mode with linux environment, but the same issue occurs.

  • I need some of the system info to see what's happening. In the image profile->upload options->select only upload image schema. Upload the image again, and attach the log.

  • Thanks for the quick response! My bad, I should have pulled the logs. After setting the image profile to schema only, the same error occurred. I have attached the log files from the client. (There were no log files in /var/www/html/clonedeploy/private/logs on the server side.)

  • As an aside, I tried applying the 1.2.1 patch and updating to the 4.9.8 kernel, but to no avail.

  • Thanks for the logs. This is unusual. It seems like there may be something wrong with the superblock of /dev/sda1. Possibly the filesystem is corrupt. As far as I can tell, all of or 2 of these 3 commands are failing.

    [code]resize2fs -P /dev/sda1
    dumpe2fs -h /dev/sda1
    partclone.extfs -SIic -s /dev/sda1 -O /dev/null[/code]

    The only association among these commands is that they all read the superblock

  • So, I booted the client to the CloneDeploy client console and ran e2fsck on /dev/sda1, and it threw the following error:

    /dev/sda1 has unsupported feature(s): metadata_csum
    e2fsck: Get a newer version of e2fsck!

  • Is it possible that the partclone (or e2fsprogs) tools aren't new enough to support Metadata Checksums (Linux 3.6+)?

  • It looks that way. After doing a bit of research it appears that ubuntu 16.10 now has this on by default. I will need to recompile partclone against the newest e2fsprogs and release a patch. Will require significant testing before releasing the patch. I'll probably need a week or so. Thanks for the info

  • No problem, thanks for the help!

  • Looks like updating e2fsprogs was all that was needed. You can give it a try if you'd like.

    Overwrite the existing file in your tftp folder/images

  • Hi! Sorry to reopen this, but I am still having issues with this. Sorry for the delay, I needed to deploy an image, so I have been using Ubuntu 16.04 instead. It turns out that the original error was actually 2 separate errors. The 1.2.2 initrd.xz image with the updated e2fsprogs fixed the "EXT filesystem did not shrink properly" error, however the installer still fails with:
    [code]/bin/cd_pull: line 377: * 1000 * 1000 : syntax error: operand expected (error token is "* 1000 * 1000")[/code]

    I'm not exactly sure what is causing this to fail with 16.10 and above when it works with 16.04, but opening the file shows that it occurs in the following code block:

    volume_size=$(( $volume_size * 1000 * 1000 ))
    volume_size=$(( $volume_size / 1024 / 1024 ))
    volume_used_mb=$(( $volume_used_mb * 1000 * 1000 ))
    volume_used_mb=$(( $volume_used_mb / 1024 / 1024 ))

    in the /bin/cd_pull file.

  • I'll need to look into this some more. All my tests with 16.10 have been successful since updating e2fsprogs. The error is most likely coming from partclone. I use a slightly modified version to get the used block size or volume size. It's probably failing for some reason and leaving the volume size empty and then failing when trying to multiply the empty value by 1000.