NetBSD Problem Report #38171

From martin@duskware.de  Wed Mar  5 08:40:26 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A71A863B88C
	for <gnats-bugs@gnats.netbsd.org>; Wed,  5 Mar 2008 08:40:26 +0000 (UTC)
Message-Id: <20080305054947.D289663B882@narn.NetBSD.org>
Date: Wed,  5 Mar 2008 05:49:47 +0000 (UTC)
From: hbent@cs.oberlin.edu
Reply-To: hbent@cs.oberlin.edu
To: netbsd-bugs-owner@NetBSD.org
Subject: mount_ffs doesn't work on CDs
X-Send-Pr-Version: www-1.0

>Number:         38171
>Category:       bin
>Synopsis:       mount_ffs doesn't work on CDs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          suspended
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 05 08:45:01 +0000 2008
>Closed-Date:    
>Last-Modified:  Thu Feb 17 05:45:01 +0000 2011
>Originator:     Henry Bent
>Release:        4.99.51
>Organization:
>Environment:
NetBSD aelfric 4.99.51 NetBSD 4.99.51 (AELFRIC) #0: Mon Mar  3 04:24:43 EST 2008  root@aelfric:/usr/obj/src-current/sys/arch/i386/compile/AELFRIC i386
>Description:
I have a great number of old DEC CD-ROMs that are just UFS filesystems  on CDs.  None of them will mount as-is.  If I create an image of the CD and attach it with vnd, it will mount correctly.

An example:

aelfric# mount /dev/cd0a /cdrom
mount_ffs: /dev/cd0a on /cdrom: incorrect super block
aelfric# dd if=/dev/rcd0a of=cdrom.img bs=1m
407+1 records in
407+1 records out
427008000 bytes transferred in 106.760 secs (3999700 bytes/sec)
aelfric# file cdrom.img
cdrom.img: Unix Fast File system [v1] (little-endian), last mounted on /mnt, last written at Tue Apr 28 09:09:37 1992, clean flag 30, number of blocks 416256, number of data blocks 390670, number of cylinder groups 94, block size 8192, fragment size 1024, minimum percentage of free blocks 10, rotational delay 0ms, disk rotational speed 60rps, TIME optimization
aelfric# vnconfig -r vnd0 cdrom.img
aelfric# mount -r /dev/vnd0a /mnt
aelfric# ls /mnt
RISC  lost+found

but every disc does essentially the same thing, they're just different sizes.
>How-To-Repeat:
Mount an old DEC CD-ROM.  I assume that burning a raw FFS filesystem onto a CD and then trying to mount it would also fail, but I don't have any blanks at the moment to test that theory.
>Fix:
Nope, sorry.

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171: mount_ffs doesn't work on CDs
Date: Wed, 5 Mar 2008 11:40:28 +0100

 On Wed, Mar 05, 2008 at 08:45:01AM +0000, hbent@cs.oberlin.edu wrote:
 > aelfric# mount /dev/cd0a /cdrom
 > mount_ffs: /dev/cd0a on /cdrom: incorrect super block

 What does 

   disklabel cd0

 and

   dumpfs /dev/rcd0a | head -30

 say?

 Martin

From: Henry Bent <hbent@cs.oberlin.edu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171: mount_ffs doesn't work on CDs
Date: Wed, 5 Mar 2008 18:15:20 -0500 (EST)

 On Wed, 5 Mar 2008, Martin Husemann wrote:

 > What does
 >
 >   disklabel cd0
 >
 > and
 >
 >   dumpfs /dev/rcd0a | head -30
 >
 > say?
 >

 aelfric# disklabel cd0
 # /dev/rcd0d:
 type: ATAPI
 disk: mydisc
 label: fictitious
 flags: removable
 bytes/sector: 2048
 sectors/track: 100
 tracks/cylinder: 1
 sectors/cylinder: 100
 cylinders: 2086
 total sectors: 208500
 rpm: 300
 interleave: 1
 trackskew: 0
 cylinderskew: 0
 headswitch: 0           # microseconds
 track-to-track seek: 0  # microseconds
 drivedata: 0

 4 partitions:
 #        size    offset     fstype [fsize bsize cpg/sgs]
   a:    208500         0     4.2BSD      0     0     0  # (Cyl.      0 - 
 2084)
   d:    208500         0    ISO9660       0             # (Cyl.      0 - 
 2084)
 disklabel: boot block size 0
 disklabel: super block size 0
 disklabel: partitions a and d overlap

 aelfric# dumpfs /dev/rcd0a | head -30
 file system: /dev/rcd0a
 endian  little-endian
 magic   11954 (UFS1)    time    Tue Apr 28 09:09:37 1992
 cylgrp  static  inodes  4.2/4.3BSD      sblock  FFSv1   fslevel 0
 nbfree  48480   ndir    4       nifree  192496  nffree  21
 ncg     94      ncyl    1492    size    416256  blocks  390670
 bsize   8192    shift   13      mask    0xffffe000
 fsize   1024    shift   10      mask    0xfffffc00
 frag    8       shift   3       fsbtodb 1
 cpg     16      bpg     558     fpg     4464    ipg     2048
 minfree 10%     optim   time    maxcontig 8     maxbpg  256
 rotdelay 0ms    headswitch 0us  trackseek 0us   rps     60
 ntrak   9       nsect   62      npsect  0       spc     558
 symlinklen -1   trackskew 0     interleave 0    contigsumsize -1
 maxfilesize 0xffffffffffffffff
 nindir  2048    inopb   64      nspf    2
 sblkno  16      cblkno  24      iblkno  32      dblkno  288
 sbsize  8192    cgsize  2048    offset  32      mask    0xfffffff0
 csaddr  288     cssize  2048    shift   9       mask    0xfffffe00
 cgrotor 17      fmod    0       ronly   0       clean   0x1e
 flags   unclean acls
 fsmnt   /mnt
 blocks available in each of 8 rotational positions
 cylinder number 0:
     position 0:      0    4    8   12   31
     position 1:     16   20   24   28
     position 2:      1    5    9   13   32
     position 3:     17   21   25   29
     position 4:      2    6   10   14   33
     position 5:     18   22   26   30

 --
 Henry Bent
 hbent@cs.oberlin.edu

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, hbent@cs.oberlin.edu
Subject: Re: bin/38171: mount_ffs doesn't work on CDs
Date: Thu, 6 Mar 2008 18:14:28 +0000

 On Wed, Mar 05, 2008 at 11:15:03PM +0000, Henry Bent wrote:
  >  bytes/sector: 2048

 This is probably the issue. It is a known problem that various things
 object to bytes/sector != 512. There is or has been work towards
 lifting this restriction, but I don't remember what the status of it
 is.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 31 May 2010 02:47:25 +0000
