Skip to content

Instantly share code, notes, and snippets.

@labeneator
Created October 11, 2013 17:02
Show Gist options
  • Save labeneator/6938356 to your computer and use it in GitHub Desktop.
Save labeneator/6938356 to your computer and use it in GitHub Desktop.
# /sbin/debugfs /tmp/zeros
debugfs 1.39 (29-May-2006)
debugfs: ?
Available debugfs requests:
show_debugfs_params, params
Show debugfs parameters
open_filesys, open Open a filesystem
close_filesys, close Close the filesystem
feature, features Set/print superblock features
dirty_filesys, dirty Mark the filesystem as dirty
init_filesys Initalize a filesystem (DESTROYS DATA)
show_super_stats, stats Show superblock statistics
ncheck Do inode->name translation
icheck Do block->inode translation
change_root_directory, chroot
Change root directory
change_working_directory, cd
Change working directory
list_directory, ls List directory
show_inode_info, stat Show inode information
link, ln Create directory link
unlink Delete a directory link
mkdir Create a directory
rmdir Remove a directory
rm Remove a file (unlink and kill_file, if appropriate)
kill_file Deallocate an inode and its blocks
clri Clear an inode's contents
freei Clear an inode's in-use flag
seti Set an inode's in-use flag
testi Test an inode's in-use flag
freeb Clear a block's in-use flag
setb Set a block's in-use flag
testb Test a block's in-use flag
modify_inode, mi Modify an inode by structure
find_free_block, ffb Find free block(s)
find_free_inode, ffi Find free inode(s)
print_working_directory, pwd
Print current working directory
...skipping one line
mknod Create a special file
list_deleted_inodes, lsdel
List deleted inodes
undelete, undel Undelete file
write Copy a file from your native filesystem
dump_inode, dump Dump an inode out to a file
cat Dump an inode out to stdout
lcd Change the current directory on your native filesystem
rdump Recursively dump a directory to the native filesystem
set_super_value, ssv Set superblock value
set_inode_field, sif Set inode field
logdump Dump the contents of the journal
htree_dump, htree Dump a hash-indexed directory
dx_hash, hash Calculate the directory hash of a filename
dirsearch Search a directory for a particular filename
bmap Calculate the logical->physical block mapping for an inode
imap Calculate the location of an inode
dump_unused Dump unused blocks
set_current_time Set current time to use when setting filesystme fields
help Display info on command or topic.
list_requests, lr, ? List available commands.
quit, q Leave the subsystem.
debugfs: ls
2 (12) . 2 (12) .. 11 (20) lost+found 12 (980) blktrace
debugfs: stat blktrace
Inode: 12 Type: regular Mode: 0644 Flags: 0x0 Generation: 2039396507
User: 0 Group: 0 Size: 108740
File ACL: 0 Directory ACL: 0
Links: 1 Blockcount: 216
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x52582724 -- Fri Oct 11 18:28:20 2013
atime: 0x52581985 -- Fri Oct 11 17:30:13 2013
mtime: 0x52582724 -- Fri Oct 11 18:28:20 2013
BLOCKS:
(0-11):38-49, (IND):50, (12-106):51-145
TOTAL: 108
debugfs: bmap blktrace 0
38
debugfs: bmap blktrace 108
0
debugfs: bmap blktrace 107
0
debugfs: bmap blktrace 105
144
debugfs: bmap blktrace 106
145
debugfs: testb 145
Block 145 marked in use
debugfs: testb 146
Block 146 not in use
debugfs: icheck 145
Block Inode number
145 12
debugfs: ncheck 12
Inode Pathname
12 /blktrace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment