Questions tagged [debugfs]

ext2/ext3/ext4 file system debugger

The debugfs program is an interactive file system debugger. It can be used to examine and change the state of an ext2, ext3, or ext4 file system.

34 questions
26
votes
3 answers

How to delete a file named "filen/ame" (with slash) on an ext4 filesystem in debugfs?

Playing with e2fsprogs debugfs, by change/accident, a file named filen/ame was created. Obviously the forward slash character / serves as the special separator character in pathnames. Still using debugfs I wanted to remove the file named filen/ame,…
humanityANDpeace
  • 13,722
  • 13
  • 61
  • 107
7
votes
3 answers

rmdir failed to remove empty directory

I have a problem with removing empty dir, strace shows error: rmdir("empty_dir") = -1 ENOTEMPTY (Directory not empty) And ls -la empty_dir shows nothing. So i connected to the fs (ext4) with debugfs and see the hidden file inside this dir: # ls…
bfuvx
  • 111
  • 7
5
votes
4 answers

How come that inodes of directories store filenames in ext4 filesystem?

A directory inode isn't substantially different from that of a regular file's inode, what I comprehend from Ext4 Disk Layout is that: Directory Entries: Therefore, it is more accurate to say that a directory is a series of data blocks and that…
direprobs
  • 944
  • 14
  • 29
4
votes
2 answers

why lsdel in debugfs doesn't work?

I have the partition /dev/sdb1 with file-system ext3 mounted at /mnt/folder. I touch a file in /mnt/folder and remove that file. Then I use debugfs /dev/sdb1 and then enter lsdel, but it says "0 deleted inodes found." What is problem? How i recover…
Sajjad.mp
  • 41
  • 1
  • 1
  • 2
3
votes
1 answer

debugfs and "Bad magic number"

I'm trying to get file creation time using whatever I could find on the Internet and there's generally one solution that works for everybody, and this is the tutorial: https://tecadmin.net/file-creation-time-linux/ And this is where it goes…
J. Doe
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Which file occupies block 123456789 on /dev/sda?

I would like to know which file occupies a given block on a blockdevice. The procedure should at least support ext4 on Encrypted LVM, but it would be delicious if it also explained how to do this for other storage systems. So I am looking for…
Ole Tange
  • 33,591
  • 31
  • 102
  • 198
3
votes
2 answers

Why debugfs doesn't show crtime in nanoseconds?

I am using: debugfs -R 'stat <7473635>' /dev/sda7 to get the file creation time (crtime). Inode: 7473635 Type: regular Mode: 0664 Flags: 0x80000 Generation: 1874934325 Version: 0x00000000:00000001 User: 1000 Group: 1000 Size:…
Ron
  • 247
  • 1
  • 3
  • 13
2
votes
2 answers

Copying or restoring crtime for files/directories on ext4fs filesystem

I wonder if there are ways to copy or restore crtime (creation time) for inodes/files/directories in Linux in 2020. I've accidentally deleted a folder while I still have a full disk backup, but neither cp -a, nor rsync can restore/copy…
Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64
2
votes
2 answers

Batch processing a ddrescue mapfile with debugfs

I have a mapfile produced by ddrescue which lists 418 bad sectors where each line looks like this (the minus indicates a bad block): Position Size 0x1CC7C68000 0x00001000 - By converting the position in bytes to the partition relative…
lanoxx
  • 968
  • 1
  • 7
  • 15
2
votes
0 answers

debugfs occasionally fails to read inode data

I need to get date and time when a file was created. The file is stored at ext4 filesystem so the information is available in the i-node and I use debugfs to read this information: # debugfs -R "stat <3922>" /dev/sda1 | grep crtime debugfs 1.43-WIP…
Zaboj Campula
  • 1,116
  • 3
  • 15
  • 30
2
votes
1 answer

/sys/kernel/debug/dynamic_debug/control not writable, follow xhci_hcd debug guide

I want to follow this tutorial. But I can't write to /sys/kernel/debug/dynamic_debug/control- or [debugfs]/dynamic_debug/control-file as suggested by the guide, even tough I am root, the special filesystem is mounted rw and the control-file has…
ArchLinuxTux
  • 593
  • 3
  • 8
  • 23
2
votes
0 answers

Alternative to debugfs for Android environment

For the purposes of retrieving a file's creation time (if available), I'd use debugfs. Unfortunately, debugfs is not part of most Android distributions. Are there any similar, more ubiquitous alternatives to debugfs that might be present on the…
2
votes
0 answers

Bad sector file diagnosis: did I reach the right conclusion about corrupted files?

I am in the middle of a failing drive data recovery process (see How can I find out which files are lost through a ddrescue recovery atempt?). I must say that I have no experience with disk management at this level. Following the accepted answer…
David Sevilla
  • 303
  • 2
  • 9
2
votes
0 answers

How can I open a debugfs on a partition in an image file?

I am trying to open a debugfs on an image obtained from dd. I'm interested in the 3rd/5th partition. Number Start End Size Type File system Flags 1 32256B 254983679B 254951424B primary ext2 …
Maxthecat
  • 121
  • 2
2
votes
1 answer

How to dump the list of used inodes on a ext4 filesystem by using debugfs?

After a hard drive I/O failue and an attempt at fsck recovery on an ext4 partition, I've got a disk where the numbers of used inode is vastly different according to 'df -i' and according to 'find . | wc -l': [yan@machine ~]$ ls -di…
Yann
  • 211
  • 3
  • 6
1
2 3