why file ownership set on filesystem does not take affect after mount?












3















I have rhel 6 plaftform. I added a second disk /dev/sdb and formatted it (ext4 filesystem). Before I mount this partition to a root tree I ran following commands.



chown sysadm:sysadm 
chmod 755
mount /foo


However when foo is mounted, I ran "ls -l" command under "/" expecting pre-defined ownerhip/permission however /foo is owned by root:root instead of sysadm:sysadm. I am not sure why.










share|improve this question





























    3















    I have rhel 6 plaftform. I added a second disk /dev/sdb and formatted it (ext4 filesystem). Before I mount this partition to a root tree I ran following commands.



    chown sysadm:sysadm 
    chmod 755
    mount /foo


    However when foo is mounted, I ran "ls -l" command under "/" expecting pre-defined ownerhip/permission however /foo is owned by root:root instead of sysadm:sysadm. I am not sure why.










    share|improve this question



























      3












      3








      3








      I have rhel 6 plaftform. I added a second disk /dev/sdb and formatted it (ext4 filesystem). Before I mount this partition to a root tree I ran following commands.



      chown sysadm:sysadm 
      chmod 755
      mount /foo


      However when foo is mounted, I ran "ls -l" command under "/" expecting pre-defined ownerhip/permission however /foo is owned by root:root instead of sysadm:sysadm. I am not sure why.










      share|improve this question
















      I have rhel 6 plaftform. I added a second disk /dev/sdb and formatted it (ext4 filesystem). Before I mount this partition to a root tree I ran following commands.



      chown sysadm:sysadm 
      chmod 755
      mount /foo


      However when foo is mounted, I ran "ls -l" command under "/" expecting pre-defined ownerhip/permission however /foo is owned by root:root instead of sysadm:sysadm. I am not sure why.







      mount






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 13 at 21:15









      Rui F Ribeiro

      39.5k1479133




      39.5k1479133










      asked Feb 11 '16 at 19:38









      DaeYoungDaeYoung

      3682613




      3682613






















          1 Answer
          1






          active

          oldest

          votes


















          3














          The directory you created is just an empty shell. Despite whatever name you gave it and what ownership, once the new filesystem comes, the only thing that is of interest is the directory name. The new filesystem overlays itself on to this mount point and all the ownership and permissions are whatever was on that new disk is. The old information about the directory, and also if there were any contents in it, are now invisible to the operating system






          share|improve this answer
























          • Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

            – DaeYoung
            Feb 11 '16 at 19:56











          • /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

            – coteyr
            Feb 11 '16 at 20:00











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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%2funix.stackexchange.com%2fquestions%2f261608%2fwhy-file-ownership-set-on-filesystem-does-not-take-affect-after-mount%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          The directory you created is just an empty shell. Despite whatever name you gave it and what ownership, once the new filesystem comes, the only thing that is of interest is the directory name. The new filesystem overlays itself on to this mount point and all the ownership and permissions are whatever was on that new disk is. The old information about the directory, and also if there were any contents in it, are now invisible to the operating system






          share|improve this answer
























          • Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

            – DaeYoung
            Feb 11 '16 at 19:56











          • /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

            – coteyr
            Feb 11 '16 at 20:00
















          3














          The directory you created is just an empty shell. Despite whatever name you gave it and what ownership, once the new filesystem comes, the only thing that is of interest is the directory name. The new filesystem overlays itself on to this mount point and all the ownership and permissions are whatever was on that new disk is. The old information about the directory, and also if there were any contents in it, are now invisible to the operating system






          share|improve this answer
























          • Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

            – DaeYoung
            Feb 11 '16 at 19:56











          • /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

            – coteyr
            Feb 11 '16 at 20:00














          3












          3








          3







          The directory you created is just an empty shell. Despite whatever name you gave it and what ownership, once the new filesystem comes, the only thing that is of interest is the directory name. The new filesystem overlays itself on to this mount point and all the ownership and permissions are whatever was on that new disk is. The old information about the directory, and also if there were any contents in it, are now invisible to the operating system






          share|improve this answer













          The directory you created is just an empty shell. Despite whatever name you gave it and what ownership, once the new filesystem comes, the only thing that is of interest is the directory name. The new filesystem overlays itself on to this mount point and all the ownership and permissions are whatever was on that new disk is. The old information about the directory, and also if there were any contents in it, are now invisible to the operating system







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 11 '16 at 19:45









          MelBurslanMelBurslan

          5,29011533




          5,29011533













          • Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

            – DaeYoung
            Feb 11 '16 at 19:56











          • /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

            – coteyr
            Feb 11 '16 at 20:00



















          • Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

            – DaeYoung
            Feb 11 '16 at 19:56











          • /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

            – coteyr
            Feb 11 '16 at 20:00

















          Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

          – DaeYoung
          Feb 11 '16 at 19:56





          Thank you for taking your time to answer my question. Due to my lack of understanding on Linux, it is a bit hard to digest your explanation although I believe the contents must be something easily understood by experienced linux engineers. I will carefully read again and do research terms/words you laid out. Have a blessed day!

          – DaeYoung
          Feb 11 '16 at 19:56













          /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

          – coteyr
          Feb 11 '16 at 20:00





          /foo/bar points to inode 1234 when you set permissions, you set them on inode 1234, when you mount you point /foo/bar to inode 4567, inode 4567 has different permissions. ( this illustrates the answer but is technically wrong, just take it with a grain of salt.)

          – coteyr
          Feb 11 '16 at 20:00


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux 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%2funix.stackexchange.com%2fquestions%2f261608%2fwhy-file-ownership-set-on-filesystem-does-not-take-affect-after-mount%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

          How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

          is 'sed' thread safe

          How to make a Squid Proxy server?