Bug 277739 - makefs creates UFS filesystem that fsck considers invalid
Summary: makefs creates UFS filesystem that fsck considers invalid
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-16 17:11 UTC by John F. Carr
Modified: 2024-04-08 12:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2024-03-16 17:11:15 UTC
I used makefs to create a UFS filesystem.  The filesystem is marked clean but fsck reports errors.


# makefs -s 4g /var/tmp/root-image /usr/obj/stage15
Calculated size of `/var/tmp/root-image': 4294967296 bytes, 27793 inodes
Extent size set to 32768
density reduced from 154535 to 8192
/var/tmp/root-image: 4096.0MB (8388608 sectors) block size 32768, fragment size 4096
	using 7 cylinder groups of 626.00MB, 20032 blks, 80128 inodes.
super-block backups (for fsck -b #) at:
      64, 1282112, 2564160, 3846208, 5128256, 6410304, 7692352
Populating `/var/tmp/root-image'
Image `/var/tmp/root-image' complete
# mdconfig -f /var/tmp/root-image 
md2
# fsck -p /dev/md2
/dev/md2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/md2: clean, 145201 free (25 frags, 18147 blocks, 0.0% fragmentation)
# fsck /dev/md2
** /dev/md2
** Last Mounted on 
** Phase 1 - Check Blocks and Sizes
UFS1 cylinder group 0 failed: cgp->cg_old_niblk ("14592") != sblock.fs_ipg ("80128")
UFS1 cylinder group 0 failed: cgp->cg_old_niblk ("14592") != sblock.fs_ipg ("80128")
CYLINDER GROUP 0: INTEGRITY CHECK FAILED

REBUILD CYLINDER GROUP? [yn] y

INVALID INODE I=5632  OWNER=root MODE=120755
SIZE=19 MTIME=Mar 15 06:46 2024 
CLEAR? [yn] 



Inode number 5632 is

5632 lrwxr-xr-x  1 root wheel 19 Mar 15 06:46 /mnt/usr/share/locale/pt_BR.UTF-8/LC_CTYPE -> ../C.UTF-8/LC_CTYPE
Comment 1 John F. Carr 2024-03-16 21:13:52 UTC
This is related to bug #273725, which was considered harmless.  In my case fsck wants to clear an inode.
Comment 2 John F. Carr 2024-04-08 12:52:30 UTC
Using makefs -o version=2 creates a filesystem that fsck likes because the cg_old_niblk field does not exist in UFS2.