• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Access individual files from cloned image

    Scheduled Pinned Locked Moved Unsolved
    FOG Problems
    2
    5
    994
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      smalltowntech
      last edited by

      Here is my intended use case:

      I want to image a computer, and automatically mount the image file, copy all the individual files to a file server, and thus access the individual files directly.

      My problem so far is finding out the format of the image files and the tools needed to mount them.

      So far, I have discovered that they are whatever image format partclone uses, and then (by default) gzipped. So, I gunzipped them, and am left with the actual partclone file.

      As best as I can tell, the answer is to run something like this:

      partclone -s unzipped_image_file -o raw_image_file.img --restore --restore_raw_file

      Then, in theory, raw_image_file.img would be like an img created by dd - actually raw, sector by sector. Then, I could mount it as if it were a device:

      mount -t ntfs raw_image_file.img /some/mount/path

      So far, running the partclone restore is successful, but I cannot mount it. Here is the error message I get:

      $ sudo mount test.img ./test
      Failed to read last sector (204798): Invalid argument
      HINTS: Either the volume is a RAID/LDM but it wasn’t setup yet,
      or it was not setup correctly (e.g. by not using mdadm --build …),
      or a wrong device is tried to be mounted,
      or the partition table is corrupt (partition is smaller than NTFS),
      or the NTFS boot sector is corrupt (NTFS size is not valid).
      Failed to mount ‘/dev/loop0’: Invalid argument
      The device ‘/dev/loop0’ doesn’t seem to have a valid NTFS.
      Maybe the wrong device is used? Or the whole disk instead of a
      partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

      Any idea how to mount the image, or otherwise accomplish my use case?

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @smalltowntech There have been numerous discussions on this in the forums. I think this is the most valuable one: https://forums.fogproject.org/topic/7432/mount-and-extract-files-from-images (read through all three pages!)

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        S 1 Reply Last reply Reply Quote 1
        • S
          smalltowntech @Sebastian Roth
          last edited by

          It seems my same solution worked on a different partition file. Or partclone.ntfs --restore isn’t quite the same as partclone.restore. Or windows system partitions aren’t NTFS…

          The other component of this is automatically running the script after imaging is complete. I see there is both a postdownload and postinit script, but both of them run on the host. Is there a postdownload script that runs on the server? I didn’t find a forum post describing more than the first two cases.

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by Sebastian Roth

            @smalltowntech You seem to be mixing up a couple of things here (extracting files from an image and postdownload/postinit script…) without properly explaining what exactly are you are headed for.

            I just don’t get it. Unable to help.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            S 1 Reply Last reply Reply Quote 0
            • S
              smalltowntech @Sebastian Roth
              last edited by

              @sebastian-roth I was referring to my intended use case. I want to capture an image from a computer and automatically copy the individual files from the image onto a file server. In order to do that, I need a script that runs on the server, not the host. I could find a way to trigger it still (some primitive form of RPC, maybe a quick HTTP request with wget), but it wouldn’t be quite as convenient.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              174

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project