You are not logged in.

#1 2022-12-29 15:48:40

stefanwelte
Member
Registered: 2022-12-29
Posts: 3

Partition detected with wrong size

Hello,

while boot process, partition size of sda6 is detected with wrong size with archlinux32-iso-installer 20221102:

root@archiso ~ # fdisk -l /dev/sda                      
Disk /dev/sda: 27.95 GiB, 30005821440 bytes, 58605120 sectors
Disk model: IC25N030ATMR04-0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8d5ae552

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           2048 16136191 16134144  7.7G  c W95 FAT32 (LBA)
/dev/sda4       16136192 58605119 42468928 20.3G  5 Extended
/dev/sda5       16138240 17186815  1048576  512M 83 Linux
/dev/sda6       17188864 58605119 41416256 19.7G 83 Linux
root@archiso ~ # blockdev --getsz /dev/sda6             
35215157
root@archiso ~ # partprobe 
root@archiso ~ # blockdev --getsz /dev/sda6
41416256

partprobe "fixes" the issue temporarily.
With archlinux-iso-installer 20161201 (32 bit) this failure doesn't exist after booting.

Normally, sda6 has an LV, which itself has archlinux-root-filesystem inside. It was removed for debugging/finding the problem.
Because of the size mismatch LV won't become active on boot, archlinux-root-filesystem is missing and archlinux-system is not able to boot.
pvscan outputs following error message:

WARNING: Device /dev/sda6 has size of 35215157 sectors which is
smaller than corresponding PV size of 41416256 sectors. Was device resized?

Similar to here.

Problem started, when moving archlinux-root-filesystem from physical disc-partition into lvm months ago. So I cannot say at the moment, which kernel version / linux-image problem started.
Usage of this machine was paused in hope, problem in kernel/tools/utils will be fixed, but doesn't seem so.

Hardware is IBM Thinkpad R40e, Product Name: 2684QRG, BIOS-Version: 1SET70WW (1.38 )

Thanks for help and tipps,
Stefan

Update 1: Latest tested iso without problem is this one.
Tested first problematic iso is this one.
In between the kernel and initrd was renamed, maybe it's a hint to find the problem:
vmlinuz -> vmlinuz-linux
archiso.img -> initramfs-linux.img

Last edited by stefanwelte (2022-12-29 23:17:57)

Offline

#2 2022-12-30 00:10:56

levi
Moderator
From: Yorkshire, UK
Registered: 2018-06-16
Posts: 1,197

Re: Partition detected with wrong size

Personally I doubt the renaming of the kernel files has caused this, that seems more like a bit of fluff that is a built artefact of some makefile or other.  I note blockdev is owned by util-linux, so we need to look at what version that was at when it last worked, but unfortunately just now I'm at a loss to where the old packages are kept, I thought it used to be linked from the homepage here, but it seems that is no more.  Presumably that misidentification of the size of that logical volume stops the fs being mounted fully and so stops the machine booting fully.  Perhaps that issue hasn't affected me because I don't use logical volumes, and I don't run any OS other than archlniux on my boxes, so 4 partitions is enough for me.


Architecture: pentium4, Testing repos: Yes, Hardware: EeePC 901+2GB RAM+OS half on the SD card.

Offline

#3 2022-12-30 12:50:44

stefanwelte
Member
Registered: 2022-12-29
Posts: 3

Re: Partition detected with wrong size

Update2: 
Archlinux32 with LV running booted with downgraded linux-lts-kernel 5.4.98-1.0-lts and lz4-compression activated in /etc/mkinitcpio.conf.

dmesg shows unfunny "size/sectors mismatch"-, "capacity change" and "HPA detected" messages while booting, so maybe it's a timing issue on newer versions of kernel:
dmesg-grep for 'ata1\|sda' of four boots:
1+2: OK with iso-archliveimages 20161201 and 20201101
3th: OK with linux-lts-kernel 5.4.98
4th: KO with linux-kernel 5.17.5-arch1-1.2 with additional message "5.924421] sda: p6 size 41416256 extends beyond EOD, truncated" compared to the three OK boots.
5th: KO with iso-archliveimage 20210225 with additional message "5.924421] sda: p6 size 41416256 extends beyond EOD, truncated" compared to the three OK boots.

dmesg-iso20161201.txt:       [   12.222682] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
dmesg-iso20161201.txt:       [   12.382884] ata1.00: HPA detected: current 52404021, native 58605120
dmesg-iso20161201.txt:       [   12.382893] ata1.00: ATA-6: IC25N030ATMR04-0, MOAOAD4A, max UDMA/100
dmesg-iso20161201.txt:       [   12.382897] ata1.00: 52404021 sectors, multi 16: LBA 
dmesg-iso20161201.txt:       [   12.387803] ata1.00: configured for UDMA/100
dmesg-iso20161201.txt:       [   12.601894] sd 0:0:0:0: [sda] 52404021 512-byte logical blocks: (26.8 GB/25.0 GiB)
dmesg-iso20161201.txt:       [   12.601996] sd 0:0:0:0: [sda] Write Protect is off
dmesg-iso20161201.txt:       [   12.602000] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
dmesg-iso20161201.txt:       [   12.602038] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
dmesg-iso20161201.txt:       [   12.970942]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20161201.txt:       [   12.971362] sda: p6 size 41416256 extends beyond EOD, enabling native capacity
dmesg-iso20161201.txt:       [   12.971452] ata1: soft resetting link
dmesg-iso20161201.txt:       [   13.132191] ata1.00: n_sectors mismatch 52404021 != 58605120
dmesg-iso20161201.txt:       [   13.132196] ata1.00: new n_sectors matches native, probably late HPA unlock, n_sectors updated
dmesg-iso20161201.txt:       [   13.137157] ata1.00: configured for UDMA/100
dmesg-iso20161201.txt:       [   13.137167] ata1: EH complete
dmesg-iso20161201.txt:       [   13.138310] sd 0:0:0:0: [sda] 58605120 512-byte logical blocks: (30.0 GB/27.9 GiB)
dmesg-iso20161201.txt:       [   13.138617] sda: detected capacity change from 26830858752 to 30005821440
dmesg-iso20161201.txt:       [   13.198809]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20161201.txt:       [   13.200776] sd 0:0:0:0: [sda] Attached SCSI disk
dmesg-iso20201101.txt:       [   14.566666] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
dmesg-iso20201101.txt:       [   14.728912] ata1.00: HPA detected: current 52404021, native 58605120
dmesg-iso20201101.txt:       [   14.728923] ata1.00: ATA-6: IC25N030ATMR04-0, MOAOAD4A, max UDMA/100
dmesg-iso20201101.txt:       [   14.728926] ata1.00: 52404021 sectors, multi 16: LBA 
dmesg-iso20201101.txt:       [   15.431546] sd 0:0:0:0: [sda] 52404021 512-byte logical blocks: (26.8 GB/25.0 GiB)
dmesg-iso20201101.txt:       [   15.431586] sd 0:0:0:0: [sda] Write Protect is off
dmesg-iso20201101.txt:       [   15.431592] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
dmesg-iso20201101.txt:       [   15.431648] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
dmesg-iso20201101.txt:       [   15.790170]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20201101.txt:       [   15.790696] sda: p6 size 41416256 extends beyond EOD, enabling native capacity
dmesg-iso20201101.txt:       [   15.951436] ata1.00: n_sectors mismatch 52404021 != 58605120
dmesg-iso20201101.txt:       [   15.951440] ata1.00: new n_sectors matches native, probably late HPA unlock, n_sectors updated
dmesg-iso20201101.txt:       [   15.957077] sd 0:0:0:0: [sda] 58605120 512-byte logical blocks: (30.0 GB/27.9 GiB)
dmesg-iso20201101.txt:       [   15.957203] sda: detected capacity change from 26830858752 to 30005821440
dmesg-iso20201101.txt:       [   16.017980]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20201101.txt:       [   16.019409] sd 0:0:0:0: [sda] Attached SCSI disk
dmesg-iso20201101.txt:       [   16.019960] sda: detected capacity change from 0 to 30005821440
dmesg-linux-lts-lz4-img.txt: [    2.364379] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
dmesg-linux-lts-lz4-img.txt: [    2.536576] ata1.00: HPA detected: current 52404021, native 58605120
dmesg-linux-lts-lz4-img.txt: [    2.536587] ata1.00: ATA-6: IC25N030ATMR04-0, MOAOAD4A, max UDMA/100
dmesg-linux-lts-lz4-img.txt: [    2.536590] ata1.00: 52404021 sectors, multi 16: LBA 
dmesg-linux-lts-lz4-img.txt: [    2.818957] sd 0:0:0:0: [sda] 52404021 512-byte logical blocks: (26.8 GB/25.0 GiB)
dmesg-linux-lts-lz4-img.txt: [    2.818991] sd 0:0:0:0: [sda] Write Protect is off
dmesg-linux-lts-lz4-img.txt: [    2.818996] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
dmesg-linux-lts-lz4-img.txt: [    2.819038] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
dmesg-linux-lts-lz4-img.txt: [    2.878454]  sda: sda1 sda4 < sda5 sda6 >
dmesg-linux-lts-lz4-img.txt: [    2.878854] sda: p6 size 41416256 extends beyond EOD, enabling native capacity
dmesg-linux-lts-lz4-img.txt: [    3.049268] ata1.00: n_sectors mismatch 52404021 != 58605120
dmesg-linux-lts-lz4-img.txt: [    3.049272] ata1.00: new n_sectors matches native, probably late HPA unlock, n_sectors updated
dmesg-linux-lts-lz4-img.txt: [    3.054884] sd 0:0:0:0: [sda] 58605120 512-byte logical blocks: (30.0 GB/27.9 GiB)
dmesg-linux-lts-lz4-img.txt: [    3.055018] sda: detected capacity change from 26830858752 to 30005821440
dmesg-linux-lts-lz4-img.txt: [    3.106279]  sda: sda1 sda4 < sda5 sda6 >
dmesg-linux-lts-lz4-img.txt: [    3.107565] sd 0:0:0:0: [sda] Attached SCSI disk
dmesg-linux-fallback-img.txt:[    5.112651] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
dmesg-linux-fallback-img.txt:[    5.271671] ata1.00: HPA detected: current 52404021, native 58605120
dmesg-linux-fallback-img.txt:[    5.271696] ata1.00: ATA-6: IC25N030ATMR04-0, MOAOAD4A, max UDMA/100
dmesg-linux-fallback-img.txt:[    5.271703] ata1.00: 52404021 sectors, multi 16: LBA 
dmesg-linux-fallback-img.txt:[    5.278576] sd 0:0:0:0: [sda] 52404021 512-byte logical blocks: (26.8 GB/25.0 GiB)
dmesg-linux-fallback-img.txt:[    5.278621] sd 0:0:0:0: [sda] Write Protect is off
dmesg-linux-fallback-img.txt:[    5.278628] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
dmesg-linux-fallback-img.txt:[    5.278677] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
dmesg-linux-fallback-img.txt:[    5.696227]  sda: sda1 sda4 < sda5 sda6 >
dmesg-linux-fallback-img.txt:[    5.696994] sda: p6 size 41416256 extends beyond EOD, enabling native capacity
dmesg-linux-fallback-img.txt:[    5.857682] ata1.00: n_sectors mismatch 52404021 != 58605120
dmesg-linux-fallback-img.txt:[    5.857694] ata1.00: new n_sectors matches native, probably late HPA unlock, n_sectors updated
dmesg-linux-fallback-img.txt:[    5.924057]  sda: sda1 sda4 < sda5 sda6 >
dmesg-linux-fallback-img.txt:[    5.924421] sda: p6 size 41416256 extends beyond EOD, truncated
dmesg-linux-fallback-img.txt:[    5.932290] sd 0:0:0:0: [sda] 58605120 512-byte logical blocks: (30.0 GB/27.9 GiB)
dmesg-linux-fallback-img.txt:[    5.932476] sda: detected capacity change from 52404021 to 58605120
dmesg-linux-fallback-img.txt:[    5.932548] sd 0:0:0:0: [sda] Attached SCSI disk
dmesg-linux-fallback-img.txt:[    7.498313] device-mapper: table: 254:1: sda6 too small for target: start=4196352, len=37216256, dev_size=35215157
dmesg-iso20210225.txt:       [   17.663459] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
dmesg-iso20210225.txt:       [   17.820258] ata1.00: HPA detected: current 52404021, native 58605120
dmesg-iso20210225.txt:       [   17.820289] ata1.00: ATA-6: IC25N030ATMR04-0, MOAOAD4A, max UDMA/100
dmesg-iso20210225.txt:       [   17.820295] ata1.00: 52404021 sectors, multi 16: LBA 
dmesg-iso20210225.txt:       [   17.826838] sd 0:0:0:0: [sda] 52404021 512-byte logical blocks: (26.8 GB/25.0 GiB)
dmesg-iso20210225.txt:       [   17.826882] sd 0:0:0:0: [sda] Write Protect is off
dmesg-iso20210225.txt:       [   17.826889] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
dmesg-iso20210225.txt:       [   17.826937] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
dmesg-iso20210225.txt:       [   18.202569]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20210225.txt:       [   18.203053] sda: p6 size 41416256 extends beyond EOD, enabling native capacity
dmesg-iso20210225.txt:       [   18.362902] ata1.00: n_sectors mismatch 52404021 != 58605120
dmesg-iso20210225.txt:       [   18.362912] ata1.00: new n_sectors matches native, probably late HPA unlock, n_sectors updated
dmesg-iso20210225.txt:       [   18.430185]  sda: sda1 sda4 < sda5 sda6 >
dmesg-iso20210225.txt:       [   18.430541] sda: p6 size 41416256 extends beyond EOD, truncated
dmesg-iso20210225.txt:       [   18.431482] sd 0:0:0:0: [sda] 58605120 512-byte logical blocks: (30.0 GB/27.9 GiB)
dmesg-iso20210225.txt:       [   18.431608] sda: detected capacity change from 58605120 to 52404021
dmesg-iso20210225.txt:       [   18.431644] sd 0:0:0:0: [sda] Attached SCSI disk
dmesg-iso20210225.txt:       [   91.204478] device-mapper: table: 253:1: sda6 too small for target: start=4196352, len=37216256, dev_size=35215157

If complete dmesg-log is needed, please let me know und if not in code-tags, a link to pastebin upload instead?

An ugly workaround could be, to only use disk to sector 52404020 instead of 58605119, maybe i will test it some day, but nicer would be fixing the initial cause of the problem.

Last edited by stefanwelte (2022-12-30 14:06:50)

Offline

#4 2022-12-30 14:37:14

abaumann
Administrator
From: Zurich
Registered: 2019-11-14
Posts: 1,032
Website

Re: Partition detected with wrong size

As far as I read HPA is a "feature" to protect your hard disk somehow.. thusly shrinking it during boot.
Maybe you can disable this feature in the BIOS?
https://forums.unraid.net/topic/10229-h … ent-sizes/

If that's fatal to the data on the drive I cannot really tell..but it shouldn't IMHO.

If it is a kernel thing, then maybe some of this special code handling HPA is not up to date or so..

Offline

#5 2023-09-27 14:14:50

stefanwelte
Member
Registered: 2022-12-29
Posts: 3

Re: Partition detected with wrong size

abaumann wrote:

As far as I read HPA is a "feature" to protect your hard disk somehow.. thusly shrinking it during boot.
Maybe you can disable this feature in the BIOS?

There is only a feature called "IBM Predesktop Area" in Security-Tab of the BIOS: "Holds recovery image(s), HW diags, service utils.
* Normal: Change allowed; contents hidden from OS.
* Secure: No user or SW-initiated changes.
* Disabled: Not Usable. Visible and reclaimable."

Changed from "Normal" to "Disabled" (with popup message cited below), but strangely, it didn't change anything regarding the above problem:
Problem exists with linux-lts-5.15.90-1.0 and archlinux32-installer 2021.02.25.

Popup message:
"Attention! If you select Disabled, the IBM Predesktop Area will be visible and can be reclaimed by the OS. Once the area is overridden by OS tools, it can't be used with Normal or Secure again and you will need to opbtain a Recovery CD to retrieve original HDD."


abaumann wrote:

If it is a kernel thing, then maybe some of this special code handling HPA is not up to date or so..

Obviously there must have taken place a code change in kernels after linux-lts-5.4.98-1.0.

All in all, meanwhile it is rather complex to maintain and keep booting this machine (IBM Thinkpad R40e)., e.g. at the moment it needs following boot parameters to boot without failure
"noapic pci=assign-busses apicmaintimer idle=poll reboot=cold,hard"
and max. kernel version linux-lts-5.4.98-1.0.

Offline

Board footer

Powered by FluxBB