Re: Strange MBR CHS partition values created by debian-installer
Hi Valdikss,
On Sat, Jul 08, 2023 at 09:17:54PM +0300, ValdikSS wrote:
>Hello list,
>
>I was getting very slow boot speeds on old WYSE C10LE thin client with VIA C7
>CPU and Phoenix bios (year 2008). This is due to combination of BIOS, GRUB,
>and what I assume Debian-installer bugs.
>
>Long story short, Debian writes strange/incorrect C/H/S values to the MBR
>partition table upon installation, to which testdisk software complains as
>"Bad relative sector".
Nothing should be caring about C/H/S at all in the 21st century. Using
C/H/S only allows you to access 515MB of disk [1]. *Everything* these
days uses LBA instead.
What makes you think that the BIOS on this old machine cares about
C/H/S? What happens if you tweak the partitioning by hand when
installing?
>I've tried to install Debian 12 i386 to a 8G disk, using qemu, with guided
>automatic partitioning. Testdisk data right after the installation:
>
>> Disk testz.img - 8589 MB / 8192 MiB - CHS 1045 255 63
>> Current partition structure:
>> Partition Start End Size in sectors
>>
>> 1 P Linux 0 32 33 919 199 48 14774272
>>
>> Bad relative sector.
>> 2 E extended 919 232 16 1044 52 32 1996802
>>
>> Bad relative sector.
>> No partition is bootable
>> 5 L Linux Swap 919 232 18 1044 52 32 1996800
>>
>> Bad relative sector.
>
>
>It seems that testdisk automatically recalculates C/H/S values and shows
>corrected data (in the table above).
>
>Here's what really is present in the MBR (data of the first partition entry):
>
>> $ ./mbr_my.py testz.img Status: 0x0
>> C/H/S start: 4 4 1
>> Part type: 0x83
>> C/H/S end: 1023 254 2
>> LBA of first sector: 2048
>> Sector count: 14774272
>
>
>fdisk/cfdisk and parted all create partitions for which testdisk does not
>complain.
d-i drives parted to make partitions...
[1] https://forums.tomshardware.com/threads/lba-chs-bios-prob.685748/
--
Steve McIntyre, Cambridge, UK. steve@einval.com
"We're the technical experts. We were hired so that management could
ignore our recommendations and tell us how to do our jobs." -- Mike Andrews
Reply to: