“echo 3 > /proc/sys/vm/drop_caches” - Permission denied as root The 2019 Stack Overflow Developer Survey Results Are InLinux empty buffer cache command permission deniedSetting /proc/sys/vm/drop_caches to clear cache/proc/sys vs /sys/modules/mod/parameterroot permission denied on /proc/1/exeWhat memory is not used by processes and freed by `echo 3 > /proc/sys/vm/drop_caches`?Which Linux capability do I need in order to write to /proc/sys/vm/drop_caches?switch user to sudo su root and connect the fttp get the file in local machine and unzipBackup: /proc /sysHow to enable quota on CENTOS 6.9 virtuozzo VPS?Can I lose files if I flush the cache (echo 3> /proc/sys/vm/drop_caches)?/proc/sys/vm/drop_caches values

Correct punctuation for showing a character's confusion

How do you keep chess fun when your opponent constantly beats you?

Is an up-to-date browser secure on an out-of-date OS?

Output the Arecibo Message

"as much details as you can remember"

How to quickly solve partial fractions equation?

How to type this arrow in math mode?

Why doesn't UInt have a toDouble()?

Why can't devices on different VLANs, but on the same subnet, communicate?

Is it okay to consider publishing in my first year of PhD?

Can withdrawing asylum be illegal?

How to support a colleague who finds meetings extremely tiring?

Button changing its text & action. Good or terrible?

What do I do when my TA workload is more than expected?

How to charge AirPods to keep battery healthy?

Variable with quotation marks "$()"

What does もの mean in this sentence?

Are spiders unable to hurt humans, especially very small spiders?

Is bread bad for ducks?

Short story: man watches girlfriend's spaceship entering a 'black hole' (?) forever

What is this sharp, curved notch on my knife for?

Why couldn't they take pictures of a closer black hole?

How to translate "being like"?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?



“echo 3 > /proc/sys/vm/drop_caches” - Permission denied as root



The 2019 Stack Overflow Developer Survey Results Are InLinux empty buffer cache command permission deniedSetting /proc/sys/vm/drop_caches to clear cache/proc/sys vs /sys/modules/mod/parameterroot permission denied on /proc/1/exeWhat memory is not used by processes and freed by `echo 3 > /proc/sys/vm/drop_caches`?Which Linux capability do I need in order to write to /proc/sys/vm/drop_caches?switch user to sudo su root and connect the fttp get the file in local machine and unzipBackup: /proc /sysHow to enable quota on CENTOS 6.9 virtuozzo VPS?Can I lose files if I flush the cache (echo 3> /proc/sys/vm/drop_caches)?/proc/sys/vm/drop_caches values



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








20















I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > /proc/sys/vm/drop_caches.

I am logged in as root over SSH (not using sudo). These are the attempts I made:



root@server: ~ # ll /proc/sys/vm/drop_caches
-rw-r--r-- 1 root root 0 15. Jan 20:21 /proc/sys/vm/drop_caches

root@server: ~ # echo 3 > /proc/sys/vm/drop_caches
-bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # sudo su -c "echo 3 > /proc/sys/vm/drop_caches"
bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # echo 3 | sudo tee /proc/sys/vm/drop_caches
tee: /proc/sys/vm/drop_caches: Permission denied
3


It is a remote machine running Debian. As far as I know there are some vCores in this machine and it uses Virtuozzo for the virtualization.

I really just want to clear the cache (So I can only access it using SSH).

I also tried registering this as a cronjob. But it simply fails too!










share|improve this question



















  • 1





    Are you running this as root or are you using sudo?

    – terdon
    Jan 15 '14 at 19:52






  • 2





    I am running this as root. But sudo also fails.

    – BrainStone
    Jan 15 '14 at 19:53











  • Does not work either. Already tried it. Same error message.

    – BrainStone
    Jan 15 '14 at 19:55












  • See the slm's A on this question, it might help.

    – Risto Salminen
    Jan 15 '14 at 19:58











  • This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

    – terdon
    Jan 15 '14 at 20:02

















20















I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > /proc/sys/vm/drop_caches.

