Announcement

Collapse
No announcement yet.

NEW CHKDSK /R, problem impossible to solve!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • NEW CHKDSK /R, problem impossible to solve!

    i am Donato Pace and i have not found a solution under your ForumÖ

    first of all very compliment for your guide.

    I need to modify my BOOT.INI and ADD to it an option to auto execute CHKDSK /R without any LOGON or prompt.

    I donít want use the FLAG that automatically activate at the next startup the graphical interface of CHKDSK, but I want use the classical CHKDSK /R on the prompt without any question before execute it and when it has finished automatically restart the computer.


    Can I help me???

    Thanks a lot for any suggestion.

  • #2
    Re: NEW CHKDSK /R, problem impossible to solve!

    Boot.ini provides parameters to the NTLDR boot process. CHKDSK is not a bootable OS thus you can not do this w/ boot.ini. You could add a logon or startup script to a bootable OS that does a chkdsk.
    Cheers,

    Rick

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

    Comment


    • #3
      Re: NEW CHKDSK /R, problem impossible to solve!

      Open Notepad and copy/paste the following:

      @echo off
      echo Y>SCRIPT.TXT
      echo.>>SCRIPT.TXT
      type SCRIPT.TXT|CHKDSK /R
      shutdown -r -f -t 01

      Do a File, Save as..., and enter as the filename (including quotation marks): My_Chkdsk.cmd

      You might want to save it in %windir% or %windir%\system32 so as to take advantage of your PATH in finding the new command.

      You can then Start, Run My_Chkdsk to perform the action.
      * Users Helping Users *
      MS-MVP Windows Networking

      Comment


      • #4
        Re: NEW CHKDSK /R, problem impossible to solve!

        Originally posted by rvalstar View Post
        Boot.ini provides parameters to the NTLDR boot process. CHKDSK is not a bootable OS thus you can not do this w/ boot.ini. You could add a logon or startup script to a bootable OS that does a chkdsk.



        Can you help me to prepare a startup script??

        I don't know how can i do it.

        Comment


        • #5
          Re: NEW CHKDSK /R, problem impossible to solve!

          Originally posted by donatopace View Post
          Can you help me to prepare a startup script??

          I don't know how can i do it.
          My mistake. It needs to be a "shutdown" script to queue up a chkdsk on the system drive at next boot -- see bcastner's script.

          You do need to change his "chkdsk /r" to "chkdsk c: /r" or "chkdsk c: /f" -- assuming C: is your system drive.

          You can skip the reboot command too as you've already specified your shutdown / reboot desires to get the shutdown script to run.

          On you to make your CMD be a "shutdown" script, give this a read:

          http://support.microsoft.com/kb/322241

          BTW, I created

          Code:
          C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown\Shutdown.cmd
          as follows on one of my W2K3 servers:

          Code:
          @echo off
          echo Y > %Temp%\Shutdown.TXT 
          echo. >> %Temp%\Shutdown.TXT 
          type %Temp%\Shutdown.TXT | CHKDSK C: /F
          You can add a "pause" during testing to the end to make sure it is running.

          In

          Code:
          \\Local Computer Policy\Computer Configuration\Administrative Templates\System\Scripts
          I have the following set:

          Code:
          Run logon scripts synchronously = Enabled
          Run startup scripts asynchronously = Disabled
          Run startup scripts visible = Enabled
          Run shutdown scripts visible = Enabled
          The shutdown bit is probably all you need. Giving you the rest just in case.

          And I have my shutdown script set to run

          Code:
          cmd
          w/ parameters:

          Code:
          /c "Shutdown.cmd"
          as my default behavior when you open a CMD is Edit.
          Last edited by rvalstar; 12th June 2007, 09:58. Reason: BTW...
          Cheers,

          Rick

          ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

          © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

          Comment


          • #6
            Re: NEW CHKDSK /R, problem impossible to solve!

            Originally posted by bcastner View Post
            Open Notepad and copy/paste the following:

            @echo off
            echo Y>SCRIPT.TXT
            echo.>>SCRIPT.TXT
            type SCRIPT.TXT|CHKDSK /R
            shutdown -r -f -t 01

            Do a File, Save as..., and enter as the filename (including quotation marks): My_Chkdsk.cmd

            You might want to save it in %windir% or %windir%\system32 so as to take advantage of your PATH in finding the new command.

            You can then Start, Run My_Chkdsk to perform the action.

            I can use yor script directly from BOOT.INI ?

            How? please make an examlpe

            Comment


            • #7
              Re: NEW CHKDSK /R, problem impossible to solve!

              Originally posted by donatopace View Post
              I can use yor script directly from BOOT.INI ?

              How? please make an examlpe
              No,you CANNOT run it directly from boot.ini

              BOOT.INI lets you chose which operating system to run, it does NOT let you run a particular command
              Tom Jones
              MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
              PhD, MSc, FIAP, MIITT
              IT Trainer / Consultant
              Ossian Ltd
              Scotland

              ** Remember to give credit where credit is due and leave reputation points where appropriate **

              Comment


              • #8
                Re: NEW CHKDSK /R, problem impossible to solve!

                Originally posted by donatopace View Post
                I can use yor script directly from BOOT.INI ?

                How? please make an examlpe
                Did you not understand my posts?

                If you want to make this an automatic feature whenever you start up a server, you're going to have to make a shutdown script that sets up the chkdsk on the system drive for the next time you boot.

                If you just want to do this on the odd occasion, put bcastner's script on your server desktop (specify the drive letter in chkdsk and decide between /r and /f; also decide if you want the reboot to happen immediately)
                Cheers,

                Rick

                ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                Comment


                • #9
                  Re: NEW CHKDSK /R, problem impossible to solve!

                  Originally posted by rvalstar View Post
                  My mistake. It needs to be a "shutdown" script to queue up a chkdsk on the system drive at next boot -- see bcastner's script.

                  You do need to change his "chkdsk /r" to "chkdsk c: /r" or "chkdsk c: /f" -- assuming C: is your system drive.

                  You can skip the reboot command too as you've already specified your shutdown / reboot desires to get the shutdown script to run.

                  On you to make your CMD be a "shutdown" script, give this a read:

                  http://support.microsoft.com/kb/322241

                  BTW, I created

                  Code:
                  C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown\Shutdown.cmd
                  as follows on one of my W2K3 servers:

                  Code:
                  @echo off
                  echo Y > %Temp%\Shutdown.TXT 
                  echo. >> %Temp%\Shutdown.TXT 
                  type %Temp%\Shutdown.TXT | CHKDSK C: /F
                  You can add a "pause" during testing to the end to make sure it is running.

                  In

                  Code:
                  \\Local Computer Policy\Computer Configuration\Administrative Templates\System\Scripts
                  I have the following set:

                  Code:
                  Run logon scripts synchronously = Enabled
                  Run startup scripts asynchronously = Disabled
                  Run startup scripts visible = Enabled
                  Run shutdown scripts visible = Enabled
                  The shutdown bit is probably all you need. Giving you the rest just in case.

                  And I have my shutdown script set to run

                  Code:
                  cmd
                  w/ parameters:

                  Code:
                  /c "Shutdown.cmd"
                  as my default behavior when you open a CMD is Edit.




                  I don''t want execute CHKDSK /R from windows,

                  but when i power up my computer i need a menu based on BOOT.INI and then i choose to start between WINDOWS XP or CHKDSK /R.

                  If i choose CHKDSK /R the command line must execute automatically and when it has finished must restart automatically the computer.

                  Comment


                  • #10
                    Re: NEW CHKDSK /R, problem impossible to solve!

                    Originally posted by donatopace View Post
                    I don''t want execute CHKDSK /R from windows,

                    but when i power up my computer i need a menu based on BOOT.INI and then i choose to start between WINDOWS XP or CHKDSK /R.

                    If i choose CHKDSK /R the command line must execute automatically and when it has finished must restart automatically the computer.
                    AFAIK, for what you want in the exact way you want it, you will need 2 copies of WXP on the machine, one that has been shutdown w/ the shutdown script to setup a chkdsk at next reboot and your normal one.

                    I do not know of a way to optionally set the dirty bit at startup BEFORE the stage where chkdsk would run.

                    If you set up the chkdsk using the shutdown script on your one and only install of WXP, you can always escape it at startup.
                    Cheers,

                    Rick

                    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                    © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                    Comment


                    • #11
                      Re: NEW CHKDSK /R, problem impossible to solve!

                      BTW, you could do an "fsutil dirty set c:" in a startup script w/ a prompt to see if you'd like to do a chkdsk but I believe that occurs after the test to run a startup chkdsk so it wouldn't happen till next boot.
                      Cheers,

                      Rick

                      ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                      © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                      Comment


                      • #12
                        Re: NEW CHKDSK /R, problem impossible to solve!

                        If you remove the last line from my original script, so that it reads:

                        @echo off
                        echo Y>SCRIPT.TXT
                        echo.>>SCRIPT.TXT
                        type SCRIPT.TXT|CHKDSK C: /R

                        And then point the saved MY_Chkdsk.com command to Task Scheduler as a new scheduled task, to be run at Startup or Shutdown, then at every start of your computer you will have Autochk run.

                        The key is that you have ten seconds, and a warning message on your screen, to hit any key to cancel the chkdsk operation. If you do not cancel the operation the chkdsk is performed. If you cancel the operation then you boot into XP normally.

                        Chkdsk only requires a drive object when there are multiple partitions and/or multiple physical drives. I am taking "rvalstar"'s suggestion and specifying the drive letter to make it unambiguous.

                        Whether you schedule this as a startup or shutdown task or script actually makes no practical difference; the autochk event is scheduled for the next reboot.

                        If you do not like the Task Scheduler, just add the .CMD file to this location:
                        C:\Documents and Settings\All Users\Start Menu\Programs\Startup

                        As member rvalstar has pointed out, there is no option in Boot.ini to do what you want because there cannot be one -- the command interpreter is not loaded at this point in the boot process so no script or command can be executed from the boot.ini menu selection.

                        Best regards,
                        Bill Castner
                        * Users Helping Users *
                        MS-MVP Windows Networking

                        Comment


                        • #13
                          Re: NEW CHKDSK /R, problem impossible to solve!

                          Reason not to put in a Task Scheduler job:

                          Need to supply credentials which is just another worry when changing passwords (which we all do regularly, correct?).

                          Reason not to put in the Start Menu Startup dir:

                          Requires an interactive logon to the server to trigger the chkdsk. Lights out w/ monitoring daemons should be the goal.

                          Also, learning the ins and outs of startup / shutdown scripts is a good skill to have

                          I don't think the OP likes it but I'm in agreement w/ bcastner that the OP should set the chkdsk to happen through a variant of the bcastner script or an "fsutil dirty set c:" and then cancel the chkdsk as bcastner suggests should it not be desired.

                          Anything else will be far more trouble than it's worth.
                          Cheers,

                          Rick

                          ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                          © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                          Comment


                          • #14
                            Re: NEW CHKDSK /R, problem impossible to solve!

                            If I am not mistaken, rvalstar, this is a client OS subforum. It is confusing matters to take me to task over configuration settings for servers.

                            In point of fact:

                            1. Scheduled Tasks would be effected by a password change only if the Task was created without specified alternate credentials; and only if Scheduled Tasks are interferred with by your password policy. In this situation you follow Microsoft's recommendation: you create a user account not subject to password policy and use these credentials for the task. This applies only when a conflicting password policy has been set. This is not a normative situation for client OS installations in non-Domain settings. My suggestion stands as written.

                            2. The criticism of alternatively using the All Users Startup location as failing the "lights out" test is absurd in a user OS context. You deny interactive logons in a client OS at your shop? My suggestion stands as written.

                            3. You do not chkdsk server drives unless it is a near last resort. So the issue of scheduling one for a server drive is inconceivable to me. This is one excellent way to lose all of your security descriptors due to a well-known and well-documented limitation of chkdsk. Please see the warning from Microsoft:
                            CAUSE
                            This problem occurs because the Chkdsk utility may not find references to all the security IDs if the master file table is larger than 4 gigabytes (GB) or if there are more than 4,194,303 files on the volume. Therefore, the undiscovered security descriptors are reset.
                            MORE INFORMATION
                            Even when this hotfix is installed, it is still possible for Chkdsk to reset permissions back to default settings.
                            The CHKDSK utility incorrectly identifies and deletes in-use security descriptors in Windows 2000, Windows 2000 Server, Windows XP, Windows Server 2003

                            APPLIES TO
                            • Microsoft Windows Server 2003, Enterprise x64 Edition
                            • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
                            • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
                            • Microsoft Windows Server 2003, Web Edition
                            • Microsoft Windows XP Professional
                            • Microsoft Windows XP Home Edition
                            http://support.microsoft.com/kb/831374/


                            APPLIES TO
                            • Microsoft Windows 2000 Server
                            • Microsoft Windows 2000 Professional Edition
                            • Microsoft Windows 2000 Advanced Server
                            http://support.microsoft.com/kb/831375/

                            After you apply this hotfix, you must also apply hotfix 873437. For more information, 873437 The CHKDSK command incorrectly identifies certain security descriptors as not valid in Windows 2000 ( http://support.microsoft.com/kb/873437/ )

                            You have added heat but not light to this entire discussion.
                            Last edited by bcastner; 12th June 2007, 23:15.
                            * Users Helping Users *
                            MS-MVP Windows Networking

                            Comment


                            • #15
                              Re: NEW CHKDSK /R, problem impossible to solve!

                              Wow, that took a bit of energy to write.

                              I'd like to offer you a cool glass of

                              My apologies for misreading the OP was wishing to do a chkdsk on a WS OS. I was working on my servers this evening thus...

                              I was working under the premise the OP wanted to chkdsk the system volume otherwise one could chkdsk after boot. The system drive should always have far fewer files than these limits. Now in a single volume WS OS, who knows? I'd be impressed if the numbers exceeded these limits. A disk w/ roaming profiles for a large org. could easily hit those limits.

                              I have multo, multo files on each of my three 1 TB W2K3 servers (about 500K files on the largest 500 GB drive) and have yet to run in to the 4 GB MFT issue or the 4M file limit -- I must be living well.

                              EDIT:

                              So any place (startup, shutdown, logon, logoff, inbetween) you can cause the appropriate CHKDSK or FSUTIL command to run will do. I had not done a shutdown script before so that was a neat thing for me to try.

                              I don't believe this was ever asked of the OP:

                              Why the initial inquiry? Are you having significant problems w/ disk corruption of some sort? Does a CHKDSK without repairing (command line or GUI Tools\Error-checking) indicate you have issues on a regular basis?

                              This would all point to some underlying problem that should be addressed -- flaky HW / SW or improper shutdowns?
                              Last edited by rvalstar; 13th June 2007, 07:19.
                              Cheers,

                              Rick

                              ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                              © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                              Comment

                              Working...
                              X