Are released blocks logged in the journal for ext4?
Suppose we have a simple case:
ext4file system with journaling- a single file named
file, which has no other hard links - the
inodeforfilehas associated with it only 1 datablock
My understanding of the deletion process for this specific case is as follows:
- log that we will delete
file
- log that we will reduce
inode'sref_cntby 1 - commit
- log that because
ref_cntis 0, releaseinodeback to pool - commit
- log that because
inodeis released, release associatedblockback to pool
- log that we will reduce
- commit deletion of
file
Among these, how do I get the block number that was released from step 1.5? Is it stored in the journal? If so, how would I access it?
I have been searching for some interface to the filesystem that gives this information. The best I've come to is debugfs -R "logdump -a", but I'm not sure how to move forward from there.
NOTE: I understand that there are tools like ext3grep that will help me with recovering file. My goal is to try this manually by getting the block number out of the journal, for educational purposes. I also understand that the inode and block may be reused before getting this information. For the purposes of this question, assume that the filesystem is read-only after the delete is done.
filesystems ext4 storage journaling
add a comment |
Suppose we have a simple case:
ext4file system with journaling- a single file named
file, which has no other hard links - the
inodeforfilehas associated with it only 1 datablock
My understanding of the deletion process for this specific case is as follows:
- log that we will delete
file
- log that we will reduce
inode'sref_cntby 1 - commit
- log that because
ref_cntis 0, releaseinodeback to pool - commit
- log that because
inodeis released, release associatedblockback to pool
- log that we will reduce
- commit deletion of
file
Among these, how do I get the block number that was released from step 1.5? Is it stored in the journal? If so, how would I access it?
I have been searching for some interface to the filesystem that gives this information. The best I've come to is debugfs -R "logdump -a", but I'm not sure how to move forward from there.
NOTE: I understand that there are tools like ext3grep that will help me with recovering file. My goal is to try this manually by getting the block number out of the journal, for educational purposes. I also understand that the inode and block may be reused before getting this information. For the purposes of this question, assume that the filesystem is read-only after the delete is done.
filesystems ext4 storage journaling
add a comment |
Suppose we have a simple case:
ext4file system with journaling- a single file named
file, which has no other hard links - the
inodeforfilehas associated with it only 1 datablock
My understanding of the deletion process for this specific case is as follows:
- log that we will delete
file
- log that we will reduce
inode'sref_cntby 1 - commit
- log that because
ref_cntis 0, releaseinodeback to pool - commit
- log that because
inodeis released, release associatedblockback to pool
- log that we will reduce
- commit deletion of
file
Among these, how do I get the block number that was released from step 1.5? Is it stored in the journal? If so, how would I access it?
I have been searching for some interface to the filesystem that gives this information. The best I've come to is debugfs -R "logdump -a", but I'm not sure how to move forward from there.
NOTE: I understand that there are tools like ext3grep that will help me with recovering file. My goal is to try this manually by getting the block number out of the journal, for educational purposes. I also understand that the inode and block may be reused before getting this information. For the purposes of this question, assume that the filesystem is read-only after the delete is done.
filesystems ext4 storage journaling
Suppose we have a simple case:
ext4file system with journaling- a single file named
file, which has no other hard links - the
inodeforfilehas associated with it only 1 datablock
My understanding of the deletion process for this specific case is as follows:
- log that we will delete
file
- log that we will reduce
inode'sref_cntby 1 - commit
- log that because
ref_cntis 0, releaseinodeback to pool - commit
- log that because
inodeis released, release associatedblockback to pool
- log that we will reduce
- commit deletion of
file
Among these, how do I get the block number that was released from step 1.5? Is it stored in the journal? If so, how would I access it?
I have been searching for some interface to the filesystem that gives this information. The best I've come to is debugfs -R "logdump -a", but I'm not sure how to move forward from there.
NOTE: I understand that there are tools like ext3grep that will help me with recovering file. My goal is to try this manually by getting the block number out of the journal, for educational purposes. I also understand that the inode and block may be reused before getting this information. For the purposes of this question, assume that the filesystem is read-only after the delete is done.
filesystems ext4 storage journaling
filesystems ext4 storage journaling
asked 2 hours ago
nehcsivartnehcsivart
363310
363310
add a comment |
add a comment |
0
active
oldest
votes
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%2f508603%2fare-released-blocks-logged-in-the-journal-for-ext4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f508603%2fare-released-blocks-logged-in-the-journal-for-ext4%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