Linux - Directory with zero link count (Rancher container)
I have a permission error in a Rancher container's shell when accessing certain directory, but the permissions are correctly set. Then I noticed that the link count for said directory is zero, as shown:
But for any directory, the minimum amount of links is 2, self .
and parent ..
. So why would it show a 0 here? I don't get it. Right now I don't have access to this shell to check which inode it's pointing to (ls -i), but I guess it would be empty (I don't really know, TBH).
I'll try removing and then mkdir
ing it again to see if that solves it, but I'd really like to understand why this is happening.
Thanks!!
PS: I don't know if it being a Rancher container affects in any way.
filesystems hard-link
add a comment |
I have a permission error in a Rancher container's shell when accessing certain directory, but the permissions are correctly set. Then I noticed that the link count for said directory is zero, as shown:
But for any directory, the minimum amount of links is 2, self .
and parent ..
. So why would it show a 0 here? I don't get it. Right now I don't have access to this shell to check which inode it's pointing to (ls -i), but I guess it would be empty (I don't really know, TBH).
I'll try removing and then mkdir
ing it again to see if that solves it, but I'd really like to understand why this is happening.
Thanks!!
PS: I don't know if it being a Rancher container affects in any way.
filesystems hard-link
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count.
or..
links (I believebtrfs
is one such filesystem). So, what was the command, and what was the error?
– Fox
Mar 1 at 22:07
1
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it withrm -rf /backup
but didn't work. It says that "the resource is busy".
– Christian Rodriguez
Mar 2 at 14:53
add a comment |
I have a permission error in a Rancher container's shell when accessing certain directory, but the permissions are correctly set. Then I noticed that the link count for said directory is zero, as shown:
But for any directory, the minimum amount of links is 2, self .
and parent ..
. So why would it show a 0 here? I don't get it. Right now I don't have access to this shell to check which inode it's pointing to (ls -i), but I guess it would be empty (I don't really know, TBH).
I'll try removing and then mkdir
ing it again to see if that solves it, but I'd really like to understand why this is happening.
Thanks!!
PS: I don't know if it being a Rancher container affects in any way.
filesystems hard-link
I have a permission error in a Rancher container's shell when accessing certain directory, but the permissions are correctly set. Then I noticed that the link count for said directory is zero, as shown:
But for any directory, the minimum amount of links is 2, self .
and parent ..
. So why would it show a 0 here? I don't get it. Right now I don't have access to this shell to check which inode it's pointing to (ls -i), but I guess it would be empty (I don't really know, TBH).
I'll try removing and then mkdir
ing it again to see if that solves it, but I'd really like to understand why this is happening.
Thanks!!
PS: I don't know if it being a Rancher container affects in any way.
filesystems hard-link
filesystems hard-link
asked Mar 1 at 20:38
Christian Rodriguez
1061
1061
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count.
or..
links (I believebtrfs
is one such filesystem). So, what was the command, and what was the error?
– Fox
Mar 1 at 22:07
1
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it withrm -rf /backup
but didn't work. It says that "the resource is busy".
– Christian Rodriguez
Mar 2 at 14:53
add a comment |
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count.
or..
links (I believebtrfs
is one such filesystem). So, what was the command, and what was the error?
– Fox
Mar 1 at 22:07
1
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it withrm -rf /backup
but didn't work. It says that "the resource is busy".
– Christian Rodriguez
Mar 2 at 14:53
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count
.
or ..
links (I believe btrfs
is one such filesystem). So, what was the command, and what was the error?– Fox
Mar 1 at 22:07
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count
.
or ..
links (I believe btrfs
is one such filesystem). So, what was the command, and what was the error?– Fox
Mar 1 at 22:07
1
1
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it with
rm -rf /backup
but didn't work. It says that "the resource is busy".– Christian Rodriguez
Mar 2 at 14:53
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it with
rm -rf /backup
but didn't work. It says that "the resource is busy".– Christian Rodriguez
Mar 2 at 14:53
add a comment |
1 Answer
1
active
oldest
votes
POSIX requires the link count to be at least 2, and in general, 2 + the number of subdirs, as long as the directory isn't rmdir'd. If the directory is deleted, then the link count is generally 0.
Not all filesystems are POSIX, however. While generally filesystems usable as root filesystem on UNIX generally are, btrfs is the lone exception, as it works mostly fine as root fs, but is non-POSIX.
On GNU/Linux (and many, but not all other POSIX systems), when a filesystem does not follow POSIX semantics, it usually uses a link count of 1, which does not occur during normal operations (0, 2 and higher are possible, but not 1). Utilities such as GNU find will adapt to this by special-casing directories with link count of 1 as being non-POSIX, resulting in potentially slower operation.
In your case, a link count of 1 would indi9cate that this is a non-POISIX filesystem, while a link count 0 zero smells more like a bug in the filesystem implementation, as it is not a sensible value.
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%2f427551%2flinux-directory-with-zero-link-count-rancher-container%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
POSIX requires the link count to be at least 2, and in general, 2 + the number of subdirs, as long as the directory isn't rmdir'd. If the directory is deleted, then the link count is generally 0.
Not all filesystems are POSIX, however. While generally filesystems usable as root filesystem on UNIX generally are, btrfs is the lone exception, as it works mostly fine as root fs, but is non-POSIX.
On GNU/Linux (and many, but not all other POSIX systems), when a filesystem does not follow POSIX semantics, it usually uses a link count of 1, which does not occur during normal operations (0, 2 and higher are possible, but not 1). Utilities such as GNU find will adapt to this by special-casing directories with link count of 1 as being non-POSIX, resulting in potentially slower operation.
In your case, a link count of 1 would indi9cate that this is a non-POISIX filesystem, while a link count 0 zero smells more like a bug in the filesystem implementation, as it is not a sensible value.
add a comment |
POSIX requires the link count to be at least 2, and in general, 2 + the number of subdirs, as long as the directory isn't rmdir'd. If the directory is deleted, then the link count is generally 0.
Not all filesystems are POSIX, however. While generally filesystems usable as root filesystem on UNIX generally are, btrfs is the lone exception, as it works mostly fine as root fs, but is non-POSIX.
On GNU/Linux (and many, but not all other POSIX systems), when a filesystem does not follow POSIX semantics, it usually uses a link count of 1, which does not occur during normal operations (0, 2 and higher are possible, but not 1). Utilities such as GNU find will adapt to this by special-casing directories with link count of 1 as being non-POSIX, resulting in potentially slower operation.
In your case, a link count of 1 would indi9cate that this is a non-POISIX filesystem, while a link count 0 zero smells more like a bug in the filesystem implementation, as it is not a sensible value.
add a comment |
POSIX requires the link count to be at least 2, and in general, 2 + the number of subdirs, as long as the directory isn't rmdir'd. If the directory is deleted, then the link count is generally 0.
Not all filesystems are POSIX, however. While generally filesystems usable as root filesystem on UNIX generally are, btrfs is the lone exception, as it works mostly fine as root fs, but is non-POSIX.
On GNU/Linux (and many, but not all other POSIX systems), when a filesystem does not follow POSIX semantics, it usually uses a link count of 1, which does not occur during normal operations (0, 2 and higher are possible, but not 1). Utilities such as GNU find will adapt to this by special-casing directories with link count of 1 as being non-POSIX, resulting in potentially slower operation.
In your case, a link count of 1 would indi9cate that this is a non-POISIX filesystem, while a link count 0 zero smells more like a bug in the filesystem implementation, as it is not a sensible value.
POSIX requires the link count to be at least 2, and in general, 2 + the number of subdirs, as long as the directory isn't rmdir'd. If the directory is deleted, then the link count is generally 0.
Not all filesystems are POSIX, however. While generally filesystems usable as root filesystem on UNIX generally are, btrfs is the lone exception, as it works mostly fine as root fs, but is non-POSIX.
On GNU/Linux (and many, but not all other POSIX systems), when a filesystem does not follow POSIX semantics, it usually uses a link count of 1, which does not occur during normal operations (0, 2 and higher are possible, but not 1). Utilities such as GNU find will adapt to this by special-casing directories with link count of 1 as being non-POSIX, resulting in potentially slower operation.
In your case, a link count of 1 would indi9cate that this is a non-POISIX filesystem, while a link count 0 zero smells more like a bug in the filesystem implementation, as it is not a sensible value.
answered 40 mins ago
Marc Lehmann
1112
1112
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f427551%2flinux-directory-with-zero-link-count-rancher-container%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
"For any directory, the minimum amount of links is 2" This isn't universally true. Some filesystems neither include nor count
.
or..
links (I believebtrfs
is one such filesystem). So, what was the command, and what was the error?– Fox
Mar 1 at 22:07
1
@Fox In this case it applies. On a fresh container, this very same image has the two hard links for that folder. Tried removing it with
rm -rf /backup
but didn't work. It says that "the resource is busy".– Christian Rodriguez
Mar 2 at 14:53