Cannot delete var/cache folder magento 2












1















Hi for some reason I cannot delete the var/cache folder. Because of it I cannot switch between production > developer mode.
When I do get the following:




"The directory "fullurl/var/cache/" cannot be deleted Warning!rmdir(fullurl/var/cache/): Device or resource busy




I tried commands:



umount /var/cache > not permitted  


rm -rf var/cache/ > Device or Resource busy.










share|improve this question

























  • Does your user have access to said folder?

    – Julien Lachal
    Dec 27 '16 at 15:53











  • This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

    – Jonathan Wommack
    Dec 27 '16 at 19:11


















1















Hi for some reason I cannot delete the var/cache folder. Because of it I cannot switch between production > developer mode.
When I do get the following:




"The directory "fullurl/var/cache/" cannot be deleted Warning!rmdir(fullurl/var/cache/): Device or resource busy




I tried commands:



umount /var/cache > not permitted  


rm -rf var/cache/ > Device or Resource busy.










share|improve this question

























  • Does your user have access to said folder?

    – Julien Lachal
    Dec 27 '16 at 15:53











  • This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

    – Jonathan Wommack
    Dec 27 '16 at 19:11
















1












1








1








Hi for some reason I cannot delete the var/cache folder. Because of it I cannot switch between production > developer mode.
When I do get the following:




"The directory "fullurl/var/cache/" cannot be deleted Warning!rmdir(fullurl/var/cache/): Device or resource busy




I tried commands:



umount /var/cache > not permitted  


rm -rf var/cache/ > Device or Resource busy.










share|improve this question
















Hi for some reason I cannot delete the var/cache folder. Because of it I cannot switch between production > developer mode.
When I do get the following:




"The directory "fullurl/var/cache/" cannot be deleted Warning!rmdir(fullurl/var/cache/): Device or resource busy




I tried commands:



umount /var/cache > not permitted  


rm -rf var/cache/ > Device or Resource busy.







magento2 cache






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 28 '16 at 5:39









Manashvi Birla

6,15241840




6,15241840










asked Dec 27 '16 at 15:51









KristianKristian

63




63













  • Does your user have access to said folder?

    – Julien Lachal
    Dec 27 '16 at 15:53











  • This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

    – Jonathan Wommack
    Dec 27 '16 at 19:11





















  • Does your user have access to said folder?

    – Julien Lachal
    Dec 27 '16 at 15:53











  • This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

    – Jonathan Wommack
    Dec 27 '16 at 19:11



















Does your user have access to said folder?

– Julien Lachal
Dec 27 '16 at 15:53





Does your user have access to said folder?

– Julien Lachal
Dec 27 '16 at 15:53













This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

– Jonathan Wommack
Dec 27 '16 at 19:11







This is more of server issue than a Magento one, you likely have a process using the directory. Have you tried to lsof +D var/cache to find out what process this might be?

– Jonathan Wommack
Dec 27 '16 at 19:11












3 Answers
3






active

oldest

votes


















0














Try above steps,



Step 1. Give "read-write(recursive)" permission specially to var folder.



Step 2. See that files in /var/report folder are readable



Step 3. Then apply "Delete" on the cache folder






