Subject: bin/7623: newfs_lfs(8) creates unmountable filesystem on small partition
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itohy@netbsd.org>
List: netbsd-bugs
Date: 05/21/1999 23:20:54
>Number:         7623
>Category:       bin
>Synopsis:       newfs_lfs(8) creates unmountable filesystem on small partition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 21 23:20:01 1999
>Last-Modified:
>Originator:     ITOH Yasufumi
>Organization:

>Release:        1.4_BETA snapshot (the kernel is 1.4B)
>Environment:
System: NetBSD pino.my.domain 1.4B NetBSD 1.4B (PINO) #0: Fri May 21 07:45:44 JST 1999 itohy@pino.my.domain:/usr/src/sys/arch/i386/compile/PINO i386

The most of the userland is 1.4_BETA.


>Description:

    Can't create correct LFS on small partitions such as floppies.
    The 2nd superblock address (in the primary superblock; sblk.dlfs_sboffs[1])
    is zero, which cause this problem.

>How-To-Repeat:

    # dd if=/dev/zero of=/var/tmp/lfsimg bs=1440k count=1
    1+0 records in
    1+0 records out
    1474560 bytes transferred in 1 secs (1474560 bytes/sec)
    # vnconfig vnd0 /var/tmp/lfsimg
    # disklabel -w -r -f /usr/src/etc/etc.i386/disktab vnd0 floppy
    # env EDITOR=ed disklabel -e vnd0
    600
    1,$s/4\.2BSD/4.4LFS/p
      a:     2880        0     4.4LFS      512  4096     0   # (Cyl.    0 - 79)
    w
    600
    q
    # newfs_lfs -L /dev/rvnd0a			# create an LFS
    # mount -t lfs /dev/vnd0a /mnt
    mount_lfs: : Invalid argument		# can't mount this filesystem
    # vnconfig -u vnd0
    #

>Fix:

    Fix newfs_lfs (and fsck_lfs)?
>Audit-Trail:
>Unformatted: