Releases: SvenGDK/UFS2Tool
Releases Β· SvenGDK/UFS2Tool
UFS2Tool v4.0
ποΈ UFS2Tool v4.0
π₯οΈ New GUI Features
- UFS Image Content Browser
- Tree-view content browser for inspecting and manipulating UFS image contents, with drag & drop for adding files.
- Refresh, Extract, Add File, Add Folder & Delete options
- Write Filesystem
- Write UFS images to USB/HDD/SSD drives on Windows, Linux, and macOS
- PS5
- Batch Processing to convert multiple folders to UFS images in one operation.
- Language auto-detection
- Auto-applies language from OS locale on startup
π New UFS Image Commands
du- Display disk usage for files and directories in a UFS1/UFS2 filesystem image, similar to FreeBSD's
du(1).
- Display disk usage for files and directories in a UFS1/UFS2 filesystem image, similar to FreeBSD's
find- Searches recursively for files and directories matching a name pattern within a UFS1/UFS2 filesystem image. Similar to the Unix
find(1)command with-namematching.
- Searches recursively for files and directories matching a name pattern within a UFS1/UFS2 filesystem image. Similar to the Unix
stat- Displays detailed inode information for a file, directory, or symbolic link inside a UFS1/UFS2 filesystem image. Similar to the Unix
stat(1)command.
- Displays detailed inode information for a file, directory, or symbolic link inside a UFS1/UFS2 filesystem image. Similar to the Unix
π New Languages
- Bahasa Indonesia
- Magyar
- Nederlands
- PortuguΓͺs (Brasil)
- δΈζ (ηΉι«) (Traditional Chinese)
π§ Fixes
- Core Fixes
- Nullable
_writerfield (Ufs2Image.cs):_writeris only initialized whenreadOnly=falsebut was declared non-nullable, producing CS8618 warnings. - Constructor resource leak (
Ufs2Image.cs): IfReadSuperblock()throws (invalid image), the already-openedFileStream/BinaryReader/BinaryWriterwere never disposed. GetDiskFreeSpacereports wrong free space β was computingFreeBlocks * FSizebutFreeBlocksis free blocks (not fragments), underreporting byBSize/FSize(typically 8x).lscommand ignores[path]argument β always calledListRoot()regardless of user-specified path; now resolves and lists the given directory.- Buffer overread in
Ufs2DirectoryEntry.ReadFromβ corrupt entries withNameLength > nameAreaSizewould index out of bounds. ReadInode()/WriteInode()βtotalInodesbounds check usedintmultiplication; changed tolongto prevent overflow bypassing the validation.FsckUfs()β Same overflow intotalInodesused to size per-inode tracking arrays; added explicit overflow guard since arrays requireintlength.AllocateInode()/FsckUfs()Phase 5 βglobalIno = cgIndex * inodesPerGroup + ioverflows.
- Nullable
- GUI
- False success message on invalid input: Mode parsing (octal conversion) was inside the
Task.Runlambda. OnFormatException/OverflowException, the lambda returned early but the outer async method still logged "Successfully changed permissions". - Directories inaccessible after recursive chmod:
image.ChmodAll(mode, mode)applied the same mode to files and directories. Setting644recursively stripped execute bits from directories, making them untraversable. AddedAddExecuteBitshelper (matching CLI behavior) to derive directory mode.
- False success message on invalid input: Mode parsing (octal conversion) was inside the
- Reliability
Stream.Readpartial read handling β addedReadFullyhelper that loops until all bytes are read and throwsEndOfStreamExceptionon truncated data.- Bounds validation in
ReadInode/WriteInodeβ validates inode number against total count and computed offset against stream length before I/O. - Removed redundant
new BinaryReader(_stream)inReadIndirectBlock/ReadDoubleIndirectBlock/ReadTripleIndirectBlockβ reuses existing_readerfield.
- Dokan mount error handling
SetEndOfFile: reject negative or> int.MaxValuelengths withInvalidParameter.WriteFile: reject negative offsets; returnInvalidParameteronnewSize > int.MaxValueoverflow.- Explicit
(int)casts on validatedlongvalues for type safety.
UFS2Tool v3.0
ποΈ UFS2Tool v3.0
π New UFS Image Commands
rename- Rename a file or directory inside an UFS image
π New Languages
- Svenska
- Suomi
- Polski
- TiαΊΏng Viα»t
- RomΓ’nΔ
- Π£ΠΊΡΠ°ΡΠ½ΡΡΠΊΠ°
- ΔeΕ‘tina
- ΰΉΰΈΰΈ’
π§ Fixes
- Critical Core Fixes:
- UFS1:
di_genoffset was wrong - UFS1:
inodelayout mismatch at offset 4 - Superblock Sector Size not recovered on read
- UFS1:
- Other Core Fixes:
- Ufs2Image.ReadFile:
new byte[inode.Size]silently overflows for files >2GB (inode.Sizeislong, array index isint) - Ufs2Image.ReadBlockPointerAt: Only traversed direct + single-indirect blocks; returned 0 for double/triple indirect, breaking operations on large directories
- Ufs2Image.AddDirectoryEntry:
(dirSize - 1) / blockSizecomputes-1whendirSize == 0, causingIndexOutOfRangeException - AlignedStream.Dispose: Flushed
_deviceStreambut never disposed it β file handle leak - Ufs2ImageCreator.MakeFsImage: Inode count used
totalEntries + RootInode(+2) instead of +3 for reserved inodes 0, 1, root - Program.ParseGrowFsSize: Missing
xproduct notation (e.g.,512x1024) thatTryParseMakeFsSizealready supported
- Ufs2Image.ReadFile:
- CLI:
- TryParseIntArg/TryParseLongArg/TryParseStringArg called PrintNewFsUsage() even when invoked from tunefs/makefs/growfs
- GUI:
chmodValidation- Output Log: Missing log updates & possible crash
- Windows Dokan Mounting:
MoveFilenow delegates toRenameinstead of returningNotImplementedFindFilesfunction left timestamps uninitialized for special file types
UFS2Tool v2.5
ποΈ UFS2Tool v2.5
π₯οΈ New GUI Application
The GUI provides a graphical interface for all major UFS2Tool operations:
- Create Filesystem β Create UFS1/UFS2 images with configurable parameters
- Filesystem Operations β List, extract, add, delete, replace files, and change permissions
- Maintenance β TuneFS, GrowFS, and FsckUFS operations
- Device Mount β Mount/unmount UFS images as Windows drives (Windows only, requires Dokan)
- PS5 Quick Create β Preset templates for PS5-compatible filesystem creation
- Settings β Language selection (supports 13 languages total)
To start the GUI:
- Windows
- Simply double-click on UFS2Tool.GUI.exe
- Linux/macOS
- Execute ./UFS2Tool.GUI after chmod
π New UFS Image Operations
- chmod command for modifying Unix permissions inside UFS images
πΈ Windows Dokan Mounting Operations Updates
Implemented in read-write mode where applicable:
- DeleteFile / DeleteDirectory β delegates to Ufs2Image.Delete()
- SetFileTime β updates creation/access/modification timestamps on inodes
- SetFileAttributes β accepts silently (UFS uses Unix perms, not Windows attrs)
- FindFilesWithPattern β filters via DokanHelper.DokanIsNameInExpression
- GetFileSecurity / SetFileSecurity β returns NotImplemented (Unix perms β Windows ACLs)
- MoveFile β returns NotImplemented (no rename support in UFS API)
π¨ New Release Builds
- Release for Windows arm64
- Release for macOS & Linux x64 and arm64
- Self-contained builds already containing the .NET 8.0 runtime or default builds requiring the .NET 8.0 runtime installed
Linux & macOS Usage
UFS2Tool v2
ποΈ UFS2Tool v2.0
π New integrated FreeBSD UFS utilities :
- growfs
- The growfs utility makes it possible to expand an UFS file system.
- tunefs
- The tunefs utility is designed to change the dynamic parameters of a UFS file system which affect the layout policies.
- fsck_ufs
- The fsck_ufs utility is used to check and repair UFS structure.
- mount_udf / unmount_udf
- Allows mounting UFS1/UFS2 filesystem images as Windows drive letters using the Dokan user-mode filesystem driver, modeled after FreeBSD's mount_udf(8) / mount(8).
- Requires Dokan driver pre-installed on the Windows host.
π New UFS image operations :
- extract
- Extract content from UFS1/UFS2 filesystem images β entire filesystem, single file, or single directory (recursively).
- replace
- Replace files/directories in UFS1/UFS2 filesystem images.
- add / delete
- Add single file or recursive directory and delete single file or recursive directory.
UFS2Tool v1.1
UFS2Tool v1
ποΈ UFS2Tool
β¨ Features
- Create UFS1 and UFS2 filesystems on image files or raw Windows devices
- Full newfs(8) compatibility β supports all standard FreeBSD newfs flags (except
-T,-k,-r) - Populate from directory β create images from directory contents with auto-sizing (
-D) makefscommand β FreeBSDmakefs(8)compatible interface for creating filesystem images from directory trees- Read and inspect existing UFS1/UFS2 filesystem images
- List directory contents from UFS1/UFS2 images
- Device I/O β direct writing to physical drives and volumes on Windows
π Implementation Details
For a detailed breakdown of the core library components, filesystem structures, and all implemented features, see IMPLEMENTATIONS.md.
π Notes
- Device operations (
newfson physical drives,devinfo) require Administrator privileges on Windows. - Filesystem images created by this tool are compatible with FreeBSD's
mountandfsck_ffs. - When creating images with
makefs, soft updates are disabled by default (softupdates=0), matching FreeBSDmakefs(8)behavior. Use-o softupdates=1to enable them explicitly.
π License
This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.