share|improve this answer

































    0














    This is probably the cache folder being mounted in tmpfs - which is one of the recommended speed boosts for magento - you had it right to umount it - but you need to find it first, issue:



    df -h


    Sample cropped output:



    none                     2.0G     0  2.0G   0% /home/magentolive/public_html/var/cache


    then copy/paste the cache path for umount something like this:



    # umount /home/magento/public_html/var/cache


    most likely as root - may need to contact you sysadmin and explain.
    The script should run -- ah but it's not over!
    need to


    mkdir -p /home/magento/public_html/var/cache

    otherwise it isn't there to delete. what a cruddy script. just delete the contents of the folder!




    share|improve this answer































      0
















      • Run below command to remove the var/cache folder:



        rm -rf ./var/cache/*




      • Also use this command to remove the pub static.



        rm -rf ./pub/static/*




      After run upgrade and deployment command to re-generate that folders.






      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "479"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152058%2fcannot-delete-var-cache-folder-magento-2%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        Try above steps,



        Step 1. Give "read-write(recursive)" permission specially to var folder.



        Step 2. See that files in /var/report folder are readable



        Step 3. Then apply "Delete" on the cache folder






        share|improve this answer






























          0














          Try above steps,



          Step 1. Give "read-write(recursive)" permission specially to var folder.



          Step 2. See that files in /var/report folder are readable



          Step 3. Then apply "Delete" on the cache folder






          share|improve this answer




























            0












            0








            0







            Try above steps,



            Step 1. Give "read-write(recursive)" permission specially to var folder.



            Step 2. See that files in /var/report folder are readable



            Step 3. Then apply "Delete" on the cache folder






            share|improve this answer















            Try above steps,



            Step 1. Give "read-write(recursive)" permission specially to var folder.



            Step 2. See that files in /var/report folder are readable



            Step 3. Then apply "Delete" on the cache folder







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 28 '16 at 5:38









            Manashvi Birla

            6,15241840




            6,15241840










            answered Dec 28 '16 at 4:26









            Disha SinghDisha Singh

            7551034




            7551034

























                0














                This is probably the cache folder being mounted in tmpfs - which is one of the recommended speed boosts for magento - you had it right to umount it - but you need to find it first, issue:



                df -h


                Sample cropped output:



                none                     2.0G     0  2.0G   0% /home/magentolive/public_html/var/cache


                then copy/paste the cache path for umount something like this:



                # umount /home/magento/public_html/var/cache


                most likely as root - may need to contact you sysadmin and explain.
                The script should run -- ah but it's not over!
                need to


                mkdir -p /home/magento/public_html/var/cache

                otherwise it isn't there to delete. what a cruddy script. just delete the contents of the folder!




                share|improve this answer




























                  0














                  This is probably the cache folder being mounted in tmpfs - which is one of the recommended speed boosts for magento - you had it right to umount it - but you need to find it first, issue:



                  df -h


                  Sample cropped output:



                  none                     2.0G     0  2.0G   0% /home/magentolive/public_html/var/cache


                  then copy/paste the cache path for umount something like this:



                  # umount /home/magento/public_html/var/cache


                  most likely as root - may need to contact you sysadmin and explain.
                  The script should run -- ah but it's not over!
                  need to


                  mkdir -p /home/magento/public_html/var/cache

                  otherwise it isn't there to delete. what a cruddy script. just delete the contents of the folder!




                  share|improve this answer


























                    0












                    0








                    0







                    This is probably the cache folder being mounted in tmpfs - which is one of the recommended speed boosts for magento - you had it right to umount it - but you need to find it first, issue:



                    df -h


                    Sample cropped output:



                    none                     2.0G     0  2.0G   0% /home/magentolive/public_html/var/cache


                    then copy/paste the cache path for umount something like this:



                    # umount /home/magento/public_html/var/cache


                    most likely as root - may need to contact you sysadmin and explain.
                    The script should run -- ah but it's not over!
                    need to


                    mkdir -p /home/magento/public_html/var/cache

                    otherwise it isn't there to delete. what a cruddy script. just delete the contents of the folder!




                    share|improve this answer













                    This is probably the cache folder being mounted in tmpfs - which is one of the recommended speed boosts for magento - you had it right to umount it - but you need to find it first, issue:



                    df -h


                    Sample cropped output:



                    none                     2.0G     0  2.0G   0% /home/magentolive/public_html/var/cache


                    then copy/paste the cache path for umount something like this:



                    # umount /home/magento/public_html/var/cache


                    most likely as root - may need to contact you sysadmin and explain.
                    The script should run -- ah but it's not over!
                    need to


                    mkdir -p /home/magento/public_html/var/cache

                    otherwise it isn't there to delete. what a cruddy script. just delete the contents of the folder!





                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 14 mins ago









                    wuxmediawuxmedia

                    111




                    111























                        0
















                        • Run below command to remove the var/cache folder:



                          rm -rf ./var/cache/*




                        • Also use this command to remove the pub static.



                          rm -rf ./pub/static/*




                        After run upgrade and deployment command to re-generate that folders.






                        share|improve this answer




























                          0
















                          • Run below command to remove the var/cache folder:



                            rm -rf ./var/cache/*




                          • Also use this command to remove the pub static.



                            rm -rf ./pub/static/*




                          After run upgrade and deployment command to re-generate that folders.






                          share|improve this answer


























                            0












                            0








                            0









                            • Run below command to remove the var/cache folder:



                              rm -rf ./var/cache/*




                            • Also use this command to remove the pub static.



                              rm -rf ./pub/static/*




                            After run upgrade and deployment command to re-generate that folders.






                            share|improve this answer















                            • Run below command to remove the var/cache folder:



                              rm -rf ./var/cache/*




                            • Also use this command to remove the pub static.



                              rm -rf ./pub/static/*




                            After run upgrade and deployment command to re-generate that folders.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 11 mins ago









                            Mohammad FaizanMohammad Faizan

                            213




                            213






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Magento Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152058%2fcannot-delete-var-cache-folder-magento-2%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                What other Star Trek series did the main TNG cast show up in?

                                Berlina muro

                                Berlina aerponto