Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Traveller''s Lunchbox

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 76 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       debugfs [ -b blocksize ] [ -s superblock ] [ -f cmd_file ]
       [ -R request ] [ -V ] [ [ -w ] [ -c ] [ -i ] [ device ] ]


       The debugfs program is an interactive file  system  debug­
       ger.  It can be used to examine and change the state of an
       ext2 file system.
       device is the special file  corresponding  to  the  device
       containing the ext2 file system (e.g /dev/hdXX).


       -w     Specifies  that the file system should be opened in
              read-write mode.  Without  this  option,  the  file
              system is opened in read-only mode.

       -c     Specifies  that the file system should be opened in
              catastrophic mode, in which  the  inode  and  group
              bitmaps are not read initially.  This can be useful
              for filesystems with  significant  corruption,  but
              because  of  this,  catastrophic  mode  forces  the
              filesystem to be opened read-only.

       -i     Specifies that device represents an ext2 image file
              created  by  the  e2image  program.  Since the ext2
              image file  only  contains  the  superblock,  block
              group   descriptor,   block  and  inode  allocation
              bitmaps, and the inode table, many debugfs commands
              will  not  function  properly.   Warning: no safety
              checks are in place, and debugfs may fail in inter­
              esting  ways if commands such as ls, dump, etc. are
              tried.  debugfs is a debugging tool.  It has  rough

       -b blocksize
              Forces the use of the given block size for the file
              system, rather than  detecting  the  correct  block
              size as normal.

       -s superblock
              Causes  the  file system superblock to be read from
              the given block number,  rather  than  the  default
              (1).  If you give a -s option, you must also give a
              -b option.

       -f cmd_file
              Causes debugfs to read in commands  from  cmd_file,
              and execute them.  When debugfs is finished execut­
              ing those commands, it will exit.

       -R request
              Causes  debugfs  to  execute  the  single   command

       interpreted relative to the current working  directory  as
       maintained  by debugfs.  This may be modified by using the
       debugfs command cd.


       This is a list of the commands which debugfs supports.

       bmap filespec logical_block
              Print the physical block  number  corresponding  to
              the logical block number logical_block in the inode

       cat filespec
              Dump the contents of the inode filespec to  stdout.

       cd filespec
              Change the current working directory to filespec.

       chroot filespec
              Change the root directory to be the directory file­

       close  Close the currently open file system.

       clri file
              Clear the contents of the inode file.

       dump [-p] filspec out_file
              Dump the contents of the inode filespec to the out­
              put  file  out_file.  If the -p option is given set
              the owner, group  and  permissions  information  on
              out_file to match filespec.

       expand_dir filespec
              Expand the directory filespec.

       feature [fs_feature] [-fs_feature] ...
              Set  or  clear  various  filesystem features in the
              superblock.  After setting or clearing any filesys­
              tem features that were requested, print the current
              state of the filesystem feature set.

       find_free_block [count [goal]]
              Find the first count  free  blocks,  starting  from
              goal and allocate it.

       find_free_inode [dir [mode]]
              Find a free inode and allocate it.  If present, dir
              specifies the inode number of the  directory  which
              the  inode  is  to be located.  The second optional
              argument mode specifies the permissions of the  new
              inode.   (If  the directory bit is set on the mode,
              Print  a listing of the inodes which use the one or
              more blocks specified on the command line.

       imap filespec
              Print the location of the inode data structure  (in
              the inode table) of the inode filespec.

       initialize device blocksize
              Create  an  ext2  file system on device with device
              size blocksize.  Note that this does not fully ini­
              tialize all of the data structures; to do this, use
              the mke2fs(8) program.  This is just a call to  the
              low-level library, which sets up the superblock and
              block descriptors.

       kill_file filespec
              Deallocate the inode filespec and its blocks.  Note
              that this does not remove any directory entries (if
              any) to this inode.  See the rm(1) command  if  you
              wish to unlink a file.

       lcd directory
              Change the current working directory of the debugfs
              process to directory on the native filesystem.

       ln filespec dest_file
              Create a link named dest_file which is  a  link  to
              filespec.  Note this does not adjust the inode ref­
              erence counts.

       logdump [-ac] [-b<block>]  [-i<inode>]  [-f<journal_file>]
              Dump the contents of the ext3 journal.

       ls [-l] [-d] filespec
              Print a listing of the files in the directory file­
              spec.   The  -l  flag  will list files using a more
              verbose format.  The  -d  flag  will  list  deleted
              entries in the directory.

       modify_inode filespec
              Modify  the  contents of the inode structure in the
              inode filespec.

       mkdir filespec
              Make a directory.

       mknod filespec [p|[[c|b] major minor]]
              Create a special device file (a named pipe, charac­
              ter  or  block  device).   If  a character or block
              device is to be made, the major  and  minor  device
              numbers must be specified.

       pwd    Print the current working directory.

       quit   Quit debugfs

       rdump directory destination
              Recursively  dump  directory  and  all its contents
              (including regular files, symbolic links, and other
              directories)   into  the  named  destination  which
              should be  an  existing  directory  on  the  native

       rm pathname
              Unlink  pathname.  If this causes the inode pointed
              to by pathname to have no other references, deallo­
              cate  the  file.   This  command  functions  as the
              unlink() system call.

       rmdir filespec
              Remove the directory filespec.

       setb block [count]
              Mark the block number block as allocated.   If  the
              optional  argument  count  is  present,  then count
              blocks starting  at  block  number  block  will  be
              marked as allocated.

       seti filespec
              Mark  inode filespec as in use in the inode bitmap.

       set_super_value field value
              Set the superblock field field to value.  The  list
              of  valid  superblock  fields  which can be set via
              this command can be displayed by using the command:
              set_super_value -l

       show_super_stats [-h]
              List  the contents of the super block and the block
              group descriptors.  If the -h flag is  given,  only
              print out the superblock contents.

       stat filespec
              Display  the contents of the inode structure of the
              inode filespec.

       testb block [count]
              Test if the block number block is marked  as  allo­
              cated  in  the block bitmap.  If the optional argu­
              ment count is present, then count  blocks  starting
              at block number block will be tested.

       testi filespec
       debugfs was written by Theodore Ts'o <tytso@mit.edu>.


       dumpe2fs(8), e2fsck(8), mke2fs(8)

E2fsprogs version 1.34      July 2003                  DEBUGFS(8)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can help in many different ways.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds