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

Mount and Extract files from images

Scheduled Pinned Locked Moved
Feature Request
8
47
23.0k
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.
  • B
    BedCruncher
    last edited by May 16, 2016, 4:51 PM

    Would like to have a way to mount images on the servers automatically without needing to run the following commands.

    apt-get install ntfs-3g partclone pigz
    cd /images/IMAGENAME/
    cat d1p2.img | pigz -d -c | partclone.restore -C -s - -O d1p2_extracted.img
    mount -t ntfs-3g d1p2_extracted.img /mnt
    
    X 1 Reply Last reply May 21, 2016, 7:12 AM Reply Quote 1
    • S
      Sebastian Roth Moderator
      last edited by May 16, 2016, 7:40 PM

      @BedCruncher Haven’t tried this yet but please go for it and let us know if it is working: http://www.idealworldinc.com/partclone-utils/

      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

      1 Reply Last reply Reply Quote 0
      • B
        BedCruncher
        last edited by May 16, 2016, 7:48 PM

        @Sebastian-Roth
        I was able to get it working to at least mount the images. I did run a touch on the d1p2_extracted.img file, but I am not sure if that’s specifically required or not.

        I had to download partclone using the following command

        wget https://forensics.cert.org/centos/cert/7/x86_64/partclone-0.2.88-1.el7.x86_64.rpm
        

        Would it be possible to make this a feature or at least addon in the future images? I mean at least in my case I needed to extract a couple of files that I had misplaced and didn’t want to have to restore to my test machine, grab the files, restore the proper image back and then put them in place. Figured if I could restore the image to a junk location on the server then I would save a lot of extra steps.

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by May 16, 2016, 7:59 PM

          @BedCruncher said:

          Figured if I could restore the image to a junk location on the server then I would save a lot of extra steps.

          The commands you posted in your first message are doing exactly this!

          I was able to get it working to at least mount the images.

          How did you do it? Please give us some more details! I don’t really understand what you mean by having to download partclone rpm by hand?!?

          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

          1 Reply Last reply Reply Quote 0
          • B
            BedCruncher
            last edited by BedCruncher May 16, 2016, 2:06 PM May 16, 2016, 8:05 PM

            @Sebastian-Roth
            Yeah I know they are doing that, but I was wondering if there would be a way to add this to the project as an automatic thing. Where if I say checked a box and selected the image that I wanted to mount in this way, then it would do that and maybe alert me it was done so that I could then pop into the restored image grab what I wanted from it. It could then dismount the image and delete it from the temp directory without having to manually doing it myself.

            For the Partclone part of it, I tried to download that package directly from the REPO’s that I had added to my server, but got

            yum install partclone
            Loaded plugins: fastestmirror
            Loading mirror speeds from cached hostfile
             * base: centos.mirrors.tds.net
             * epel: fedora-epel.mirror.lstn.net
             * extras: mirror.beyondhosting.net
             * remi: mirrors.mediatemple.net
             * remi-safe: mirrors.mediatemple.net
             * rpmforge: mirror.nexcess.net
             * updates: mirror.beyondhosting.net
            No package partclone available.
            
            J 1 Reply Last reply May 16, 2016, 8:17 PM Reply Quote 0
            • J
              Junkhacker Developer @BedCruncher
              last edited by Junkhacker May 16, 2016, 2:18 PM May 16, 2016, 8:17 PM

              @BedCruncher i don’t know why you’d really want to use a feature like that. it only takes me ~5 minutes to image a spare computer and have access to all of the files that way, and how often are you needing something that’s in your image?

              signature:
              Junkhacker
              We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

              B 1 Reply Last reply May 16, 2016, 8:22 PM Reply Quote 1
              • S
                Sebastian Roth Moderator
                last edited by May 16, 2016, 8:19 PM

                @BedCruncher Have you actually had a look at the link I posted? Tried it?

                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

                B 1 Reply Last reply May 16, 2016, 8:23 PM Reply Quote 0
                • B
                  BedCruncher @Junkhacker
                  last edited by May 16, 2016, 8:22 PM

                  @Junkhacker
                  I was thinking more along the lines of if I didn’t have a spare PC handy to do just that. I don’t often need it, but thought since I had run into it, and others might have also that this would be a good thing.

                  1 Reply Last reply Reply Quote 1
                  • B
                    BedCruncher @Sebastian Roth
                    last edited by May 16, 2016, 8:23 PM

                    @Sebastian-Roth
                    I haven’t as far as running the image mount part of it. I will have to try that tomorrow and see.

                    G 1 Reply Last reply May 16, 2016, 10:08 PM Reply Quote 0
                    • G
                      george1421 Moderator @BedCruncher
                      last edited by george1421 May 16, 2016, 4:11 PM May 16, 2016, 10:08 PM

                      @BedCruncher Whats your goal here? Do you need to extract something out of the partclone file (i.e. read a value of a file) or add something to the captured image?

                      I’m not trying to discount your need here, I did use the ghost explorer back in the day and it was handy to be able to manipulate the captured gho image without having to recapture it.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      1 Reply Last reply Reply Quote 0
                      • W
                        Wayne Workman
                        last edited by May 16, 2016, 10:47 PM

                        I’d opt for a simple shell script that could display available images, and a user just input the number they want, and the script do the rest.

                        This is a extreme edge case in my opinion, but maybe just supplying a script to do the job would work? I could even produce such a script for consideration to be included into the FOG file collection.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                        Daily Clean Installation Results:
                        https://fogtesting.fogproject.us/
                        FOG Reporting:
                        https://fog-external-reporting-results.fogproject.us/

                        1 Reply Last reply Reply Quote 0
                        • B
                          BedCruncher
                          last edited by May 17, 2016, 5:21 PM

                          @george1421
                          My goal basically was to be able to quickly and easily access images without the need to restore them to get access to the files and add in or copy out simple flat files, not make any major OS changes, or anything other than just dealing with the captured image to either add or remove something.

                          I know in the case of adding something I would have to go in and recompress the image and basically get it back to the proper directory and named the proper way at least according to what FOG expects for its own operation. Long term that isn’t what I was thinking about. It was more to be able to at least open an image in a read only format and be able to get access to the image and all files stored within without needing a host box to restore the image to. Espescially if the host box I have on hand is sufficiently different from the original and it BSOD’s on boot.

                          W G I 3 Replies Last reply May 17, 2016, 5:25 PM Reply Quote 0
                          • W
                            Wayne Workman @BedCruncher
                            last edited by May 17, 2016, 5:25 PM

                            @BedCruncher There’s a moderator here named @ch3i who has a script that can decompress and recompress images on the fog server itself. It’s buried somewhere in the forums but it’s here. I think that would be a good starting point.

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                            Daily Clean Installation Results:
                            https://fogtesting.fogproject.us/
                            FOG Reporting:
                            https://fog-external-reporting-results.fogproject.us/

                            1 Reply Last reply Reply Quote 0
                            • G
                              george1421 Moderator @BedCruncher
                              last edited by May 17, 2016, 5:43 PM

                              @BedCruncher The tools Sebastian posted about will let you mount the partclone image on the fog server and let you read the contents of the image file within the linux environment. You can extract files from this mounted file system. While I have not tried this, I’m envisioning that it works the same way as you can mount an .iso image in windows or linux as a read only file system.

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                              W 1 Reply Last reply May 17, 2016, 5:48 PM Reply Quote 0
                              • W
                                Wayne Workman @george1421
                                last edited by May 17, 2016, 5:48 PM

                                @george1421 that would be integrated into any script I write.

                                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                                Daily Clean Installation Results:
                                https://fogtesting.fogproject.us/
                                FOG Reporting:
                                https://fog-external-reporting-results.fogproject.us/

                                1 Reply Last reply Reply Quote 1
                                • B
                                  BedCruncher
                                  last edited by May 17, 2016, 6:50 PM

                                  @Sebastian-Roth @george1421
                                  I’ve got the latest version of those tools downloaded and installed. I will attempt to get one of my images mounted in that way and let you both know how I fare.

                                  1 Reply Last reply Reply Quote 2
                                  • B
                                    BedCruncher
                                    last edited by May 18, 2016, 5:22 PM

                                    @george1421 @Sebastian-Roth
                                    I was having issues with the newer one trying to get it mounted. I uninstalled it and then tried to install the one you sent me the link to, but when I am trying to find any kind of documentation with relevant references to get it working, I can’t really see anything on how to properly use it.

                                    The restore command I ran is

                                     cat /images/W7Px64PreSysprep/d1p2.img | gzip -d -c > /tmp/test_img.img
                                    

                                    I then ran

                                    imagemount -d /dev/nbd0 -f /tmp/test_img.img -m /mnt -t ntfs
                                    

                                    and got no errors, but when I do a ls on /mnt I see nothing.

                                    I had saw on other places such as the Clonezilla FAQ where I might have to run the command modprobe nbd, but I get the error modprobe: FATAL: Module nbd not found.

                                    1 Reply Last reply Reply Quote 0
                                    • I
                                      ITSolutions Testers @BedCruncher
                                      last edited by May 18, 2016, 5:39 PM

                                      @BedCruncher said in Mount and Extract files from images:

                                      I know in the case of adding something I would have to go in and recompress the image and basically get it back to the proper directory and named the proper way at least according to what FOG expects for its own operation. Long term that isn’t what I was thinking about. It was more to be able to at least open an image in a read only format and be able to get access to the image and all files stored within without needing a host box to restore the image to. Espescially if the host box I have on hand is sufficiently different from the original and it BSOD’s on boot.

                                      When you restore to another box, you don’t have to boot it. What I do is place a second drive in a machine, pull the image to that drive then boot from the first drive, you can then access the files with in the image as a second drive on the machine, never actually booting the image. Then just recapture if any changes are made. No need for having the same hardware.

                                      1 Reply Last reply Reply Quote 3
                                      • S
                                        Sebastian Roth Moderator
                                        last edited by May 18, 2016, 6:00 PM

                                        @BedCruncher said:

                                        Module nbd not found.

                                        That sounds kind of odd. I use the nbd module all the time. Possibly compiled into the kernel instead of compiled as a kernel module? What system are you trying this on? Kernel version? OS version?

                                        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

                                        B 1 Reply Last reply May 18, 2016, 7:04 PM Reply Quote 0
                                        • B
                                          BedCruncher @Sebastian Roth
                                          last edited by May 18, 2016, 7:04 PM

                                          @Sebastian-Roth
                                          CentOS Linux release 7.2.1511 (Core)
                                          3.10.0-327.13.1.el7.x86_64

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 1 / 3
                                          1 / 3
                                          • First post
                                            12/47
                                            Last post

                                          213

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project