State-Changed-Why:
This should work better now...


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 31 Jan 2011 08:09:50 +0000
State-Changed-Why:
Feedback timeout. Does anyone have ffs/ufs CDs (with non-512 blocksize) they
can test?


From: "Michael L. Hitch" <mhitch@lightning.msu.montana.edu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Mon, 31 Jan 2011 11:05:40 -0700 (MST)

 On Mon, 31 Jan 2011, dholland@NetBSD.org wrote:

 > State-Changed-From-To: feedback->open
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Mon, 31 Jan 2011 08:09:50 +0000
 > State-Changed-Why:
 > Feedback timeout. Does anyone have ffs/ufs CDs (with non-512 blocksize) they
 > can test?

    I may have some DEC ufs CDs - but the problem is almost certainly that
 the ufs is written using 512 byte blocks, and CDROM drives used by old DEC
 systems present the CD data as 512 blocks (although they are recorded on
 the CDROM as 2048 byte blocks.  The only two ways I can think of that 
 would allow mounting those CDs is to either modify the cd(4) driver to 
 buffer the 2048 byte blocks and present them as 512 byte blocks, or to 
 modify ufs to do the equivalent.  The alternative is to use a CDROM drive 
 that can present the data as 512 blocks.

 --
 Michael L. Hitch			mhitch@montana.edu
 Computer Consultant
 Information Technology Center
 Montana State University	Bozeman, MT	USA

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Thu, 3 Feb 2011 19:43:44 -0500

 On Mon, 31 Jan 2011 19:10:05 +0000 (UTC)
 "Michael L. Hitch" <mhitch@lightning.msu.montana.edu> wrote:

 >  the CDROM as 2048 byte blocks.  The only two ways I can think of that 
 >  would allow mounting those CDs is to either modify the cd(4) driver to 
 >  buffer the 2048 byte blocks and present them as 512 byte blocks, or to 
 >  modify ufs to do the equivalent.  The alternative is to use a CDROM drive 
 >  that can present the data as 512 blocks.

 Is using a fake disk label on a vnd layer a possible way to use that
 512-byte blocks FS?  The place I remember this idea from was from the
 CGD guide about using encrypted CDs/DVDs at:
 http://www.netbsd.org/docs/guide/en/chap-cgd.html#cryptocds
 -- 
 Matt

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Mon, 7 Feb 2011 06:07:56 +0000

 On Mon, Jan 31, 2011 at 07:10:05PM +0000, Michael L. Hitch wrote:
  >     I may have some DEC ufs CDs - but the problem is almost certainly that
  >  the ufs is written using 512 byte blocks, and CDROM drives used by old DEC
  >  systems present the CD data as 512 blocks (although they are recorded on
  >  the CDROM as 2048 byte blocks.

 Yeah, a closer look at the dumpfs output shows that the filesystem has
 a fragsize of 1024, which is just not going to work with 2048-byte
 device-level blocks without extra compat code.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->suspended
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 09 Feb 2011 06:00:02 +0000
State-Changed-Why:
The necessary blocksize translation layer should probably be written sometime
but probably won't be happening particularly soon...


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Wed, 9 Feb 2011 19:04:00 +0900

 > Synopsis: mount_ffs doesn't work on CDs
  :
 > The necessary blocksize translation layer should probably be written sometime
 > but probably won't be happening particularly soon...

 FYI, ffs with bsize=16384,fsize=2048 on CD-R can be mounted by mount_ffs(8).

 ---
 % makefs -t ffs -o fsize=2048,bsize=16384 /tmp/ffs hp300
 Calculated size of `/tmp/ffs': 153141248 bytes, 13523 inodes
 Extent size set to 16384
 /tmp/ffs: 146.0MB (299104 sectors) block size 16384, fragment size 2048
         using 1 cylinder groups of 146.05MB, 9347 blks, 14976 inodes.
 super-block backups (for fsck -b #) at:
  32,
 Populating `/tmp/ffs'
 Image `/tmp/ffs' complete
 % su
 # cdrecord -dev=/dev/rcd0d -speed=4 /tmp/ffs
  :

 # dumpfs /dev/rcd0a
 file system: /dev/rcd0a
 format  FFSv1
 endian  little-endian
 magic   11954           time    Wed Feb  9 18:46:49 2011
 superblock location     8192    id      [ 4d526289 6b8b4567 ]
 cylgrp  dynamic inodes  4.4BSD  sblock  FFSv2   fslevel 4
 nbfree  394     ndir    66      nifree  1452    nffree  7
 ncg     1       size    74776   blocks  73815
 bsize   16384   shift   14      mask    0xffffc000
 fsize   2048    shift   11      mask    0xfffff800
 frag    8       shift   3       fsbtodb 2
 bpg     9347    fpg     74776   ipg     14976
  :

 # mount_ffs -o ro /dev/cd0a /mnt
 # ls -l /mnt
 total 18
 drwxrwxr-x   2 tsutsui  wheel   512 Feb  9 18:42 CVS
 drwxrwxr-x   3 tsutsui  wheel   512 Dec 21  2009 DOC
 -rw-r--r--   1 tsutsui  wheel   821 Oct 30  2008 Makefile
 drwxrwxr-x  11 tsutsui  wheel   512 Jan 31 02:46 compile
 drwxrwxr-x   3 tsutsui  wheel   512 Feb  8 20:20 conf
 drwxrwxr-x   3 tsutsui  wheel  1536 Feb  9 18:33 dev
 drwxrwxr-x   3 tsutsui  wheel   512 Feb  9 18:42 hp300
 drwxrwxr-x   3 tsutsui  wheel  1536 Feb  9 18:33 include
 drwxrwxr-x   8 tsutsui  wheel   512 Feb  9 18:42 stand
 # df /mnt
 Filesystem   1K-blocks       Used      Avail %Cap Mounted on
 /dev/cd0a        147630     141312      -1062 100% /mnt
 # 

 ---
 Izumi Tsutsui

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Sat, 12 Feb 2011 19:51:59 +0000

 On Wed, Feb 09, 2011 at 10:05:03AM +0000, Izumi Tsutsui wrote:
  > FYI, ffs with bsize=16384,fsize=2048 on CD-R can be mounted by
  > mount_ffs(8).

 Good to hear it :-)  This allows closing PR 7668 and possibly others...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
Date: Thu, 17 Feb 2011 00:41:17 -0500

 On Wed,  9 Feb 2011 10:05:03 +0000 (UTC)
 Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> wrote:

 > The following reply was made to PR bin/38171; it has been noted by GNATS.
 > 
 > From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
 > To: gnats-bugs@NetBSD.org
 > Cc: tsutsui@ceres.dti.ne.jp
 > Subject: Re: bin/38171 (mount_ffs doesn't work on CDs)
 > Date: Wed, 9 Feb 2011 19:04:00 +0900
 > 
 >  > Synopsis: mount_ffs doesn't work on CDs
 >   :
 >  > The necessary blocksize translation layer should probably be written sometime
 >  > but probably won't be happening particularly soon...
 >  
 >  FYI, ffs with bsize=16384,fsize=2048 on CD-R can be mounted by mount_ffs(8).

 Lately I wanted to try this on netbsd-5/i386 but was getting issues
 (EINVAL received by getdents(2) at ls(1) attempts) with seemingly empty
 directories which did have files.  I however first tried with FFSv2 and
 -b 16384 -f 2048 as above.  Then I tried with FFSv2 and 512 blocks and
 using a fake cd0 label as chown in the CGD on DVD guide, but with very
 limited success (/ would list, other directories wouldn't, and EINVAL
 would occur for getdents(2) and open(2) or read(2) in a known to exist
 file).

 Later I tried with FFSv1 and without any special option, as shown in
 the guide, along with a real label on CGD and a fake fixed label on
 cd0, and that worked.  It's unclear if it's an FFSv2 issue, and I
 didn't yet decide to scrap more DVDs trying.

 For reference, the current working scripts for netbsd-5 can be found at:
 http://ftp.pulsar-zone.net/conf/cgd-dvd.tgz

 Thanks,
 -- 
 Matt

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.