[opensuse-arm] ARMv6 (raspberry pi) image partitioning broken?
Marcus, when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE. The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124 Partition 1: previous sectors 411655 disagrees with total 193971 Partition 2: previous sectors 1865727 disagrees with total 897422 Remaining 5974015 unallocated 512-byte sectors If I repartition manually my SD card, number of heads/sectors are different and then I copy back the files on each partition and it does boot. I guess there is a problem with kiwi partitioning related to number of heads/sectors. Any idea how to fix that? Guillaume -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Le 29/10/2013 15:05, Guillaume Gardet a écrit :
Marcus,
when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs
But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE.
The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124 Partition 1: previous sectors 411655 disagrees with total 193971 Partition 2: previous sectors 1865727 disagrees with total 897422 Remaining 5974015 unallocated 512-byte sectors
If I repartition manually my SD card, number of heads/sectors are different and then I copy back the files on each partition and it does boot. I guess there is a problem with kiwi partitioning related to number of heads/sectors.
If I just redo 1st partition with YaST partitionner but decrease partition size from 1 cylinder, it does boot. Whereas fdisk still reports previous problems. Not sure if it could help. Tell me if you need more tests. Guillaume
Any idea how to fix that?
Guillaume
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi,
when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs
But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE.
The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124 Partition 1: previous sectors 411655 disagrees with total 193971 Partition 2: previous sectors 1865727 disagrees with total 897422 Remaining 5974015 unallocated 512-byte sectors
If I repartition manually my SD card, number of heads/sectors are different and then I copy back the files on each partition and it does boot. I guess there is a problem with kiwi partitioning related to number of heads/sectors.
If I just redo 1st partition with YaST partitionner but decrease partition size from 1 cylinder, it does boot. Whereas fdisk still reports previous problems. Not sure if it could help.
Tell me if you need more tests.
Sounds really strange :) Could you send the kiwi build log file, the one from the create step is enough. kiwi uses parted only to create partition tables. I'm most interested in the parted calls from the log file Thanks Regards, Marcus -- Public Key available gpg --keyserver pgp.mit.edu --recv-keys 0xCCE3C6A2 ------------------------------------------------------- Marcus Schäfer (Res. & Dev.) SUSE LINUX Products GmbH Tel: 0911-740 53 0 Maxfeldstrasse 5 FAX: 0911-740 53 479 D-90409 Nürnberg GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer HRB: 21284 (AG Nürnberg) Germany http://www.suse.de ------------------------------------------------------- -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Le 29/10/2013 15:42, Marcus Schäfer a écrit :
Hi,
when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs
But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE.
The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124 Partition 1: previous sectors 411655 disagrees with total 193971 Partition 2: previous sectors 1865727 disagrees with total 897422 Remaining 5974015 unallocated 512-byte sectors
If I repartition manually my SD card, number of heads/sectors are different and then I copy back the files on each partition and it does boot. I guess there is a problem with kiwi partitioning related to number of heads/sectors. If I just redo 1st partition with YaST partitionner but decrease partition size from 1 cylinder, it does boot. Whereas fdisk still reports previous problems. Not sure if it could help.
Tell me if you need more tests. Sounds really strange :)
Indeed.
Could you send the kiwi build log file, the one from the create step is enough. kiwi uses parted only to create partition tables. I'm most interested in the parted calls from the log file
Full build log is available here: http://guillaume.gardet.free.fr/openSUSE/RPi/Marcus/build.log Guillaume
Thanks
Regards, Marcus
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi Guillaume, That sounds all too familiar to me...
when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs
can you paste output of fdisk partition listing "l" in expert mode ?
But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE.
The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124
Ok, so the C/H/S geometry is wrong. One neat detail that we learned the hard way is that the C/H/S geometry really does matter for the actual device. kiwi is more optimized for the x86 world where almost everything uses plain LBA for accessing the devices and proper C/H/S mapping is not relevant anymore. its usage of gparted is a great part of that problem, as gparted is notoriously bad at keeping C/H/S mapping intact. The way most devices determine the correct H/S layout is by looking at the partition end of the 1st partition. The values in there are taken as number of Heads and Cyclinders, and that layout is then used later for determining where partitions are bound to start (the rule is that they have to start on a cylinder/head boundary if I remember correctly). We had this problem already several times before, and I thought we catched all wrong calculations in kiwi already (kiwi for some reason does those calculations manually), but it seems we missed the case for FAT32. The strategic "remove one sector from the partition length" is the fix we did also for all the other code paths, so the remaining work is to find where the duplicated code for creating the FAT32 partition lives in kiwi and patch that one as well. Greetings, Dirk -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Le 30/10/2013 08:54, Dirk Müller a écrit :
Hi Guillaume,
That sounds all too familiar to me...
when I build locally JeOS-raspberrypi image, I get a *.raw image but it seems that partitioning is a bit strange. We have the 2 partitions: * 1st: FAT32 for Pi bootloader (mandatory unfortunately) with bootflag enabled * 2nd: EXT4 for rootfs can you paste output of fdisk partition listing "l" in expert mode ?
It is 'p', not 'l', but here it is: ******************************************************************************** Expert command (m for help): p Disk /dev/sdb: 122 heads, 62 sectors, 1020 cylinders Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID 1 80 32 33 0 159 14 25 2048 409608 0c 2 00 159 15 25 34 46 116 411656 1454072 83 3 00 0 0 0 0 0 0 0 0 00 4 00 0 0 0 0 0 0 0 0 00 ********************************************************************************
But when I want to boot on it, it just does not boot at all, whereas it is readable from my desktop openSUSE.
The thing is fdisk reports some problems with "v" command to verify partitions: Partition 1: head 160 greater than maximum 124 Ok, so the C/H/S geometry is wrong. One neat detail that we learned the hard way is that the C/H/S geometry really does matter for the actual device. kiwi is more optimized for the x86 world where almost everything uses plain LBA for accessing the devices and proper C/H/S mapping is not relevant anymore. its usage of gparted is a great part of that problem, as gparted is notoriously bad at keeping C/H/S mapping intact.
The way most devices determine the correct H/S layout is by looking at the partition end of the 1st partition. The values in there are taken as number of Heads and Cyclinders, and that layout is then used later for determining where partitions are bound to start (the rule is that they have to start on a cylinder/head boundary if I remember correctly).
We had this problem already several times before, and I thought we catched all wrong calculations in kiwi already (kiwi for some reason does those calculations manually), but it seems we missed the case for FAT32. The strategic "remove one sector from the partition length" is the fix we did also for all the other code paths, so the remaining work is to find where the duplicated code for creating the FAT32 partition lives in kiwi and patch that one as well.
Thanks for information. Guillaume
Greetings, Dirk
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (3)
-
Dirk Müller
-
Guillaume Gardet
-
Marcus Schäfer