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

Imaging using partclone instead of partimage

Scheduled Pinned Locked Moved
Feature Request
4
33
20.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.
  • G
    Gilou
    last edited by Nov 21, 2013, 4:18 PM

    Hi,

    I have a need for 2 use cases (working on 0.33b base):

    • ext4 support
    • grub2 support

    Let’s talk about ext4, because it appears to be easier (somehow). I’m going to use partclone.extfs instead of partimage. Problem is that the image types are not compatible, and partclone plays less nicely with .gz images than partimage. But that’s OK.

    So I modified my FOG script in init.gz, and everytime the partimage save/restore occured for $osid == 50, I replaced it by the appropriate command for partclone. And guess what… it works 😉

    I’ll test a bit further, especially, I will try not to break the multicast more than need be, and I shall provide a patch for /bin/fog. Anyone interested? Remarks?

    As for GRUB2, and other things (like UEFI), I think there are quite a more things to be done… GPT seems partially supported, so that’s a start…

    Cheers
    Gilou

    1 Reply Last reply Reply Quote 0
    • G
      Gilou
      last edited by Nov 21, 2013, 5:10 PM

      OK, here’s the patch, quick & dirty for those interested, it’s being worked on, and will certainly not work on a multicast environment. I’m still interested in being able to work on SVN, by the way.

      [url=“/_imported_xf_attachments/0/443_partclone.diff.txt?:”]partclone.diff.txt[/url]

      1 Reply Last reply Reply Quote 0
      • H
        Hongyun
        last edited by Nov 22, 2013, 6:53 PM

        [quote=“Gilou, post: 19988, member: 3221”]OK, here’s the patch, quick & dirty for those interested, it’s being worked on, and will certainly not work on a multicast environment. I’m still interested in being able to work on SVN, by the way.[/quote]

        Hello,

        Do you have any detail instructions on how to replace partimage with partclone? where to start?

        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott
          last edited by Nov 22, 2013, 10:11 PM

          I’ve now added this to my init.gz file, hopefully it’s useful to all of you possibly. It’ll be in revision r1000 YAY!

          Also,

          Gilou, how did you figure out how to use partclone? I’ve been trying for quite some time.

          Also, this is my buildroot that has resolving hostnames available. If you notice issues, please let me know so I can try to fix them.

          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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          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
          • H
            Hongyun
            last edited by Nov 22, 2013, 10:15 PM

            Tom,

            How did you add it to init.gz file, would you mind to tell me how to do it?

            Thanks,
            Hongyun

            1 Reply Last reply Reply Quote 0
            • T
              Tom Elliott
              last edited by Nov 22, 2013, 10:23 PM

              Look up on my webpage.

              [url]https://mastacontrola.com[/url]

              It’ll give some info, but if it’s easier just update your fog to the current revision.

              The quick and dirty method.

              Download the patch Gilou provides to your fog server in the /tftpboot/fog/images directory.

              Then open a terminal to your fog server.

              [code]cd /tftpboot/fog/images; mkdir tmp; gunzip init.gz; mount -o loop init tmp[/code]

              This is all one line. It cd’s to the images directory, creates a tmp directory. Extracts the init file and mounts it to the tmp directory you created.

              Then run
              [code]patch -p1 tmp/bin/fog < ./partclone.diff.txt; umount tmp; gzip -9 init; rm -rf tmp[/code]

              This patches the fog script, unmounts the tmp directory, gzips the file back to init.gz and removes the tmp directory.

              Hope this helps.

              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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              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
              • H
                Hongyun
                last edited by Nov 22, 2013, 10:56 PM

                Hi Tom,

                Thank you so much for your reply. I will give it a try, hope it will fix my problem.

                Hongyun

                1 Reply Last reply Reply Quote 0
                • S
                  steve
                  last edited by Nov 25, 2013, 11:55 AM

                  @[URL=‘http://fogproject.org/forum/members/gilou.3221/’][B]Gilou[/B][/URL] @Tom Great news getting partclone included into fog. The Both of you keep up the good work. THANK U

                  1 Reply Last reply Reply Quote 0
                  • H
                    Hongyun
                    last edited by Nov 25, 2013, 4:37 PM

                    Hi Tom,

                    I tried it with a clean install of FOG 0.33, but it couldn’t upload properly, only 32256 byte got uploaded to the server. When I tried to upload with debug mode, I got the following error messages:

                    mv: Can’t rename ‘/images/7071bc7b70bd/d1p1.img.000’: No such file or directory

                    Do you know what may be the problem?

                    Thanks,
                    Hongyun

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by Nov 25, 2013, 4:53 PM

                      The only thought that sticks out to me is the idea that it’s looking for the file d1p1.img.000 and I believe the system only makes the files d1p1.img

                      Just a thought, though I don’t think that’s fully the fix yet.

                      I’ll take a look into the bowels of the fog script for when it moves the file.

                      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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      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
                      • T
                        Tom Elliott
                        last edited by Nov 25, 2013, 4:57 PM

                        Found the issue.

                        So I’m correct.

                        The script makes the files d1p1.img

                        Then when it tries to move the files it runs:

                        mv ${imgpart}.000 ${imgpart}

                        I Imagine this is backwards as the .000 file doesn’t exist at all during this.

                        If you’re unafraid to play a little in the bowels, you can fix this.

                        Perform the steps in this as before.

                        Use your editor for editing the file

                        Look for the lines that say mv ${imgpart}.000 ${imgpart} and switch it so it reads: mv ${imgpart} ${imgpart}.000

                        That should help you out.

                        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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        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
                        • H
                          Hongyun
                          last edited by Nov 25, 2013, 5:41 PM

                          What about this line: mv ${imgpart}.000 ${imgpart} 2>/dev/null
                          change it as well?

                          1 Reply Last reply Reply Quote 0
                          • T
                            Tom Elliott
                            last edited by Nov 25, 2013, 5:47 PM

                            [quote=“Hongyun, post: 20096, member: 1117”]What about this line: mv ${imgpart}.000 ${imgpart} 2>/dev/null
                            change it as well?[/quote]

                            Yes, to my knowledge, there’s two lines that say the same thing. You’ll need to modify both.

                            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                            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
                            • H
                              Hongyun
                              last edited by Nov 25, 2013, 6:08 PM

                              Now I get the same error without 000

                              mv: Can’t rename ‘/images/7071bc7b70bd/d1p1.img.000’: No such file or directory

                              But I found the mac address folder under /images/dev/

                              1 Reply Last reply Reply Quote 0
                              • H
                                Hongyun
                                last edited by Nov 25, 2013, 8:20 PM

                                One more question, do I need to have partclone installed on FOG server?

                                1 Reply Last reply Reply Quote 0
                                • T
                                  Tom Elliott
                                  last edited by Nov 25, 2013, 8:43 PM

                                  No. Partclone becomes a part of the init.gz file.

                                  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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                  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
                                  • H
                                    Hongyun
                                    last edited by Nov 25, 2013, 9:24 PM

                                    [INDENT=1]So you mean the [FONT=Consolas]partclone.diff.txt file already included everything I need to use partclone?[/FONT][/INDENT]

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      Hongyun
                                      last edited by Nov 25, 2013, 9:26 PM

                                      Hi Tom,
                                      Have you ever used clonezilla? someone recommends that for me, but if I could make FOG work with ext4, I really don’t want to switch to something else.
                                      Hongyun

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        Tom Elliott
                                        last edited by Nov 25, 2013, 10:17 PM

                                        That’s kind of the point behind partclone vs. partimage. That’s really the main difference between clonezilla and fog.

                                        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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                        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
                                        • T
                                          Tom Elliott
                                          last edited by Nov 25, 2013, 10:27 PM

                                          I’m sorry that this is taking so long. I’ve got the code base, I think, setup and ready to run, but I keep getting a funny error. I can’t build partclone natively within buildroot, but I’ve successfully built the binaries on my 64 bit system. I just created a 32 bit VM to see if I could create the binaries on that and have them run properly, though I don’t know how well that will actually work.

                                          It’s a work in progress, that’s for sure.

                                          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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                          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
                                          • 1
                                          • 2
                                          • 2 / 2
                                          2 / 2
                                          • First post
                                            4/33
                                            Last post

                                          205

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project