Bug 162503 - makefs(8) creates a bad image for UFS2
Summary: makefs(8) creates a bad image for UFS2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Enji Cooper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-12 17:40 UTC by subbsd
Modified: 2015-11-09 10:27 UTC (History)
0 users

See Also:
ngie: mfc-stable10+
ngie: mfc-stable9+
ngie: mfc-stable8-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description subbsd 2011-11-12 17:40:05 UTC
Looks like makefs(8) tools creates incorrect image with UFS2 file system.
UFS1 is ok, for example:

# makefs /tmp/test1.img /bin

# file -s /tmp/test1.img 
/tmp/test1.img: Unix Fast File system [v1] (little-endian), last mounted on , last written at Sat Nov 12 21:34:57 2011, clean flag 1, number of blocks 1296, number of data blocks 1255, number of cylinder groups 1, block size 8192, fragment size 1024, minimum percentage of free blocks 8, rotational delay 0ms, disk rotational speed 60rps, TIME optimization

All fine.
Try to use makefs for UFS2:

# makefs -t ffs -o version=2 -o label=ROOTFS /tmp/test1.img /bin

# file -s /tmp/test1.img
/tmp/test1.img: data

Try use mdconfig and newfs instead of makefs:
# truncate -s 100m /tmp/testme
# newfs -L ROOTFS `mdconfig -a -t vnode -f /tmp/testme`

# file -s /tmp/testme 
/tmp/testme: Unix Fast File system [v2] (little-endian) last mounted on , volume name ROOTFS, last written at Sat Nov 12 17:38:29 2011, clean flag 1, readonly flag 0, number of blocks 25600, number of data blocks 25095, number of cylinder groups 4, block size 32768, fragment size 4096, average file size 16384, average number of files in dir 64, pending blocks to free 0, pending inodes to free 0, system-wide uuid 0, minimum percentage of free blocks 8, TIME optimization


All fine.

With this problem it is impossible to create UFS2 (which support LABEL) image which it is possible to use as mfsroot image at loading on UFS Label through

rootfs_type="mfs_root"
rootfs_name="/boot/mfsroot"
vfs.root.mountfrom="ufs:/dev/ufs/ROOTFS"
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2015-10-25 22:12:59 UTC
Bulk taking makefs bugs.
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2015-11-09 10:27:21 UTC
jmg fixed an issue affecting UFS in head@r266930 and I just MFCed it in stable/9 and stable/10 as r290599 and r290600, respectively.

Part of the annoyance that I have with the ffs images is that it doesn't have a lower bound on the free space, so it fails if there isn't enough space allocated to the memory disk (but that can be ameliorated through `-M <some-value>`.

Closing because I can't repro the issue described in comment # 0 anymore.