• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. shruggy
    3. Posts
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 23
    • Groups 0

    Posts

    Recent Best Controversial
    • 1.5.7.89: partclone doesn't capture an image in dd mode: wrong options in fog.upload

      After upgrade to the latest dev-branch, partclone stopped to capture images in dd mode. My setup:
      dual-boot Windows 10 / CentOS 6 (LVM).
      lsblk -f output:

      NAME   FSTYPE      LABEL             UUID
      sda                                                                                     
      |-sda1 ntfs        System-reserviert 6A1494EA1494BB11                                   
      |-sda2 ntfs                          4C5E04DB5E04BFA6                                   
      |-sda3 ext2                          4aef9246-b9cb-41b2-889f-2cd08fc5e966               
      `-sda4 LVM2_member                   gYEf27-xHDD-5oCl-qjHi-Uyvy-ScAv-BPAS86
      

      lsblk output:

      NAME   MAJ:MIN RM   SIZE RO TYPE
      sda      8:0    0   477G  0 disk
      |-sda1   8:1    0   500M  0 part
      |-sda2   8:2    0   238G  0 part
      |-sda3   8:3    0 105.9M  0 part
      `-sda4   8:4    0   238G  0 part
      

      The NTFS partitions get captured normally, so does the Ext2 partition, but when it comes to LVM (/dev/sda4), the partclone ends immediately without any error with the resulting size of partition image being almost zero. Almost because of compression overhead (70 bytes or so), but partclone.info reports the size of the image as zero.
      /var/log/partclone.log (after doing debug capture):

      Partclone v0.3.13 http://partclone.org
      Starting to clone device (/dev/sda) to image (/tmp/pigz1)
      UID is root.
      source=/dev/sda, target=/tmp/pigz1
      open source file/device /dev/sda
      open target file/device /tmp/pigz1
      Initiate image options - version 0002
      Initial image hdr - get Super Block from partition
      Reading Super Block
      open source file/device /dev/sda
      0 blocks per checksum
      memory needed: 2097152 bytes
      bitmap 0 bytes, blocks 2*1048576 bytes, checksum 0 bytes
      initial main bitmap pointer 0x522d20
      Initial image hdr - read bitmap table
      Calculating bitmap... Please wait...
      check main bitmap pointer 0x522d20
      Writing super block and bitmap...
      io_all: write 110, 0 left.
      io_all: write 4, 0 left.
      done!
      print image information
      MODE: clone
      DEBUG: 3
      SOURCE: /dev/sda
      TARGET: /tmp/pigz1
      OVERWRITE: 1
      RESCUE: 0
      CHECK: 1
      QUIET: 0
      FRESH: 1
      FORCE: 0
      BTFILES: 0
      NCURSES: 0
      OFFSET DOMAIN: 0x0
      CHECKSUM: NONE
      CS SIZE: 0
      BLOCKS/CS: 0
      NOTE:
      File system:  raw
      Device size:    0 Byte = 0 Blocks
      Space in use:   0 Byte = 0 Blocks
      Free Space:     0 Byte = 0 Blocks
      Block size:   512 Byte
      Initial Progress bar
      #
      Buffer capacity = 2048, Blocks per cs = 0
      #
      Total block 0
      start backup data...
      Syncing... OK!
      Partclone successfully cloned the device (/dev/sda) to the image (/tmp/pigz1)
      

      What I tried:

      1. rebuilt FOS with the latest partclone (that’s why the log reports partclone 0.3.13):
      diff --git a/Buildroot/package/partclone/partclone.mk b/Buildroot/package/partclone/partclone.mk
      index 07c2022..3035cf2 100644
      --- a/Buildroot/package/partclone/partclone.mk
      +++ b/Buildroot/package/partclone/partclone.mk
      @@ -4,9 +4,9 @@
       #
       ################################################################################
      
      -PARTCLONE_VERSION = 0.3.12
      +PARTCLONE_VERSION = 58d138da6e0f473acd80a7c9b8544d104377d50f
       PARTCLONE_SOURCE = partclone-$(PARTCLONE_VERSION).tar.gz
      -PARTCLONE_SITE = http://partclone.nchc.org.tw/download/testing
      +PARTCLONE_SITE = $(call github,Thomas-Tsai,partclone,$(PARTCLONE_VERSION))
       PARTCLONE_INSTALL_STAGING = YES
       PARTCLONE_AUTORECONF = YES
       PARTCLONE_DEPENDENCIES += attr e2fsprogs libgcrypt lzo xz zlib xfsprogs ncurses host-pkgconf
      
      1. changed partclone.imager to partclone.dd in /bin/fog.upload
        Here I got the message from partclone.dd that it doesn’t support options -c and -a. After removing these options image was captured sucessfully.
      diff --git a/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.upload b/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.upload
      index c1a1a4f..28ef51b 100755
      --- a/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.upload
      +++ b/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.upload
      @@ -197,7 +197,7 @@ beginUpload() {
                   imgpart="$imagePath/$img"
                   mkfifo /tmp/pigz1 >/dev/null 2>&1
                   uploadFormat "/tmp/pigz1" "$imgpart"
      -            partclone.imager -c -s "$hd" -O /tmp/pigz1 -N -f 1 -a0
      +            partclone.dd -s "$hd" -O /tmp/pigz1 -N -f 1
                   rm /tmp/pigz1 >/dev/null 2>&1
                   clearScreen
                   ;;
      
      posted in FOG Problems
      S
      shruggy
    • RE: PHP parse error on string concat over 2 lines

      Well, I guess the ‘over two lines’ part is misleading and should be ‘when declaring a class property’ instead. It seems the ability to use scalar expressions in property declarations was only added in PHP 5.6.0. The only other possibility that would work in PHP 5.5.x in this context is heredoc/nowdoc:

          protected $insertQueryTemplate = <<<EOT
      INSERT INTO `%s` (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s
      EOT;
      
      posted in Bug Reports
      S
      shruggy
    • PHP parse error on string concat over 2 lines

      Running FOG on CentOS 6. I’ve just done two things at once:

      1. Upgraded PHP 5.5.34 to 5.5.38
      $ rpm -q php
      php-5.5.38-1.el6.remi.i686
      
      1. Upgraded FOG to trunk (1.3.0-RC-9, SVN Revision: 5952)

      The upgrade failed with

      Backing up database .... Failed!
      

      /var/log/httpd/error_log:

      PHP Parse error:  syntax error, unexpected '.', expecting ',' or ';' in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 106
      

      After the following change I’ve managed to upgrade FOG successfully.

      diff --git a/packages/web/lib/fog/fogcontroller.class.php b/packages/web/lib/fog/fogcontroller.class.php
      index bab94b2..ed59e42 100644
      --- a/packages/web/lib/fog/fogcontroller.class.php
      +++ b/packages/web/lib/fog/fogcontroller.class.php
      @@ -102,8 +102,7 @@ abstract class FOGController extends FOGBase
            *
            * @var string
            */
      -    protected $insertQueryTemplate = "INSERT INTO `%s` (%s) "
      -        . "VALUES (%s) ON DUPLICATE KEY UPDATE %s";
      +    protected $insertQueryTemplate = "INSERT INTO `%s` (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s";
           /**
            * The delete query template to use.
            *
      

      Best regards,
      Sergey Romanov

      posted in Bug Reports
      S
      shruggy
    • 1
    • 2
    • 2 / 2