I am logged in as root over SSH (not using sudo). These are the attempts I made:



root@server: ~ # ll /proc/sys/vm/drop_caches
-rw-r--r-- 1 root root 0 15. Jan 20:21 /proc/sys/vm/drop_caches

root@server: ~ # echo 3 > /proc/sys/vm/drop_caches
-bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # sudo su -c "echo 3 > /proc/sys/vm/drop_caches"
bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # echo 3 | sudo tee /proc/sys/vm/drop_caches
tee: /proc/sys/vm/drop_caches: Permission denied
3


It is a remote machine running Debian. As far as I know there are some vCores in this machine and it uses Virtuozzo for the virtualization.

I really just want to clear the cache (So I can only access it using SSH).

I also tried registering this as a cronjob. But it simply fails too!










share|improve this question



















  • 1





    Are you running this as root or are you using sudo?

    – terdon
    Jan 15 '14 at 19:52






  • 2





    I am running this as root. But sudo also fails.

    – BrainStone
    Jan 15 '14 at 19:53











  • Does not work either. Already tried it. Same error message.

    – BrainStone
    Jan 15 '14 at 19:55












  • See the slm's A on this question, it might help.

    – Risto Salminen
    Jan 15 '14 at 19:58











  • This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

    – terdon
    Jan 15 '14 at 20:02













20












20








20


3






I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > /proc/sys/vm/drop_caches.

I am logged in as root over SSH (not using sudo). These are the attempts I made:



root@server: ~ # ll /proc/sys/vm/drop_caches
-rw-r--r-- 1 root root 0 15. Jan 20:21 /proc/sys/vm/drop_caches

root@server: ~ # echo 3 > /proc/sys/vm/drop_caches
-bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # sudo su -c "echo 3 > /proc/sys/vm/drop_caches"
bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # echo 3 | sudo tee /proc/sys/vm/drop_caches
tee: /proc/sys/vm/drop_caches: Permission denied
3


It is a remote machine running Debian. As far as I know there are some vCores in this machine and it uses Virtuozzo for the virtualization.

I really just want to clear the cache (So I can only access it using SSH).

I also tried registering this as a cronjob. But it simply fails too!










share|improve this question
















I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > /proc/sys/vm/drop_caches.

I am logged in as root over SSH (not using sudo). These are the attempts I made:



root@server: ~ # ll /proc/sys/vm/drop_caches
-rw-r--r-- 1 root root 0 15. Jan 20:21 /proc/sys/vm/drop_caches

root@server: ~ # echo 3 > /proc/sys/vm/drop_caches
-bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # sudo su -c "echo 3 > /proc/sys/vm/drop_caches"
bash: /proc/sys/vm/drop_caches: Permission denied

root@server: ~ # echo 3 | sudo tee /proc/sys/vm/drop_caches
tee: /proc/sys/vm/drop_caches: Permission denied
3


It is a remote machine running Debian. As far as I know there are some vCores in this machine and it uses Virtuozzo for the virtualization.

I really just want to clear the cache (So I can only access it using SSH).

I also tried registering this as a cronjob. But it simply fails too!







linux permissions virtualization proc openvz






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 30 '14 at 18:36









Tshepang

26.5k72187265




26.5k72187265










asked Jan 15 '14 at 19:42









BrainStoneBrainStone

1,07371943




1,07371943







  • 1





    Are you running this as root or are you using sudo?

    – terdon
    Jan 15 '14 at 19:52






  • 2





    I am running this as root. But sudo also fails.

    – BrainStone
    Jan 15 '14 at 19:53











  • Does not work either. Already tried it. Same error message.

    – BrainStone
    Jan 15 '14 at 19:55












  • See the slm's A on this question, it might help.

    – Risto Salminen
    Jan 15 '14 at 19:58











  • This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

    – terdon
    Jan 15 '14 at 20:02












  • 1





    Are you running this as root or are you using sudo?

    – terdon
    Jan 15 '14 at 19:52






  • 2





    I am running this as root. But sudo also fails.

    – BrainStone
    Jan 15 '14 at 19:53











  • Does not work either. Already tried it. Same error message.

    – BrainStone
    Jan 15 '14 at 19:55












  • See the slm's A on this question, it might help.

    – Risto Salminen
    Jan 15 '14 at 19:58











  • This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

    – terdon
    Jan 15 '14 at 20:02







