git: sbin/newfs_hammer2: Add newfs(8) -s option equivalent option

Tomohiro Kusumi tkusumi at
Wed Mar 8 02:06:26 PST 2023

commit 6dd9109578df96d3d65713214349a80090c194bc
Author: Tomohiro Kusumi <tkusumi at>
Date:   Mon Mar 6 00:48:04 2023 -0800

    sbin/newfs_hammer2: Add newfs(8) -s option equivalent option
    Very useful for testing, file backed volume, etc.
    The difference vs newfs(8) is newfs_hammer2(8) takes filesystem
    size in bytes, using the same format as -b or -r options.
    The volume size is deducted from the value (in argv[i] order,
    where argc is number of volumes), and if the value reaches zero
    while there are remaining volumes, the program fails.
    Since -s option requires 1GiB (level1 size) or larger,
    the failure mentioned above happens only for multi-volumes.

Summary of changes:
 sbin/newfs_hammer2/mkfs_hammer2.c  | 13 ++++++++++++-
 sbin/newfs_hammer2/mkfs_hammer2.h  |  1 +
 sbin/newfs_hammer2/newfs_hammer2.8 | 24 ++++++++++++++++++++----
 sbin/newfs_hammer2/newfs_hammer2.c | 10 ++++++++--
 4 files changed, 41 insertions(+), 7 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list