Subject: Re: Supporting sector size != DEV_BSIZE
To: Chuck Silvers <>
From: Bill Studenmund <>
List: tech-kern
Date: 10/15/2001 07:47:18
On Sun, 14 Oct 2001, Chuck Silvers wrote:

> hi,
> I took some time this weekend to play with this some more and I made
> a bunch of progress.  I found a disk that would let me reformat it
> with 1024-byte sectors, and I managed to mount and access an FFS filesystem
> on this disk.  I encountered a couple problems while getting there:
>  (1) bounds_check_with_label() is assuming that b_blkno in units of
>      sectors, but really it's in units of DEV_BSIZE.
>  (2) the FFS superblock field "fs_fsbtodb" is used to translate between
>      filesystem blocks and the units of b_blkno, and newfs also assumes
>      that b_blkno is in units of the device sector size.  recording the
>      device sector size in the filesystem layout like this isn't a good
>      idea, since it means that if the filesystem image is copied to a
>      device with a different sector size, the filesystem can no longer
>      be mounted.

When I was working on this, my solution was to just always calculate this
on mount; the kernel knows what should be in there.

> after working around both of these, I could mount and access the filesystem.
> there was some problem with these workarounds since the next time I rebooted
> I discovered that the boot blocks on my boot disk had been clobbered,
> but that should be simple to fix.
> so we're actually pretty close to having this working.
> I'll probably look at this some more next weekend.


Take care,