Are the attributes set by the “chattr” command implemented as extended attributes?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















The chattr command is used to set some attributes for a file (for example: append only (a), immutable (i), etc.).



Are these attributes implemented as extended attributes, or are they their own category of attributes?










share|improve this question


























    4















    The chattr command is used to set some attributes for a file (for example: append only (a), immutable (i), etc.).



    Are these attributes implemented as extended attributes, or are they their own category of attributes?










    share|improve this question
























      4












      4








      4








      The chattr command is used to set some attributes for a file (for example: append only (a), immutable (i), etc.).



      Are these attributes implemented as extended attributes, or are they their own category of attributes?










      share|improve this question














      The chattr command is used to set some attributes for a file (for example: append only (a), immutable (i), etc.).



      Are these attributes implemented as extended attributes, or are they their own category of attributes?







      linux






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 20 at 8:26









      JohnJohn

      23119




      23119




















          1 Answer
          1






          active

          oldest

          votes


















          7














          No, those flags are set using the FC_IOC_SETFLAGS ioctl() (also known as EXT2_IOC_SETFLAGS for ext* file systems, and corresponding one for other filesystems).



          In most file systems that support it, that translates to one bit map of the inode structure.



          For instance, in ext4 and several other file systems, that's the i_flags inode structure member (a 32 bit integer).



          Some foreign (non-Linux) filesystems like Apple's HFS+ have a similar concept with equivalent flags and the FC_IOC_SETFLAGS ioctl does the translation there.



          When using the stat command (which dumps the inode structure) in debugfs on ext* file systems, that's the Flags: number in the output:



           $ sudo debugfs /dev/vda
          debugfs: stat /tmp/file
          Inode: 1835209 Type: regular Mode: 0644 Flags: 0x80010
          [...]


          0x80000 is FS_EXTENT_FL (e in lsattr output), 0x10 is FS_IMMUTABLE_FL (i).



          The new statx() system call can also return (part of) that information (not all systems at this time (early 2019) will have a recent enough version of the GNU libc (2.28 or newer) to be able to call it easily though).



          On a recent system, you can use xfs_io's statx command as an interface to the statx() system call:



          $ xfs_io -rc 'statx -r' /tmp/a
          [...]
          stat.attributes = 0x10
          [...]


          (here 0x10 is STATX_ATTR_IMMUTABLE, the FS_EXTENT_FL one doesn't have a corresponding statx() flag).






          share|improve this answer
























            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%2f501791%2fare-the-attributes-set-by-the-chattr-command-implemented-as-extended-attribute%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









            7














            No, those flags are set using the FC_IOC_SETFLAGS ioctl() (also known as EXT2_IOC_SETFLAGS for ext* file systems, and corresponding one for other filesystems).



            In most file systems that support it, that translates to one bit map of the inode structure.



            For instance, in ext4 and several other file systems, that's the i_flags inode structure member (a 32 bit integer).



            Some foreign (non-Linux) filesystems like Apple's HFS+ have a similar concept with equivalent flags and the FC_IOC_SETFLAGS ioctl does the translation there.



            When using the stat command (which dumps the inode structure) in debugfs on ext* file systems, that's the Flags: number in the output:



             $ sudo debugfs /dev/vda
            debugfs: stat /tmp/file
            Inode: 1835209 Type: regular Mode: 0644 Flags: 0x80010
            [...]


            0x80000 is FS_EXTENT_FL (e in lsattr output), 0x10 is FS_IMMUTABLE_FL (i).



            The new statx() system call can also return (part of) that information (not all systems at this time (early 2019) will have a recent enough version of the GNU libc (2.28 or newer) to be able to call it easily though).



            On a recent system, you can use xfs_io's statx command as an interface to the statx() system call:



            $ xfs_io -rc 'statx -r' /tmp/a
            [...]
            stat.attributes = 0x10
            [...]


            (here 0x10 is STATX_ATTR_IMMUTABLE, the FS_EXTENT_FL one doesn't have a corresponding statx() flag).






            share|improve this answer





























              7














              No, those flags are set using the FC_IOC_SETFLAGS ioctl() (also known as EXT2_IOC_SETFLAGS for ext* file systems, and corresponding one for other filesystems).



              In most file systems that support it, that translates to one bit map of the inode structure.



              For instance, in ext4 and several other file systems, that's the i_flags inode structure member (a 32 bit integer).



              Some foreign (non-Linux) filesystems like Apple's HFS+ have a similar concept with equivalent flags and the FC_IOC_SETFLAGS ioctl does the translation there.



              When using the stat command (which dumps the inode structure) in debugfs on ext* file systems, that's the Flags: number in the output:



               $ sudo debugfs /dev/vda
              debugfs: stat /tmp/file
              Inode: 1835209 Type: regular Mode: 0644 Flags: 0x80010
              [...]


              0x80000 is FS_EXTENT_FL (e in lsattr output), 0x10 is FS_IMMUTABLE_FL (i).



              The new statx() system call can also return (part of) that information (not all systems at this time (early 2019) will have a recent enough version of the GNU libc (2.28 or newer) to be able to call it easily though).



              On a recent system, you can use xfs_io's statx command as an interface to the statx() system call:



              $ xfs_io -rc 'statx -r' /tmp/a
              [...]
              stat.attributes = 0x10
              [...]


              (here 0x10 is STATX_ATTR_IMMUTABLE, the FS_EXTENT_FL one doesn't have a corresponding statx() flag).






              share|improve this answer



























                7












                7








                7







                No, those flags are set using the FC_IOC_SETFLAGS ioctl() (also known as EXT2_IOC_SETFLAGS for ext* file systems, and corresponding one for other filesystems).



                In most file systems that support it, that translates to one bit map of the inode structure.



                For instance, in ext4 and several other file systems, that's the i_flags inode structure member (a 32 bit integer).



                Some foreign (non-Linux) filesystems like Apple's HFS+ have a similar concept with equivalent flags and the FC_IOC_SETFLAGS ioctl does the translation there.



                When using the stat command (which dumps the inode structure) in debugfs on ext* file systems, that's the Flags: number in the output:



                 $ sudo debugfs /dev/vda
                debugfs: stat /tmp/file
                Inode: 1835209 Type: regular Mode: 0644 Flags: 0x80010
                [...]


                0x80000 is FS_EXTENT_FL (e in lsattr output), 0x10 is FS_IMMUTABLE_FL (i).



                The new statx() system call can also return (part of) that information (not all systems at this time (early 2019) will have a recent enough version of the GNU libc (2.28 or newer) to be able to call it easily though).



                On a recent system, you can use xfs_io's statx command as an interface to the statx() system call:



                $ xfs_io -rc 'statx -r' /tmp/a
                [...]
                stat.attributes = 0x10
                [...]


                (here 0x10 is STATX_ATTR_IMMUTABLE, the FS_EXTENT_FL one doesn't have a corresponding statx() flag).






                share|improve this answer















                No, those flags are set using the FC_IOC_SETFLAGS ioctl() (also known as EXT2_IOC_SETFLAGS for ext* file systems, and corresponding one for other filesystems).



                In most file systems that support it, that translates to one bit map of the inode structure.



                For instance, in ext4 and several other file systems, that's the i_flags inode structure member (a 32 bit integer).



                Some foreign (non-Linux) filesystems like Apple's HFS+ have a similar concept with equivalent flags and the FC_IOC_SETFLAGS ioctl does the translation there.



                When using the stat command (which dumps the inode structure) in debugfs on ext* file systems, that's the Flags: number in the output:



                 $ sudo debugfs /dev/vda
                debugfs: stat /tmp/file
                Inode: 1835209 Type: regular Mode: 0644 Flags: 0x80010
                [...]


                0x80000 is FS_EXTENT_FL (e in lsattr output), 0x10 is FS_IMMUTABLE_FL (i).



                The new statx() system call can also return (part of) that information (not all systems at this time (early 2019) will have a recent enough version of the GNU libc (2.28 or newer) to be able to call it easily though).



                On a recent system, you can use xfs_io's statx command as an interface to the statx() system call:



                $ xfs_io -rc 'statx -r' /tmp/a
                [...]
                stat.attributes = 0x10
                [...]


                (here 0x10 is STATX_ATTR_IMMUTABLE, the FS_EXTENT_FL one doesn't have a corresponding statx() flag).







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 20 at 9:53

























                answered Feb 20 at 9:25









                Stéphane ChazelasStéphane Chazelas

                310k57584945




                310k57584945



























                    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%2f501791%2fare-the-attributes-set-by-the-chattr-command-implemented-as-extended-attribute%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 check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay