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

Changing the partition used by the task

Scheduled Pinned Locked Moved
FOG Problems
4
10
3.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.
  • N
    ntomsheck
    last edited by May 9, 2014, 3:08 PM

    Good Morning!

    I’m experimenting with FOG 1.0.0 now, and I’ve run into a bit of a problem. On computers which have a recovery partition, tasks like checkdisk and clam fail. It tries to use /dev/sda1, which happens to be the recovery partition. I can see the usual error ‘NTFS Signature missing’, which makes sense because it’s not defined as an NTFS partition.

    If I boot into debug mode, fdisk -l shows me that /dev/sda2 is the boot partition. I can mount /dev/sda2 using ntfs-3g as well.

    I tried specifying the correct partition under the Host in ‘Host Primary Disk’, but it appears this is for the whole disk only, as it appends a ‘1’ to whatever I enter. I skimmed through available kernel arguments on the fog wiki, but couldn’t find an appropriate one. If anyone has some suggestions, I’m all ears!

    I found a related thread:
    [url]http://fogproject.org/forum/threads/host-primary-disk-issue.907/[/url]

    But this is simply asking about entering the partition under ‘Host Primary Disk’.

    Thanks!

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by May 9, 2014, 3:10 PM

      Host Primary Disk should be the Device, not a partition label.

      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 May 9, 2014, 3:11 PM

        I’m going to guess that you’re trying to create a Single Disk Resizable image?

        If you are, you’re better off actually recreating the image from scratch rather than trying to use the OEM installed information.

        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
        • N
          ntomsheck
          last edited by May 9, 2014, 3:16 PM

          Hi Tom!

          [quote=“Tom Elliott, post: 26826, member: 7271”]Host Primary Disk should be the Device, not a partition label.[/quote]

          This part I have already figured, so I abandoned this early on.
          [quote=“Tom Elliott, post: 26827, member: 7271”]I’m going to guess that you’re trying to create a Single Disk Resizable image?[/quote]
          Actually, I’m not trying to create any image yet. At the moment, I’m just playing with the additional tools FOG comes with. My question is, is there a way to change the partition these tools use? Instead of automatically using /dev/sda1, can I change it to /dev/sda2?
          Thank you for such a quick reply!

          1 Reply Last reply Reply Quote 0
          • T
            Tom Elliott
            last edited by May 9, 2014, 3:20 PM

            The fog system is actually attempting to find all partitions. Telling it “which” partitions are needed isn’t supported, nor should it be.

            I realize the want of being able to do so, but if you need such granular control, you may be better off booting into a “debug” mode and running the commands yourself where needed.

            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
            • N
              ntomsheck
              last edited by May 9, 2014, 3:36 PM

              That was my other thought. Tools such as the checkdisk and clamAV - what criteria are they using to select the windows partition? Because it’s selecting the wrong partition to act on in my case.

              1 Reply Last reply Reply Quote 0
              • T
                Tom Elliott
                last edited by May 9, 2014, 3:43 PM

                I think they try to iterate through all of the partitions.

                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
                • N
                  need2 Moderator
                  last edited by May 9, 2014, 3:48 PM

                  I’ve seen some manufacturers use weird practices such as intentionally broken partition information to lock down their recovery partitions. I’ve never been a fan of this, and it becomes quite a pain when a rootkit finds its way in there and you can’t. If you have installation media for your OS, and have the keys you use recorded somewhere, then you really are safe to nuke those partitions. All they do for you is what Fog can do better.

                  1 Reply Last reply Reply Quote 0
                  • N
                    ntomsheck
                    last edited by May 13, 2014, 5:30 PM

                    Tom,

                    I found some time to just dive in. In the init image, under bin/fog.av, the code that selects the partition is this:
                    [CODE]part=$hd’1’;[/CODE]
                    If the OS is set to windows 7, then it simply selects the last partition of all the partitions.
                    [CODE] if [ “$osid” == “5” ]; then
                    win7partcnt=“0”;
                    parts=fogpartinfo --list-parts $hd 2>/dev/null;
                    for prt in $parts
                    do
                    win7partcnt=expr ${win7partcnt} + 1;
                    done
                    part=${hd}${win7partcnt};
                    fi
                    [/CODE]

                    To obtain the behavior I was speaking of, I added this simple bit to the fog.av script:

                    [CODE]
                    partNum=“1”;

                        partNum=`parted $hd -m print | grep 'boot' | sed -n 's/^\([0-9]\+\).*/\1/p'`;
                    
                        part=$hd'1';
                    
                        if [ -n "$partNum" ]
                        then
                                part=$hd$partNum;
                        fi
                    

                    [/CODE]
                    This finds the boot partition on the selected hard drive, then uses that partition number, instead of just selecting partition 1. When will this not work? Dual boot machines would likely have a problem, but there’s a 50% (or 33%) chance they wouldn’t work in the original configuration anyway. But on dual partition (where one partition is a recovery partition) and single partition machines, this works great. I have a clamscan running on a previously offending computer now.

                    The code above is not a final solution. I will be creating a function under the funcs.sh script and applying it to the rest of the scritps as I see fit. I’ll probably also refine the sed portion a little bit.
                    Can you see any issue with this method which makes it worse off than just using $hd’1’?

                    I’ve only used git, but I can submit a pull request (or whatever the equivalent terminology is for svn) of my completed work if you see no issue so far.

                    1 Reply Last reply Reply Quote 0
                    • J
                      Junkhacker Developer
                      last edited by May 13, 2014, 6:08 PM

                      fog has a git that is synchronized with the svn [url]https://github.com/mastacontrola/fogproject[/url]

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

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

                      171

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project