“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

                                Frič See also Navigation menuinternal link

                                Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

                                fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox