Monday, March 31, 2008

Viewing NTFS information with nfi and diskedit

This post describes processes to view details information regarding an NTFS filesystem, including NTFS attributes such as resident $FILE_NAME, nonresident $DATA and the MFT FRS bytes for any particular file on the filesystem.

I’ve always been curious of how to see the details of NTFS, but have never really had the necessity before. As it happens, we’re discovering quite a few ‘Enterprise Vault’ Event ID 20488 errors when FSA is trying to create placeholder records. The only pattern I can find is that files exhibiting this problem (copied from an NFS volume) all have $EA_INFORMATION (resident) and $EA_DATA (resident) NTFS attributes. Stripping the extended attributes (copying to/from FAT, or recreating the file (eg. By compressing/uncompressing with something not clever enough to read the EA’s – arj32 will do it) resolves the issues with Enterprise Vault.

Anyway, back to NTFS, two utilities I’ve found invaluable in this exercise are 'nfi' and 'diskedit' (Microsoft). Nfi.exe comes from the 2000 server utilities in the link below, while diskedit.exe comes with NT4 SP4.

Using nfi.exe

View a directory:

nfi "c:\WINDOWS"
NTFS File Sector Information Utility.
Copyright (C) Microsoft Corporation 1999. All rights reserved.

$FILE_NAME (resident)
$INDEX_ROOT $I30 (resident)
$INDEX_ALLOCATION $I30 (nonresident)
logical sectors 21137544-21137647 (0x1428888-0x14288ef)
$BITMAP $I30 (resident)

View a file (showing non-contiguous sectors):

nfi "C:\windows\NOTEPAD.EXE"
NTFS File Sector Information Utility.
Copyright (C) Microsoft Corporation 1999. All rights reserved.

$FILE_NAME (resident)
$DATA (nonresident)
logical sectors 5453304-5453383 (0x5335f8-0x533647)
logical sectors 9927784-9927839 (0x977c68-0x977c9f)

Read the first sector of the nonresident data section of notepad.exe, which shows the FRS number (0x1EE5 - 7909).

nfi c: 5453304
NTFS File Sector Information Utility.
Copyright (C) Microsoft Corporation 1999. All rights reserved.

***Logical sector 5453304 (0x5335f8) on drive C is in file number 7909.
$FILE_NAME (resident)
$DATA (nonresident)
logical sectors 5453304-5453383 (0x5335f8-0x533647)
logical sectors 9927784-9927839 (0x977c68-0x977c9f)

Read a file that has the extended attributes I was talking about earlier:

nfi "C:\windows\temp\test.ea"
NTFS File Sector Information Utility.
Copyright (C) Microsoft Corporation 1999. All rights reserved.

$FILE_NAME (resident)
$FILE_NAME (resident)
$DATA (nonresident)
logical sectors 7069816-7070775 (0x6be078-0x6be437)
$EA_INFORMATION (resident)
$EA (resident)

Using diskedit.exe

Diskedit is much more interesting, but not particularly intuitive to use. Note that when running diskedit on 2000/xp/2003, you need to have a copy of the NT4 SP4 resource DLLs - IFSUTIL.DLL, UFAT.DLL, ULIB.DLL, UNTFS.DLL

Some ways I’ve used diskedit.exe:

View the file record segment for a file
File Open Volume Name - c:
Read NTFS File Record – Hex FRS number (taken from nfi or cracked)

This will show detailed information on the NTFS attributes of the file record, including filenames, relational information such as the parent directory. See the screenshot below.

View particular NTFS attributes of a record:

Attributes such as $STANDARD_INFO, $FILE_NAME. $SECURITY_DESCRIPTOR can be detailed.

File - Open Volume - Name - c:
Read - NTFS Attribte
1. Base Frs Number – Hex FRS number (taken from nfi or cracked)
2. Attribute Type – Select from the list
3. Attribute Name – Use from viewing the record if name exists, eg $I30 for $INDEX_ROOT

Find the FRS number for an object:

File - Open Volume - Name - c:
Crack - NTFS Path – Full path minus c:, eg \windows\notepad.exe

View the record segement bytes, showing the raw resident attributes, including the EA attributes (if they’re resident):

File - Open Volume - Name - c:
Read - NTFS File Record – Hex FRS number (taken from nfi or cracked)
View - Bytes

See the screenshot below.


nfi.exe from here shows NTFS information

NTFS, good description of NTFS

istat from the sleuth kit can report attributes apparently (didn’t have much luck using on NTFS 3.1/5.1)

Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Anonymous said...

download DiskEdit at

Anonymous said...

ViennaComputerProduduct link is dead

Currently you can get the NT version of Microsoft's DiskEdit for NT and the DLLs needed to run on earlier Windows versions here:

The page I found to get to this was:

which can be translated into English using this link:

Hope that helps anyone following this old stuff.

Jr. Williams said...

How to break administrator password of window xp without cd?
report ntfs permissions

All Posts

printQueue AD objects for 2003 ClusterVirtualCenter Physical to VirtualVirtual 2003 MSCS Cluster in ESX VI3
Finding duplicate DNS recordsCommand-line automation – Echo and macrosCommand-line automation – set
Command-line automation - errorlevels and ifCommand-line automation - find and findstrBuilding blocks of command-line automation - FOR
Useful PowerShell command-line operationsMSCS 2003 Cluster Virtual Server ComponentsServer-side process for simple file access
OpsMgr 2007 performance script - VMware datastores...Enumerating URLs in Internet ExplorerNTLM Trusts between 2003 and NT4
2003 Servers with Hibernation enabledReading Shortcuts with PowerShell and VBSModifying DLL Resources
Automatically mapping printersSimple string encryption with PowerShellUseful NTFS and security command-line operations
Useful Windows Printer command-line operationsUseful Windows MSCS Cluster command-line operation...Useful VMware ESX and VC command-line operations
Useful general command-line operationsUseful DNS, DHCP and WINS command-line operationsUseful Active Directory command-line operations
Useful command-linesCreating secedit templates with PowerShellFixing Permissions with NTFS intra-volume moves
Converting filetime with vbs and PowerShellDifference between bat and cmdReplica Domain for Authentication
Troubleshooting Windows PrintingRenaming a user account in ADOpsMgr 2007 Reports - Sorting, Filtering, Charting...
WMIC XSL CSV output formattingEnumerating File Server ResourcesWMIC Custom Alias and Format
AD site discoveryPassing Parameters between OpsMgr and SSRSAnalyzing Windows Kernel Dumps
Process list with command-line argumentsOpsMgr 2007 Customized Reporting - SQL QueriesPreventing accidental NTFS data moves
FSRM and NTFS Quotas in 2003 R2PowerShell Deleting NTFS Alternate Data StreamsNTFS links - reparse, symbolic, hard, junction
IE Warnings when files are executedPowerShell Low-level keyboard hookCross-forest authentication and GP processing
Deleting Invalid SMS 2003 Distribution PointsCross-forest authentication and site synchronizati...Determining AD attribute replication
AD Security vs Distribution GroupsTroubleshooting cross-forest trust secure channels...RIS cross-domain access
Large SMS Web Reports return Error 500Troubleshooting SMS 2003 MP and SLPRemotely determine physical memory
VMware SDK with PowershellSpinning Excel Pie ChartPoke-Info PowerShell script
Reading web content with PowerShellAutomated Cluster File Security and PurgingManaging printers at the command-line
File System Filters and minifiltersOpsMgr 2007 SSRS Reports using SQL 2005 XMLAccess Based Enumeration in 2003 and MSCS
Find VM snapshots in ESX/VCComparing MSCS/VMware/DFS File & PrintModifying Exchange mailbox permissions
Nested 'for /f' catch-allPowerShell FindFirstFileW bypassing MAX_PATHRunning PowerSell Scripts from ASP.Net
Binary <-> Hex String files with PowershellOpsMgr 2007 Current Performance InstancesImpersonating a user without passwords
Running a process in the secure winlogon desktopShadow an XP Terminal Services sessionFind where a user is logged on from
Active Directory _msdcs DNS zonesUnlocking XP/2003 without passwords2003 Cluster-enabled scheduled tasks
Purging aged files from the filesystemFinding customised ADM templates in ADDomain local security groups for cross-forest secu...
Account Management eventlog auditingVMware cluster/Virtual Center StatisticsRunning scheduled tasks as a non-administrator
Audit Windows 2003 print server usageActive Directory DiagnosticsViewing NTFS information with nfi and diskedit
Performance Tuning for 2003 File ServersChecking ESX/VC VMs for snapshotsShowing non-persistent devices in device manager
Implementing an MSCS 2003 server clusterFinding users on a subnetWMI filter for subnet filtered Group Policy
Testing DNS records for scavengingRefreshing Computer Account AD Group MembershipTesting Network Ports from Windows
Using Recovery Console with RISPAE Boot.ini Switch for DEP or 4GB+ memoryUsing 32-bit COM objects on x64 platforms
Active Directory Organizational Unit (OU) DesignTroubleshooting computer accounts in an Active Dir...260+ character MAX_PATH limitations in filenames
Create or modify a security template for NTFS perm...Find where a user is connecting from through WMISDDL syntax in secedit security templates

About Me

I’ve worked in IT for over 20 years, and I know just about enough to realise that I don’t know very much.