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

Windows 7 and page file

Scheduled Pinned Locked Moved
General
5
14
7.2k
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.
  • L
    Lee Rowlett Developer
    last edited by May 20, 2013, 8:02 AM

    Hi all,

    I’ve noticed when uploading a windows 7 image the pagefile does not get removed like it does with XP… is there any reason why as we’re trying to keep the image as small as possible!

    Thanks

    1 Reply Last reply Reply Quote 0
    • L
      Lee Rowlett Developer
      last edited by May 20, 2013, 8:33 AM

      …just to add to this it also doesn’t delete the hibernation file either C:\pagefile.sys & C:\hiberfil.sys are adding 8GB to the image size! 😞 i’m assuming it’s to do with the multi partitions - what would be the best way to manually delete these before uploading to fog? maybe utilising fog debug? any help would be muchly appreciated!

      1 Reply Last reply Reply Quote 0
      • R
        Raff
        last edited by May 20, 2013, 10:23 AM

        Never really checked it but I thought windows 7 sysprep removes them.

        1 Reply Last reply Reply Quote 0
        • L
          Lee Rowlett Developer
          last edited by May 20, 2013, 12:37 PM

          doesn’t seem to be - using generalize and unattend

          1 Reply Last reply Reply Quote 0
          • T
            Todd Holte
            last edited by May 20, 2013, 2:34 PM

            [B][COLOR=#333333][FONT=Verdana]Disable Hibernate (and Delete hiberfil.sys) in Windows 7 or Vista[/FONT][/COLOR][/B]
            [COLOR=#333333][FONT=Verdana]You’ll need to open an administrator mode command prompt Once you’re there and type in the following command:[/FONT][/COLOR]
            [COLOR=#333333][FONT=Verdana]powercfg -h off[/FONT][/COLOR]
            [COLOR=#333333][FONT=Verdana]You should immediately notice that the Hibernate option is gone from the Shut down menu.[/FONT][/COLOR]
            [COLOR=#333333][FONT=Verdana]You’ll also notice that the [/FONT][/COLOR][B][COLOR=#333333][FONT=Verdana]hiberfil.sys[/FONT][/COLOR][/B][COLOR=#333333][FONT=Verdana] file is gone.[/FONT][/COLOR]

            [B][FONT=Segoe Script]Todd Holte[/FONT][/B]

            1 Reply Last reply Reply Quote 0
            • L
              Lee Rowlett Developer
              last edited by May 20, 2013, 2:58 PM

              thanks for the info but i was hoping to keep it enabled but remove it from the image and let windows regenerate it after it imaged. if not will do this for hibernation but will still need to tackle the pagefile.sys 🙂

              1 Reply Last reply Reply Quote 0
              • C
                chad-bisd Moderator
                last edited by May 20, 2013, 7:57 PM

                I thought there was code in 0.32 to remove the pagefile and hiberfil from the machine. If someone can confirm the code is in place but not working, we can create a bug report.


                If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

                1 Reply Last reply Reply Quote 0
                • D
                  dvlsg
                  last edited by May 20, 2013, 9:31 PM

                  There is logic to remove the hibernation and page files:
                  [LIST]
                  []FOG_UPLOADIGNOREPAGEHIBER is a constant defined in config.php
                  [
                  ]createUploadImagePackage from functions.include.php makes use of this constant to determine how to set $ignorepg
                  []$ignorepg is used by init.gz/bin/fog at about line 746 (search for $ignorepg, I have edited this file a couple times. not sure what line exactly it will be for you)
                  [LIST]
                  [
                  ]If $ignorepg has been set to 1 by createUploadImagePackage, then the drive should be mounted with ntfs-3g, and pagefile.sys and hiberfil.sys should be removed by rm -f
                  [/LIST]
                  [/LIST]

                  1 Reply Last reply Reply Quote 0
                  • C
                    chad-bisd Moderator
                    last edited by May 20, 2013, 9:35 PM

                    Lee, can you check your settings and your fog script in init.gz to make sure something didn’t get changed?


                    If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

                    1 Reply Last reply Reply Quote 0
                    • L
                      Lee Rowlett Developer
                      last edited by May 21, 2013, 7:29 AM

                      nothing has been modified to affect this as far as i can see however when uploading windows 7 it does not even echo “removing page file” etc like the settings would suggest… so for some reason it’s not detecting $ignorepg is set to 1 but only for win7/8!?!, may remove the if statement and test this. will come back to you…

                      [FONT=Ubuntu][COLOR=#333333]FOG_UPLOADIGNOREPAGEHIBER is set to 1 and this is the code in init.gz fog script.[/COLOR][/FONT]

                      if [ “$ignorepg” = “1” ]; then
                      #if [ “$osid” != “5” ]; then
                      echo -n " * Mounting device…“;
                      mkdir /ntfs &>/dev/null
                      ntfs-3g -o force,rw $part /ntfs
                      if [ “$?” = “0” ]; then
                      echo “Done”;
                      echo -n " * Removing page file…”;
                      rm -f “/ntfs/pagefile.sys”;
                      echo “Done”;

                      echo -n " * Removing hibernate file…";
                      rm -f “/ntfs/hiberfil.sys”
                      echo “Done”;

                      umount /ntfs;
                      else
                      echo “Failed”;
                      fi
                      #fi
                      fi

                      1 Reply Last reply Reply Quote 0
                      • L
                        Lee Rowlett Developer
                        last edited by May 21, 2013, 7:30 AM

                        actually scrap that, because it mounts the device… it’s this if statement that seems to be the culprit…

                        if [ “$?” = “0” ]; then

                        1 Reply Last reply Reply Quote 0
                        • D
                          dvlsg
                          last edited by May 21, 2013, 12:45 PM

                          Interesting… $? checks for an error thrown by the previous statement, right? (I don’t have a ton of experience in bash). Maybe the mount succeeds, but technically has an error? $? could have useful information that could be printed. Hopefully, haha.

                          1 Reply Last reply Reply Quote 0
                          • L
                            Lee Rowlett Developer
                            last edited by May 21, 2013, 1:50 PM

                            I’m in the same boat as with bash experience - anybody got any ideas how to debug this?

                            1 Reply Last reply Reply Quote 0
                            • D
                              dvlsg
                              last edited by May 21, 2013, 2:07 PM

                              I’d suggest adding in the following lines right after “ntfs-3g -o force,rw $part /ntfs”:

                              [CODE]printf “Error Message: $?\n”;
                              sleep 10;[/CODE]

                              Or use echo instead of printf. Just to see if there’s anything useful in there.

                              Tried finding the exit codes online, but it looks like the fastest way to find them would be to pull up the ntfs-3g man page from the console to see what the exit codes are (here’s the reference page which suggests doing that):
                              [url]http://www.tuxera.com/community/ntfs-3g-manual/#9[/url]

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

                              200

                              Online

                              12.0k

                              Users

                              17.3k

                              Topics

                              155.2k

                              Posts
                              Copyright © 2012-2024 FOG Project