Objective
See a real file system at work on your own PC: find out which file system each drive uses, watch clusters and "size on disk", read permissions, make hard links and junctions, flip file attributes, and meet an alternate data stream. You work only inside a new folder called FSLab in your Documents folder, and you delete it at the end.
Time: 30–40 minutes
You need: A Windows PC. No extra software. A few steps are marked (admin); they are optional, and you can skip them.
Safety: Do not run any command from this lab on
C:\Windowsor other system folders, except the read-only ones shown. Never use/fwithchkdsk.
What to Open
| Tool | How to open it |
|---|---|
| Command Prompt | Press Win, type cmd, press Enter (normal, not admin) |
| PowerShell | Press Win, type PowerShell, press Enter (normal, not admin) |
| File Explorer | Press Win + E |
| Disk Management | Press Win + X, choose Disk Management |
| Admin Command Prompt (only for steps marked admin) | Press Win, type cmd, right-click, Run as administrator |
Part 1: Which File System Is Each Drive Using?
1A. Disk Management. Open Disk Management. In the top list, read the File System column for each volume.
- File system of
C:: ________________ - Any other volume (EFI System Partition, a USB stick, a recovery partition)? List their file systems: ________________
(The small EFI System Partition is normally FAT32 (Section 2.2).)
1B. PowerShell.
Get-Volume | Format-Table DriveLetter, FileSystemLabel, FileSystem, Size, SizeRemaining1C. Command Prompt.
fsutil fsinfo volumeinfo C:
If this refuses to run, repeat it from an admin Command Prompt. Find:
- File System Name: ________________
- Does the flags list include supports Named Streams, supports Hard Links, supports Reparse Points? (Those are NTFS features from Sections 3.3 and 6.) ________________
- Maximum Component Length (the longest single file name): ________________ (NTFS: 255.)
1D. NTFS details (admin, optional).
fsutil fsinfo ntfsinfo C:
- Bytes Per Cluster: ________________ (commonly 4096)
- Bytes Per FileRecord Segment: ________________ (commonly 1024: the MFT record size from Section 4.1)
Part 2: Create the Lab Folder and Two Files
In Command Prompt:
cd %USERPROFILE%\Documents
mkdir FSLab
cd FSLab
echo hello > small.txt
Now make a bigger file (about 5,000 bytes) in PowerShell:
cd $env:USERPROFILE\Documents\FSLab
('x' * 5000) | Set-Content -NoNewline big.txt
Get-Item small.txt, big.txt | Select-Object Name, Lengthsmall.txtlength: ________________ (about 7 or 8 bytes: "hello" plus a line break)big.txtlength: ________________ (5000)
Size vs size on disk. In File Explorer open the FSLab folder, right-click each file → Properties.
small.txtSize on disk: ________________ (often 0 bytes: the data lives inside the MFT record, Section 4.1)big.txtSize on disk: ________________ (expected 8.00 KB: two 4 KB clusters, if your cluster size is 4 KB)
Compare: 5,000 bytes of data in 8,192 bytes of clusters. The gap is slack space (Section 1.3).
Part 3: Look at Permissions
3A. The Security tab. Right-click small.txt → Properties → Security. Click each name in the top box and read the Allow ticks.
- Which names are listed? ________________ (you will probably see SYSTEM, Administrators and your own account)
- What does your own account have? ________________ (often Full control, because you own the file)
Click Advanced. In the Permission entries list:
- Is Inherited from filled in? What does it say? ________________ (the parent folder; Section 5.4)
- Who is the Owner? ________________
Close the windows with Cancel. Do not change anything.
3B. Command line.
icacls small.txt
- Find a line with
(I). What does it mean? ________________ - Which code stands for Full control? ________________ (F)
(Get-Acl .\small.txt).Access | Format-Table IdentityReference, FileSystemRights, AccessControlType, IsInherited- Is
IsInheritedTrue for most rows? ________________
Part 4: Links with mklink
In Command Prompt, inside FSLab:
4A. A hard link (a second name for the same file; Section 6.1):
mklink /H hard.txt small.txt
dir
echo more >> hard.txt
type small.txt
- Did
small.txtshow the new line "more" too? ________________ (yes: one file, two names)
4B. A junction (a folder link; Section 6.3):
mkdir realfolder
echo inside > realfolder\note.txt
mklink /J junc realfolder
dir
dir junc
- In
dir, how isjunclabelled? ________________ (<JUNCTION>) - Does
dir juncshownote.txt? ________________ (yes: it leads intorealfolder)
4C. A symbolic link (Section 6.2). This may need an admin prompt, or Developer Mode on. If you see "You do not have sufficient privilege", skip it. It is not a mistake.
mklink symlink.txt big.txt
dir
- How is
symlink.txtlabelled? ________________ (<SYMLINK>)
Part 5: File Attributes with attrib
attrib small.txt
attrib +r small.txt
attrib small.txt
echo test >> small.txt
- After
+r, what letters appear? ________________ (R, and A) - What happened on the
echo ... >> small.txtline? ________________ (Access is denied: the file is read-only)
attrib -r small.txt
attrib +h small.txt
dir
dir /a
- Is
small.txtin the firstdir? Indir /a? ________________
attrib -h small.txt
In PowerShell, Get-ChildItem -Force also shows hidden files. Remember: Hidden is not security (Section 7.1).
Part 6: Meet an Alternate Data Stream
In Command Prompt, inside FSLab:
echo secret text > small.txt:hidden
dir small.txt
dir /r small.txt
more < small.txt:hidden
- Did the size of
small.txtin plaindirchange? ________________ (no) - What extra line does
dir /rshow? ________________ (a line ending with:hidden:$DATA)
PowerShell can do the same: Get-Item small.txt -Stream *.
A stream exists only on NTFS. Copying the file to a FAT32 or exFAT stick would silently drop it.
Part 7 (Optional): Peek at the Journal and Health (admin)
In an admin Command Prompt:
fsutil usn queryjournal C:
chkdsk C:
- The first prints the settings of the NTFS change journal (Section 4.4).
chkdskwith no switches on a mounted drive reports only; it does not repair. It reads the structures from Section 4. If it says it cannot run because the drive is in use, or offers to schedule a scan at restart, say no and skip this step. Never add/f.
Part 8: Clean Up
Remove the links first, so deleting cannot follow them into other folders. In Command Prompt:
cd %USERPROFILE%\Documents
rmdir FSLab\junc
del FSLab\symlink.txt
rmdir /s /q FSLab
(If you did not create symlink.txt, del just says it was not found.) Check that the folder is gone:
dir FSLab
You should get "File Not Found".
What Should Happen
- Part 1 shows NTFS for
C:, and FAT32 for the small boot partition. - Part 2 shows that a 5-byte file may take no clusters, while a 5,000-byte file takes two.
- Part 3 shows an ACL with inherited entries.
- Part 4 shows one hard-linked file with two names, and a junction labelled
<JUNCTION>. - Part 5 shows Read-only blocking writes and Hidden hiding a file.
- Part 6 shows a stream that does not change the visible size.
Interpretation Guide
| What you see | What it means |
|---|---|
File System Name: NTFS | Full Windows file system with ACLs, journal, links |
Bytes Per Cluster: 4096 | Default NTFS cluster size (4 KB) |
| Small file shows 0 bytes on disk | Its data is resident inside the MFT record |
big.txt shows 8 KB on disk | Two 4 KB clusters; the rest is slack |
(I) in icacls | Permission inherited from the parent folder |
| Hard link edit shows in both names | One MFT record, two directory entries |
<JUNCTION> / <SYMLINK> in dir | Reparse points (links) |
Access is denied after attrib +r | Read-only attribute is working |
:hidden:$DATA in dir /r | An alternate data stream is attached |
Follow-Up Questions
- Why did
small.txtshow 0 bytes on disk butbig.txtshow 8 KB? - After the hard-link test, you delete
small.txt. Can you still read the data throughhard.txt? Why? - How is a junction different from a shortcut (
.lnk) file? - Why is
attrib +hnot a good way to protect a secret? - What would happen to the alternate data stream if you copied
small.txtto a USB stick formatted FAT32?