Skip to content

Releases: SvenGDK/UFS2Tool

UFS2Tool v4.0

15 Feb 16:50

Choose a tag to compare

πŸ—„οΈ 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).
  • 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 -name matching.
  • 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.

🌍 New Languages

  • Bahasa Indonesia
  • Magyar
  • Nederlands
  • PortuguΓͺs (Brasil)
  • δΈ­ζ–‡ (繁體) (Traditional Chinese)

πŸ”§ Fixes

  • Core Fixes
    • Nullable _writer field (Ufs2Image.cs): _writer is only initialized when readOnly=false but was declared non-nullable, producing CS8618 warnings.
    • Constructor resource leak (Ufs2Image.cs): If ReadSuperblock() throws (invalid image), the already-opened FileStream/BinaryReader/BinaryWriter were never disposed.
    • GetDiskFreeSpace reports wrong free space β€” was computing FreeBlocks * FSize but FreeBlocks is free blocks (not fragments), underreporting by BSize/FSize (typically 8x).
    • ls command ignores [path] argument β€” always called ListRoot() regardless of user-specified path; now resolves and lists the given directory.
    • Buffer overread in Ufs2DirectoryEntry.ReadFrom β€” corrupt entries with NameLength > nameAreaSize would index out of bounds.
    • ReadInode() / WriteInode() β€” totalInodes bounds check used int multiplication; changed to long to prevent overflow bypassing the validation.
    • FsckUfs() β€” Same overflow in totalInodes used to size per-inode tracking arrays; added explicit overflow guard since arrays require int length.
    • AllocateInode() / FsckUfs() Phase 5 β€” globalIno = cgIndex * inodesPerGroup + i overflows.
  • GUI
    • False success message on invalid input: Mode parsing (octal conversion) was inside the Task.Run lambda. On FormatException/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. Setting 644 recursively stripped execute bits from directories, making them untraversable. Added AddExecuteBits helper (matching CLI behavior) to derive directory mode.
  • Reliability
    • Stream.Read partial read handling β€” added ReadFully helper that loops until all bytes are read and throws EndOfStreamException on 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) in ReadIndirectBlock/ReadDoubleIndirectBlock/ReadTripleIndirectBlock β€” reuses existing _reader field.
  • Dokan mount error handling
    • SetEndOfFile: reject negative or > int.MaxValue lengths with InvalidParameter.
    • WriteFile: reject negative offsets; return InvalidParameter on newSize > int.MaxValue overflow.
    • Explicit (int) casts on validated long values for type safety.

UFS2Tool v3.0

13 Feb 17:19

Choose a tag to compare

πŸ—„οΈ 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_gen offset was wrong
    • UFS1: inode layout mismatch at offset 4
    • Superblock Sector Size not recovered on read
  • Other Core Fixes:
    • Ufs2Image.ReadFile: new byte[inode.Size] silently overflows for files >2GB (inode.Size is long, array index is int)
    • Ufs2Image.ReadBlockPointerAt: Only traversed direct + single-indirect blocks; returned 0 for double/triple indirect, breaking operations on large directories
    • Ufs2Image.AddDirectoryEntry: (dirSize - 1) / blockSize computes -1 when dirSize == 0, causing IndexOutOfRangeException
    • AlignedStream.Dispose: Flushed _deviceStream but 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 x product notation (e.g., 512x1024) that TryParseMakeFsSize already supported
  • CLI:
    • TryParseIntArg/TryParseLongArg/TryParseStringArg called PrintNewFsUsage() even when invoked from tunefs/makefs/growfs
  • GUI:
    • chmod Validation
    • Output Log: Missing log updates & possible crash
  • Windows Dokan Mounting:
    • MoveFile now delegates to Rename instead of returning NotImplemented
    • FindFiles function left timestamps uninitialized for special file types

UFS2Tool v2.5

12 Feb 17:19

Choose a tag to compare

πŸ—„οΈ 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

11 Feb 23:09

Choose a tag to compare

πŸ—„οΈ 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

11 Feb 17:33
ab41cbd

Choose a tag to compare

πŸ“ Fixes

Merged pull request #2 from @drakmor which fixes :

  • Wrong file/directory permissions. Files were not allowed to be executed.

and adds :

  • Auto metadata size calulcation when using makefs
  • UFS image creation progress

UFS2Tool v1

11 Feb 08:02

Choose a tag to compare

πŸ—„οΈ 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)
  • makefs command β€” FreeBSD makefs(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 (newfs on physical drives, devinfo) require Administrator privileges on Windows.
  • Filesystem images created by this tool are compatible with FreeBSD's mount and fsck_ffs.
  • When creating images with makefs, soft updates are disabled by default (softupdates=0), matching FreeBSD makefs(8) behavior. Use -o softupdates=1 to enable them explicitly.

πŸ“„ License

This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.