Are the attributes set by the “chattr” command implemented as extended attributes?
Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
add a comment |
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
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
linux
asked Feb 20 at 8:26
JohnJohn
23119
23119
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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).
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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).
add a comment |
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).
add a comment |
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).
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).
edited Feb 20 at 9:53
answered Feb 20 at 9:25
Stéphane ChazelasStéphane Chazelas
310k57584945
310k57584945
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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