How to cancel CHKDSK while it's running on windows XP?

484

Solution 1

Like i said above. I would not recommend interupting chkdsk.

You may have a "dirty flag" set on your harddrive. Find out why.

You can try the following (after your computer starts up):

  1. click on your start menu and open the run dialog.
  2. type "cmd" and return (note: dont enter quotes)
  3. Next type "fsutil dirty query c:"
  4. If the return message indicates that the volume is dirty go to step 5
  5. Next type "chkdsk c: /f /x" (this may require a restart)
  6. After that finshes repeat step 3.
  7. If it is no longer dirty then reboot and you should notice no more ckdisk.

Solution 2

Highly unsafe even if you kill the chkdsk process (taskkill /f /im chkdsk.exe). Chkdsk locks the volume for exclusive access and termination of chkdsk may lead to unforeseen problems. If you shut the power down when one write is committed to the medium but not the other, the data can be left fully detached.

Do it on your own responsibility.

Share:
484

Related videos on Youtube

Oron Werner
Author by

Oron Werner

Updated on September 18, 2022

Comments

  • Oron Werner
    Oron Werner almost 2 years

    I'm new to Jenkins so I hope my terms are correct:

    I have a Jenkins job that triggers another job. This second job tests a very long list of items (maybe 2000) it gets from the trigger.

    Because it's such a long list, I pass it to the second job in groups of 20.

    Unfortunately, this list turned out to take an extremely long time, and I can't stop it. No matter what I tried, stop/kill only stop the current group of 20, and proceeds to the group. Waiting for it to finish, or doing this manually for each group is not an option.

    I guess the entire list was already passed to the second job, and it's loading the next group whenever the current one ends.

    What I tried:

    • Clicking the "stop" button next to the build on the trigger and the second job

    • Using purge build queue add on

    • Using the following script in script console:

      def jobname = "Trigger Job"
      def buildnum = 123
      def job = Jenkins.instance.getItemByFullName(jobname)
       for (build in job.builds) {
           if (buildnum == build.getNumber().toInteger()){
             if (build.isBuilding()){
               build.doStop();
               build.doKill();
             }
           }
      }
      
      
    • Using the following script in script console:

      String job = 'Job name';
      List<Integer> build_list = [];
      def result = jenkins.model.Jenkins.instance.getItem(job).getBuilds().findAll{
      it.isBuilding() == true && (!build_list || build_list.contains(it.id.toInteger()))}.each{it.doStop()}.collect{it.id};
      println new groovy.json.JsonBuilder(result).toPrettyString(); ```
      
      
      
      

    This is my groovy part of the code that splits it into groups of 20. Maybe I should put the parallel part outside the sub list loop? Is there a better way to divide into sub lists for future use?

    stages {
            stage('Execute tests') {
                steps {
                    script {
                        // Limit number of items to run
                        def shortList = IDs.take(IDs.size()) // For testing purpose, can be removed if not needed
                        println(Arrays.toString(shortList))
                        
                        // devide the list of items into small, equal,sub-lists
                        def colList = shortList.toList().collate(20)
                        for (subList in colList) {
                            testStepsForParallel = subList.collectEntries {
                                ["Testing on ${it}": {
                                    catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                                        stage(it) {
                                            def buildWrapper = build job: "Job name",
                                                    parameters: [
                                                            string(name: 'param1', value: it.trim()),
                                                            string(name: 'param2', value: "")
                                                    ],
                                                    propagate: false
                                            remoteBuildResult = buildWrapper.result
                                            println("Remote build results: ${remoteBuildResult}")
                                            if (remoteBuildResult == "FAILURE") {
                                                currentBuild.result = "FAILURE"
                                            }
                                            catchError(stageResult: 'UNSTABLE') {
                                                copyArtifacts projectName: "Job name", selector: specific("${buildWrapper.number}")
                                            }
                                        }
                                    }
                                }]
                            }
                            parallel testStepsForParallel
                        }
                    }
                }
            }
        }
                    
    

    Thanks for your help!

    Don't know what else to do to stop this run.

    • Lorenzo Von Matterhorn
      Lorenzo Von Matterhorn almost 11 years
      have you tried CTRL+C or CTRL+Z ? - i never canceled it before, neither should you... im more a linux guy now anyway, cant test it.
    • Rik
      Rik almost 11 years
      Do not cancel chkdsk. Let it run and find out why it keeps running after you manually shut off your computer. There is a "dirty flag" on your harddrive and it should be reset or else you keep having this problem.
    • Fiasco Labs
      Fiasco Labs over 9 years
      Describe manually shut off my computer. Are you pulling the plug, shutting off the power strip everything's plugged into, pushing the UPS off button, pushing and holding the computer power button till the machine shuts off, momentarily pushing the computer power button and letting the machine run its power shutdown routine or selecting shutdown from the start menu?