1




1





Are you running this as root or are you using sudo?

– terdon
Jan 15 '14 at 19:52





Are you running this as root or are you using sudo?

– terdon
Jan 15 '14 at 19:52




2




2





I am running this as root. But sudo also fails.

– BrainStone
Jan 15 '14 at 19:53





I am running this as root. But sudo also fails.

– BrainStone
Jan 15 '14 at 19:53













Does not work either. Already tried it. Same error message.

– BrainStone
Jan 15 '14 at 19:55






Does not work either. Already tried it. Same error message.

– BrainStone
Jan 15 '14 at 19:55














See the slm's A on this question, it might help.

– Risto Salminen
Jan 15 '14 at 19:58





See the slm's A on this question, it might help.

– Risto Salminen
Jan 15 '14 at 19:58













This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

– terdon
Jan 15 '14 at 20:02





This is extremely unlikely, but you never know, does /proc/sys/vm/drop_caches actually exist?

– terdon
Jan 15 '14 at 20:02










6 Answers
6






active

oldest

votes


















24















I am logged in as root over SSH...It is a remote machine running Debian.




Is it actually a remote machine, or a just a remote system? If this is a VPS slice somewhere, (at least some forms of) OS virtualization (e.g. openVZ) won't permit this from within the container. You don't run the machine, you just run your slice.






share|improve this answer




















  • 1





    There is like no way???

    – BrainStone
    Jan 15 '14 at 20:09






  • 1





    Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

    – goldilocks
    Jan 15 '14 at 20:11






  • 2





    @BrainStone - I use OpenVZ, it's not possible!

    – slm
    Jan 15 '14 at 21:42


















29














sudo has to cover whole the redirection so it can be completely executed by root:



$ sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"





share|improve this answer




















  • 5





    this actually worked for me (with the right binary location for echo)

    – orm
    Nov 5 '14 at 19:59











  • in OpenVZ not work

    – shilovk
    Mar 3 '15 at 16:03






  • 1





    alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

    – mchid
    Dec 23 '15 at 0:09






  • 1





    @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

    – Erik Shilts
    Jan 26 '17 at 22:04











  • It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

    – Alexei Martianov
    Mar 18 '18 at 7:31


















11














This is normal behavior under OS-level virtualization. This can only be executed by someone with root access to the hardware node.



With for example OpenVZ, you don't get your own kernel instance and as such, are restricted from performing commands like this.



All share the same page cache, so to drop caches of only your instance, the kernel must check if the page belongs to you and if the other instances aren't using this page too.



With another virtualization technique like KVM or Xen this might be working.






share|improve this answer




















  • 1





    So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

    – BrainStone
    Jan 15 '14 at 20:15












  • Yes, you may not come around this...

    – chaos
    Jan 15 '14 at 20:18











  • I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

    – user55518
    Jan 15 '14 at 20:51






  • 2





    The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

    – goldilocks
    Jan 15 '14 at 21:52







  • 1





    @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

    – Nils
    Jan 20 '14 at 11:49


















7














You can use echo piped to sudo tee to allow the proper permission needed when you need to echo as root.



echo 3 | sudo tee /proc/sys/vm/drop_caches


Use tee --help to list more options.






