FSDB(8) | System Manager's Manual | FSDB(8) |
fsdb
— FFS
debugging/editing tool
fsdb |
[-dFnN ] -f
fsname |
fsdb
opens fsname
(usually a raw disk partition) and runs a command loop allowing manipulation
of the file system's inode data. You are prompted to enter a command with
“fsdb (inum X)>” where X is the
currently selected i-number. The initial selected inode is the root of the
filesystem (i-number 2). The command processor uses the
editline(3) library, so you
can use command line editing to reduce typing if desired. When you exit the
command loop, the file system superblock is marked dirty and any buffered
blocks are written to the file system.
The -d
option enables additional debugging
output (which comes primarily from
fsck(8)-derived code).
The -F
option indicates that
filesystem is a file system image, rather than a raw
character device. It will be accessed ‘as-is’, and no attempts
will be made to read a disklabel.
The -n
option disables writing to the
device, preventing any changes from being made to the filesystem.
The -N
option causes the superblock not to
be marked dirty when fsdb
exits.
Besides the built-in
editline(3) commands,
fsdb
supports these commands:
help
inode
i-numberback
clri
i-numberlookup
namecd
nameactive
print
uplink
downlink
linkcount
numberls
blks
findblk
disk block number ...saveblks
filenamerm
namedel
nameln
ino namechinum
dirslot inumchname
dirslot namechtype
typechmod
modechtype
to do that.
chflags
flagschown
uidchgrp
gidchgen
genmtime
timectime
timeatime
timebirthtime
timequit
,
q
, exit
,
⟨EOF⟩fsdb
uses the source code for
fsck(8) to implement most of the
file system manipulation code. The remainder of fsdb
first appeared in NetBSD 1.1.
Use this tool with extreme caution -- you can damage an FFS file system beyond what fsck(8) can repair.
Manipulation of “short” symlinks doesn't work (in
particular, don't try changing a symlink's type).
You must specify modes as numbers rather than symbolic names.
There are a bunch of other things that you might want to do which
fsdb
doesn't implement.
May 29, 2021 | NetBSD 10.99 |