Subject: Re: Cannot mount root partition
To: Cheng-Chung Song <songcc@vnet.IBM.COM>
From: None <>
List: amiga-dev
Date: 05/23/1994 13:05:54
> I finally solve the problem.   It is the combination of the way things got
> handled in readdisklabel() of disksubr.c and my harddisk.  My root is on Seagate
> ST-1096N, which has 1 spare sector for each cylinder.  So the calculated

	Gee, that's my drive too! 

> >>>>    lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;   <<<< Original
> >>>>    lp->d_secpercyl = rbp->secpercyl;                   <<<< New
>         if (lp->d_secpercyl != rbp->secpercyl)
>                 printf("warning found rdb->secpercyl(%d) != "
>                     "rdb->nsectors(%d) * rdb->nheads(%d)\n", rbp->secpercyl,
>                     rbp->nsectors, rbp->nheads);
> #endif
>         lp->d_secperunit = lp->d_secpercyl * (rbp->highcyl - rbp->lowcyl + 1);
>         lp->d_sparespercyl = lp->d_sparespertrack = 0;
> ------------------------------------------------------------------------------
> I don't know what is the best way to handle this problem in gerenal.  It seems
> that lp->d_sparespercyl is intended for this.  But I don't think we can specify
	My solution was to special case lp->d_secpercyl. Something like:
if (lp->d_secpercyl != rbp->secpercyl)
   lp->d_secpercyl = rbp->secpercyl

   I also fixed up lp->d_sparespercyl and lp->d_sparespertrack for grins,
   basically took  rdb->nsectors * rdb->nheads and subtracted rdb->secpercyl.
   Then I set lp->d_sparespertrack to lp->d_sparespercyl / nheads. This at
   least is more correct than just setting them to zero.

   Additionally I added the ability to recognise AMIX filesystems as I was
   sick of the messages on boot for those partitions. About 3 lines of code so
   it was no big change.