tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: In-kernel units for block numbers, etc ...



On 27/11/15 00:20, Robert Elz wrote:
[---]
> Making the CGD believe its underlying sectors are 4K panics the system.
> (That's about as far as I got, but I think the problem is related to
> translation between units, being done when it shouldn't be.)

   I took a quick stab at making cgd work on a disk with 4K sectors a
while back, but $OTHER_STUFF got in the way.  I got beyond any hard
crashes; I believe that newfs was failing.

   Heads-up; the panic you're seeing may be a division by zero.

   dg->dg_nsectors = 1024 * (1024 / dg->dg_secsize);

   I may have posted some patches a while back relating to this, but I'm
not sure.

   If you check those old posts you'll see that there were requests to
make cgd binary compatible between 512 and 4096 byte sectors.  I.e.
don't make cgd actually process the entire 4K sectors in one go, but
rather split it up into 8x512 byte operations; I assume the idea is that
you should be able to dd a 512 byte sector drive to a 4KB sector drive
and configuring a cgd device on it and mounting the partition  should
Just Work(tm).

-- 
Kind Regards,
Jan


Home | Main Index | Thread Index | Old Index