share|improve this answer






























    1














    sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"



    This command work for me without /usr/bin/echo in mchid answer. It was giving error sh: 1: /usr/bin/echo: not found . So used only 'echo'






    share|improve this answer






























      0














      I had the same problem when I tried to use sudo like this:



      sudo echo 1 > /proc/sys/vm/overcommit_memory


      My solution was to temporarily switch to root. Obiously, that permission has to be enabled on your system:



      sudo su - #temporarily switch to root user
      echo 1 > /proc/sys/vm/overcommit_memory
      exit # Exit as root.





      share|improve this answer























        protected by Stephen Kitt yesterday



        Thank you for your interest in this question.
        Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



        Would you like to answer one of these unanswered questions instead?














        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        24















        I am logged in as root over SSH...It is a remote machine running Debian.




        Is it actually a remote machine, or a just a remote system? If this is a VPS slice somewhere, (at least some forms of) OS virtualization (e.g. openVZ) won't permit this from within the container. You don't run the machine, you just run your slice.






        share|improve this answer




















        • 1





          There is like no way???

          – BrainStone
          Jan 15 '14 at 20:09






        • 1





          Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

          – goldilocks
          Jan 15 '14 at 20:11






        • 2





          @BrainStone - I use OpenVZ, it's not possible!

          – slm
          Jan 15 '14 at 21:42















        24















        I am logged in as root over SSH...It is a remote machine running Debian.




        Is it actually a remote machine, or a just a remote system? If this is a VPS slice somewhere, (at least some forms of) OS virtualization (e.g. openVZ) won't permit this from within the container. You don't run the machine, you just run your slice.






        share|improve this answer




















        • 1





          There is like no way???

          – BrainStone
          Jan 15 '14 at 20:09






        • 1





          Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

          – goldilocks
          Jan 15 '14 at 20:11






        • 2





          @BrainStone - I use OpenVZ, it's not possible!

          – slm
          Jan 15 '14 at 21:42













        24












        24








        24








        I am logged in as root over SSH...It is a remote machine running Debian.




        Is it actually a remote machine, or a just a remote system? If this is a VPS slice somewhere, (at least some forms of) OS virtualization (e.g. openVZ) won't permit this from within the container. You don't run the machine, you just run your slice.






        share|improve this answer
















        I am logged in as root over SSH...It is a remote machine running Debian.




        Is it actually a remote machine, or a just a remote system? If this is a VPS slice somewhere, (at least some forms of) OS virtualization (e.g. openVZ) won't permit this from within the container. You don't run the machine, you just run your slice.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 15 '14 at 20:12

























        answered Jan 15 '14 at 20:06









        goldilocksgoldilocks

        63.4k17157213




        63.4k17157213







        • 1





          There is like no way???

          – BrainStone
          Jan 15 '14 at 20:09






        • 1





          Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

          – goldilocks
          Jan 15 '14 at 20:11






        • 2





          @BrainStone - I use OpenVZ, it's not possible!

          – slm
          Jan 15 '14 at 21:42












        • 1





          There is like no way???

          – BrainStone
          Jan 15 '14 at 20:09






        • 1





          Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

          – goldilocks
          Jan 15 '14 at 20:11






        • 2





          @BrainStone - I use OpenVZ, it's not possible!

          – slm
          Jan 15 '14 at 21:42







        1




        1





        There is like no way???

        – BrainStone
        Jan 15 '14 at 20:09





        There is like no way???

        – BrainStone
        Jan 15 '14 at 20:09




        1




        1





        Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

        – goldilocks
        Jan 15 '14 at 20:11





        Probably not, since there wouldn't be much point in not permitting it if there were alternate methods that worked.

        – goldilocks
        Jan 15 '14 at 20:11




        2




        2





        @BrainStone - I use OpenVZ, it's not possible!

        – slm
        Jan 15 '14 at 21:42





        @BrainStone - I use OpenVZ, it's not possible!

        – slm
        Jan 15 '14 at 21:42













        29














        sudo has to cover whole the redirection so it can be completely executed by root:



        $ sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"





        share|improve this answer




















        • 5





          this actually worked for me (with the right binary location for echo)

          – orm
          Nov 5 '14 at 19:59











        • in OpenVZ not work

          – shilovk
          Mar 3 '15 at 16:03






        • 1





          alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

          – mchid
          Dec 23 '15 at 0:09






        • 1





          @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

          – Erik Shilts
          Jan 26 '17 at 22:04











        • It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

          – Alexei Martianov
          Mar 18 '18 at 7:31















        29














        sudo has to cover whole the redirection so it can be completely executed by root:



        $ sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"





        share|improve this answer




















        • 5





          this actually worked for me (with the right binary location for echo)

          – orm
          Nov 5 '14 at 19:59











        • in OpenVZ not work

          – shilovk
          Mar 3 '15 at 16:03






        • 1





          alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

          – mchid
          Dec 23 '15 at 0:09






        • 1





          @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

          – Erik Shilts
          Jan 26 '17 at 22:04











        • It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

          – Alexei Martianov
          Mar 18 '18 at 7:31













        29












        29








        29







        sudo has to cover whole the redirection so it can be completely executed by root:



        $ sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"





        share|improve this answer















        sudo has to cover whole the redirection so it can be completely executed by root:



        $ sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 15 at 14:58









        Wrzlprmft

        1035




        1035










        answered Aug 5 '14 at 6:50









        rasty.grasty.g

        41346




        41346







        • 5





          this actually worked for me (with the right binary location for echo)

          – orm
          Nov 5 '14 at 19:59











        • in OpenVZ not work

          – shilovk
          Mar 3 '15 at 16:03






        • 1





          alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

          – mchid
          Dec 23 '15 at 0:09






        • 1





          @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

          – Erik Shilts
          Jan 26 '17 at 22:04











        • It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

          – Alexei Martianov
          Mar 18 '18 at 7:31












        • 5





          this actually worked for me (with the right binary location for echo)

          – orm
          Nov 5 '14 at 19:59











        • in OpenVZ not work

          – shilovk
          Mar 3 '15 at 16:03






        • 1





          alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

          – mchid
          Dec 23 '15 at 0:09






        • 1





          @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

          – Erik Shilts
          Jan 26 '17 at 22:04











        • It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

          – Alexei Martianov
          Mar 18 '18 at 7:31







        5




        5





        this actually worked for me (with the right binary location for echo)

        – orm
        Nov 5 '14 at 19:59





        this actually worked for me (with the right binary location for echo)

        – orm
        Nov 5 '14 at 19:59













        in OpenVZ not work

        – shilovk
        Mar 3 '15 at 16:03





        in OpenVZ not work

        – shilovk
        Mar 3 '15 at 16:03




        1




        1





        alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

        – mchid
        Dec 23 '15 at 0:09





        alternatively, you could use tee instead: echo 3 | sudo tee /proc/sys/vm/drop_caches

        – mchid
        Dec 23 '15 at 0:09




        1




        1





        @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

        – Erik Shilts
        Jan 26 '17 at 22:04





        @mchid, consider adding your comment as an answer. It also worked for me on Azure VM.

        – Erik Shilts
        Jan 26 '17 at 22:04













        It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

        – Alexei Martianov
        Mar 18 '18 at 7:31





        It's root already, see # at the beginning of line. Issue with sudo is worth noting, but for another question.

        – Alexei Martianov
        Mar 18 '18 at 7:31











        11














        This is normal behavior under OS-level virtualization. This can only be executed by someone with root access to the hardware node.



        With for example OpenVZ, you don't get your own kernel instance and as such, are restricted from performing commands like this.



        All share the same page cache, so to drop caches of only your instance, the kernel must check if the page belongs to you and if the other instances aren't using this page too.



        With another virtualization technique like KVM or Xen this might be working.






        share|improve this answer




















        • 1





          So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

          – BrainStone
          Jan 15 '14 at 20:15












        • Yes, you may not come around this...

          – chaos
          Jan 15 '14 at 20:18











        • I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

          – user55518
          Jan 15 '14 at 20:51






        • 2





          The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

          – goldilocks
          Jan 15 '14 at 21:52







        • 1





          @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

          – Nils
          Jan 20 '14 at 11:49















        11














        This is normal behavior under OS-level virtualization. This can only be executed by someone with root access to the hardware node.



        With for example OpenVZ, you don't get your own kernel instance and as such, are restricted from performing commands like this.



        All share the same page cache, so to drop caches of only your instance, the kernel must check if the page belongs to you and if the other instances aren't using this page too.



        With another virtualization technique like KVM or Xen this might be working.






        share|improve this answer




















        • 1





          So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

          – BrainStone
          Jan 15 '14 at 20:15












        • Yes, you may not come around this...

          – chaos
          Jan 15 '14 at 20:18











        • I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

          – user55518
          Jan 15 '14 at 20:51






        • 2





          The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

          – goldilocks
          Jan 15 '14 at 21:52







        • 1





          @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

          – Nils
          Jan 20 '14 at 11:49













        11












        11








        11







        This is normal behavior under OS-level virtualization. This can only be executed by someone with root access to the hardware node.



        With for example OpenVZ, you don't get your own kernel instance and as such, are restricted from performing commands like this.



        All share the same page cache, so to drop caches of only your instance, the kernel must check if the page belongs to you and if the other instances aren't using this page too.



        With another virtualization technique like KVM or Xen this might be working.






        share|improve this answer















        This is normal behavior under OS-level virtualization. This can only be executed by someone with root access to the hardware node.



        With for example OpenVZ, you don't get your own kernel instance and as such, are restricted from performing commands like this.



        All share the same page cache, so to drop caches of only your instance, the kernel must check if the page belongs to you and if the other instances aren't using this page too.



        With another virtualization technique like KVM or Xen this might be working.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 15 '14 at 22:06









        terdon

        134k33269449




        134k33269449










        answered Jan 15 '14 at 20:14









        chaoschaos

        36.2k977120




        36.2k977120







        • 1





          So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

          – BrainStone
          Jan 15 '14 at 20:15












        • Yes, you may not come around this...

          – chaos
          Jan 15 '14 at 20:18











        • I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

          – user55518
          Jan 15 '14 at 20:51






        • 2





          The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

          – goldilocks
          Jan 15 '14 at 21:52







        • 1





          @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

          – Nils
          Jan 20 '14 at 11:49












        • 1





          So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

          – BrainStone
          Jan 15 '14 at 20:15












        • Yes, you may not come around this...

          – chaos
          Jan 15 '14 at 20:18











        • I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

          – user55518
          Jan 15 '14 at 20:51






        • 2





          The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

          – goldilocks
          Jan 15 '14 at 21:52







        • 1





          @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

          – Nils
          Jan 20 '14 at 11:49







        1




        1





        So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

        – BrainStone
        Jan 15 '14 at 20:15






        So I could/should/must contact my hoster to clear the cache for me? And how do I find out what "virtualisation technique" my system is on?

        – BrainStone
        Jan 15 '14 at 20:15














        Yes, you may not come around this...

        – chaos
        Jan 15 '14 at 20:18





        Yes, you may not come around this...

        – chaos
        Jan 15 '14 at 20:18













        I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

        – user55518
        Jan 15 '14 at 20:51





        I am not shure if this is right. I am running some vm's at aws and Xen and i am able to drop_caches.

        – user55518
        Jan 15 '14 at 20:51




        2




        2





        The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

        – goldilocks
        Jan 15 '14 at 21:52






        The difference is between OS virtualization (OpenVZ, LXC) and platform virtualization (QEMU, Xen), both of which have advantages and disavantages vs. the other.

        – goldilocks
        Jan 15 '14 at 21:52





        1




        1





        @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

        – Nils
        Jan 20 '14 at 11:49





        @bersch Xen uses an own kernel for VMs. OpenVZ does not. You can think of OpenVZ like a better "chroot".

        – Nils
        Jan 20 '14 at 11:49











        7














        You can use echo piped to sudo tee to allow the proper permission needed when you need to echo as root.



        echo 3 | sudo tee /proc/sys/vm/drop_caches


        Use tee --help to list more options.






        share|improve this answer



























          7














          You can use echo piped to sudo tee to allow the proper permission needed when you need to echo as root.



          echo 3 | sudo tee /proc/sys/vm/drop_caches


          Use tee --help to list more options.






          share|improve this answer

























            7












            7








            7







            You can use echo piped to sudo tee to allow the proper permission needed when you need to echo as root.



            echo 3 | sudo tee /proc/sys/vm/drop_caches


            Use tee --help to list more options.






            share|improve this answer













            You can use echo piped to sudo tee to allow the proper permission needed when you need to echo as root.



            echo 3 | sudo tee /proc/sys/vm/drop_caches


            Use tee --help to list more options.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 29 '17 at 16:59









            mchidmchid

            8391917




            8391917





















                1














                sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"



                This command work for me without /usr/bin/echo in mchid answer. It was giving error sh: 1: /usr/bin/echo: not found . So used only 'echo'






                share|improve this answer



























                  1














                  sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"



                  This command work for me without /usr/bin/echo in mchid answer. It was giving error sh: 1: /usr/bin/echo: not found . So used only 'echo'






                  share|improve this answer

























                    1












                    1








                    1







                    sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"



                    This command work for me without /usr/bin/echo in mchid answer. It was giving error sh: 1: /usr/bin/echo: not found . So used only 'echo'






                    share|improve this answer













                    sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"



                    This command work for me without /usr/bin/echo in mchid answer. It was giving error sh: 1: /usr/bin/echo: not found . So used only 'echo'







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Oct 16 '18 at 11:47









                    ascii_walkerascii_walker

                    1113




                    1113





















                        0














                        I had the same problem when I tried to use sudo like this:



                        sudo echo 1 > /proc/sys/vm/overcommit_memory


                        My solution was to temporarily switch to root. Obiously, that permission has to be enabled on your system:



                        sudo su - #temporarily switch to root user
                        echo 1 > /proc/sys/vm/overcommit_memory
                        exit # Exit as root.





                        share|improve this answer





























                          0














                          I had the same problem when I tried to use sudo like this:



                          sudo echo 1 > /proc/sys/vm/overcommit_memory


                          My solution was to temporarily switch to root. Obiously, that permission has to be enabled on your system:



                          sudo su - #temporarily switch to root user
                          echo 1 > /proc/sys/vm/overcommit_memory
                          exit # Exit as root.





                          share|improve this answer



























                            0












                            0








                            0







                            I had the same problem when I tried to use sudo like this:



                            sudo echo 1 > /proc/sys/vm/overcommit_memory


                            My solution was to temporarily switch to root. Obiously, that permission has to be enabled on your system:



                            sudo su - #temporarily switch to root user
                            echo 1 > /proc/sys/vm/overcommit_memory
                            exit # Exit as root.





                            share|improve this answer















                            I had the same problem when I tried to use sudo like this:



                            sudo echo 1 > /proc/sys/vm/overcommit_memory


                            My solution was to temporarily switch to root. Obiously, that permission has to be enabled on your system:



                            sudo su - #temporarily switch to root user
                            echo 1 > /proc/sys/vm/overcommit_memory
                            exit # Exit as root.






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited yesterday









                            muru

                            37.6k589164




                            37.6k589164










                            answered Dec 4 '18 at 16:31









                            thebiggestlebowskithebiggestlebowski

                            1011




                            1011















                                protected by Stephen Kitt yesterday



                                Thank you for your interest in this question.
                                Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                Would you like to answer one of these unanswered questions instead?



                                -linux, openvz, permissions, proc, virtualization

                                Popular posts from this blog

                                Word for a person who has no opinion about whether god existsWord for having a definite opinion while simultaneously withholding judgment?What's the opposite of “newcomer? Is ”veteran" OK?What do you call an “atheist” who might believe in an afterlife?What's a word for someone who wants to voice opinions but not have them challenged?Word for someone who dismisses contrary opinions as irrational?Somone who thinks they are overly special/out of the ordinaryIs there a word, phrase or idiom for “a person who is incapable of thinking about the future”?The belief that a god is human-likeA word for a non-famous person/thing you have heard a lot aboutAdjective for a person who enjoys taking care of their appearance

                                What was this official D&D 3.5e Lovecraft-flavored rulebook?What was this set of RPG tools called?As a first-time DM should I let my players play complex character classes and roles?Nymph's Kiss and the RelationshipWhat was the name of this Cleric Prestige Class that shapes metal with its bare hands?Are the 3.5e Dragonlance books third party or official works?What's up with the domain Vile Darkness?What was this 80s book about RPGs?What was the name of this Werewolf band?What book had Rituals to “upgrade” animal companions to keep them viable at higher levels?What was this RPG that had rules for player-owned businesses?

                                2017 IndyCar Series Contents Series news Teams and drivers Schedule Season summary Footnotes References External links Navigation menu"INDYCAR: Initial 2018 bodywork concepts unveiled"the original"IndyCar confirms switch to Performance Friction brakes in 2017""AJ Foyt Racing will switch to Chevy"the original"Carlos Munoz, Conor Daly will drive for AJ Foyt Racing""Zach Veach's Indy 500 Debut Confirmed with Foyt""No mass exodus from Honda after Ganassi switch""Ex-F1 driver Sato joins Andretti Autosport for 2017 IndyCar season""IndyCar's Ryan Hunter-Reay, sponsor DHL paired through 2020""hhgregg and Andretti Autosport announce partnership for key races in 2016""INDYCAR: Rossi re-signs with Andretti"the original"McLaren Formula 1 - Fernando Alonso to race at Indy 500 with McLaren, Honda and Andretti Autosport""Shank will finally take part in Indy 500 with Harvey, Andretti | MotorSportsTalk""Andretti adds Jack Harvey to Indy 500 field""Ganassi switches to Honda power for 2017""INDYCAR: Chilton returns to Ganassi"the original"IndyCar silly season: Who's going where in 2017?""INDYCAR: Kanaan, NTT Data return to Ganassi"the original"Kimball to remain at Ganassi for 2017""Coyne confirms Bourdais for 2017 IndyCar season""Davison to sub for Bourdais in Indy 500"the original"Gutierrez confirmed for Detroit IndyCar debut""Gutierrez returns with Coyne for rest of 2017 season""Vautier to drive for Coyne at Texas"the original"INDYCAR: Coyne confirms Jones for 2017"the original"Pippa Mann returns to Coyne for Indy 500""Karam, Dreyer & Reinbold teaming up again for Indianapolis 500""Pigot to return to Ed Carpenter Racing""Hildebrand confirmed as full-time Ed Carpenter driver""Veach to replace injured Hildebrand at Barber"the originalNew Team Harding Racing Enters Chaves for 101st Indianapolis 500"Juncos Racing Announces Entry in 101st Running of the Indianapolis 500 :: Juncos Racing""Juncos confirms Pigot for Indy 500""Saavedra confirmed in Juncos' second 500 entry"the original"Lazier confirms Indy 500 run after son's USF2000 debut"the original"Claman DeMelo to race for RLLR at Sonoma"the original"Rahal signs Servia and ace engineer for 2017""IndyCar: Aleshin returns with Schmidt"the original"Aleshin replaced by Saavedra for Toronto""Jack Harvey will pilot SPM No. 7 car at Watkins Glen, Sonoma""Jay Howard confirmed in Tony Stewart's supported SPM Indy entry""INDYCAR: Newgarden to wave the flag at Penske"the original"Pagenaud opts for No. 1 in 2017"the original"Penske confirms Newgarden for 2017""Montoya to stay with Team Penske in 2017""Target leaving IndyCar after 27 seasons with Chip Ganassi""Cavin: IndyCar could see complete driver/team shakeup in 2017""End of the road for KV Racing?""KV Racing confirms closure, equipment sold to Juncos""Juncos confirms IndyCar Series entry"the original"Juncos readies IndyCar program, aims for '17 500"the original"Harding Racing to add Texas, Pocono to schedule"the original"Sato signs with Andretti Autosport for 2017""INDYCAR: Aleshin in Doubt at SPM"the original"Long Beach notebook: JR Hildebrand breaks hand""Hildebrand cleared to return at Phoenix"the original"Bourdais to undergo surgery on multiple fractures""Aleshin loses Schmidt Peterson IndyCar ride""Saavedra in at SPM for Pocono, Gateway"the original"Bourdais to make return at Gateway"the original"The IndyCar Grand Prix no longer is sponsored by Angie's List""2017 IndyCar Series rulebook""2017 Verizon IndyCar Series Official Rulebook"Official websiteeeeee