Questions tagged [debugfs]

ext2/ext3/ext4 file system debugger

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

debugfs mi output shows different block count than the number of block references!

I have a file for which the the mi (modify inode) option gives different block count and block references : debugfs: mi <4762313> Mode [0100644] ...
Sam's user avatar
  • 1
1 vote
1 answer
63 views

Why can the mount points of debugfs and sysfs be overlapped?

The mount point for debugfs is /sys/kernel/debug, and the mount point for sysfs is /sys/, why can these 2 mount points be overlapped without interference?
tristone's user avatar
0 votes
1 answer
313 views

Why debugfs is mounted on /sys/kernel/debug?

As far as I know, /sys/ is for sysfs, why debugfs is mounted under the /sys/ directory? Why not just mount it under /debug/ to make it clearer?
tristone's user avatar
0 votes
1 answer
192 views

Weird debugfs behavior

I'm playing with debugfs. I first created a file: debugfs -w /dev/vda1 > write /etc/hosts /a/b/c/d And the file system is broken: [root@linux2 /]# ls -l ls: cannot access /a/b/c/d: No such file or ...
daisy's user avatar
  • 54k
0 votes
1 answer
145 views

debugfs on a NAS

# debugfs -R 'stat <INODE>' /dev/sdaX or # debugfs -R 'stat FILENAME' /dev/sdaX> display file creation time etc. How to run this command if the DEVICE is a NAS mounted e.g. on /MOUNTPOINT/VOL-...
I'm not a bug -- I'm a feature's user avatar
1 vote
0 answers
348 views

How can I modify a file creation time in btrfs

I wanted to have snapshots on my filesystem. Since the btrfs-convert tool is not available anymore, I was forced to convert my filesystem by copying it file-by-file on a new file-system. However, I ...
Camion's user avatar
  • 274
0 votes
0 answers
150 views

Where are my inodes used (advanced, debugfs, etc)

I made a copy of an ext4 volume with many errors and fscked it, before making an extensive comparison in order to make sure no data was lost in the process. since there were all kind of codings in the ...
Camion's user avatar
  • 274
1 vote
1 answer
2k views

debugfs not working | file not found by ext2_lookup

$sudo blkid /dev/sda1: UUID="F959-61DE" TYPE="vfat" PARTUUID="950b18a0-1501-48b4-92ef-ba1dd15aaf21" /dev/sda2: UUID="6dfcfc23-b076-4eeb-8fba-a1261b4ea399" TYPE=&...
Milad Bazi Saz's user avatar
1 vote
1 answer
618 views

Reading stale file data with debugfs cat

I'm trying to read the contents of a file using the file's inode. This works fine: echo "First line" > data.txt sync sudo debugfs -R "cat <$(stat -c %i data.txt)>" /dev/...
Matthias Braun's user avatar
0 votes
0 answers
215 views

Can't copy file with debugfs command

I'm playing around with debugfs command: # debugfs -w /dev/sda1 -R "write /etc/passwd /test" debugfs 1.45.5 (07-Jan-2020) Allocated inode: 24 But /test is not created: # cat /test cat: /...
daisy's user avatar
  • 54k
0 votes
0 answers
3k views

"Bad magic number in super-block while opening filesystem" when trying to open a disk partition with debugs

I'm trying to trace some I/O on my Linux virtual machine. The capture gives me LBAs which I need to map to the file name. I'm trying to use debugfs for that. For example, I want to see what file LBA=...
Nikolai's user avatar
  • 156
1 vote
1 answer
627 views

creating a debugfs file that is used to read/write u32 value

I'm trying to create a file with the following specifications. The file "myfile" in a debugfs sub-directory is to be read only by any user, and when read, should return the current value of ...
thatbangaloreanguy's user avatar
2 votes
2 answers
2k views

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 ...
Artem S. Tashkinov's user avatar
1 vote
1 answer
229 views

How to enlarge an ext3/ext4 filesystem through debugfs?

I’m in a situation where I want to enlarge the default size of an ext4 filesystem used by the firmware. The problem is resize2fs is doing extra things like clearing some filesystems features and ...
user2284570's user avatar
0 votes
1 answer
239 views

RAID1 recovery process skipping bad blocks

I have a RAID1 array with one sligtly damaged disk /dev/sdb. I put a fresh hard disk /dev/sda into this array in order to mirror sdb (then I’m gonna replace sdb with a fresh HDD). # cat /proc/mdstat ...
Sasha MaximAL's user avatar
2 votes
2 answers
721 views

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 ...
lanoxx's user avatar
  • 978
2 votes
0 answers
1k views

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 ...
Zaboj Campula's user avatar
1 vote
0 answers
823 views

how to use ftrace to function_trace a kernel modules interrupt?

I have a Banana Pi Arm device with 2 cores (1.2 GHz) running a Debian kernel which I enabled ftrace kernel debug options. I want to determine the amount of time spent in a kernel module function. The ...
channon's user avatar
  • 193
2 votes
1 answer
1k views

/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 ...
ArchLinuxTux's user avatar
2 votes
0 answers
302 views

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 ...
TiberiumFusion's user avatar
1 vote
2 answers
338 views

Creation time anomaly

I need to know the creation time of a file. I tried to run the stat filename command. But my fs does not store file creation time as metadata. [root@s1 XYZ]# stat ./px/cd/78/...
again's user avatar
  • 163
3 votes
1 answer
13k views

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-...
J. Doe's user avatar
  • 31
7 votes
3 answers
2k views

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 ...
bfuvx's user avatar
  • 111
5 votes
4 answers
5k views

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 ...
direprobs's user avatar
  • 974
3 votes
1 answer
264 views

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 ...
Ole Tange's user avatar
  • 34.7k
1 vote
1 answer
334 views

Ftrace time duration

I echoed 1 to tracing_on in /sys/kernel/debug/tracing directory and echoed 0 again after a second. However, the timestamp of the first entry is 216.852 and that of the last entry is 234.136 giving me ...
Vishal Khopkar's user avatar
2 votes
0 answers
197 views

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 ...
David Sevilla's user avatar
26 votes
3 answers
3k views

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 ...
humanityANDpeace's user avatar
2 votes
0 answers
1k views

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 ...
Maxthecat's user avatar
  • 121
2 votes
1 answer
3k views

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 . | ...
Yann's user avatar
  • 211
2 votes
0 answers
128 views

Finding files contained in particular block group

How do I see/list what files have blocks in a particular block group? I'm looking at a small disk image with an ext3 file system. Can I use debugfs, and if so, how?
Austin's user avatar
  • 221
2 votes
1 answer
233 views

Set debugfs pager

I do not want pager to clear screen when using debugfs. Have tried things like, as per man for debugfs: export PAGER='less -FX' debugfs foo bar export DEBUGFS_PAGER='less -FX' debugfs foo bar ...
user367890's user avatar
  • 1,877
4 votes
2 answers
21k views

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 ...
Sajjad.mp's user avatar
3 votes
2 answers
697 views

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: ...
Ron's user avatar
  • 247