Debian Bug report logs - #516347
debian-installer: guided-with-lvm no longer allows multiple primary partition

version graph

Package: partman-auto; Maintainer for partman-auto is Debian Install System Team <debian-boot@lists.debian.org>; Source for partman-auto is src:partman-auto.

Reported by: Andreas Unterkircher <unki@netshadow.at>

Date: Fri, 20 Feb 2009 19:00:07 UTC

Severity: normal

Fixed in version partman-auto/87

Done: Colin Watson <cjwatson@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package debian-installer. (Fri, 20 Feb 2009 19:00:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Unterkircher <unki@netshadow.at>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Fri, 20 Feb 2009 19:00:10 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Andreas Unterkircher <unki@netshadow.at>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: debian-installer: guided-with-lvm no longer allows multiple primary partition
Date: Fri, 20 Feb 2009 19:58:41 +0100
Package: debian-installer
Version: 20090123
Severity: normal

With etch's debian-installer we used the preseed lines below to
automatically setup our partitions. /boot and / as primary
partitions, all others as logical volumes.

d-i partman-auto/init_automatically_partition \
   select Guided - use entire disk and set up LVM

d-i partman-auto/expert_recipe string                         \
      boot-root-lvm ::                                        \
              100 512 200 ext2                                \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext2 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              1000 512 1000 xfs                               \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ / }                         \
              .                                               \
              512 512 200% linux-swap                         \
                      $lvmok{ }                               \
                      method{ swap } format{ }                \
              .                                               \
              3000 512 4000 xfs                               \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /usr }                      \
              .                                               \
              2000 512 3000 xfs                               \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /var }                      \
              .                                               \
              100 384 200 xfs                                 \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /var/tmp }                  \
              .                                               \
              512 384 2000 xfs                                \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /tmp }                      \
              .                                               \
              200 256 1000 xfs                                \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /home }                     \
              .                                               \
              200 256 1000 xfs                                \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /srv }                      \
              .                                               \
              10 128 1000000000 xfs                           \
                      $lvmok{ }                               \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ xfs }     \
                      mountpoint{ /tobedeleted }              \
              .



Now with d-i from lenny, it refuses to accept our receipe by
complaining: Can't have a partition outside the disk!

In /var/log/partman I can find:

parted_server: add_primary_partition(disk(67108864),2345490-67109161)
parted_server: OUT: Error
parted_server: OUT: Can't have a partition outside the disk!
parted_server: OUT:
parted_server: OUT: Cancel
parted_server: OUT:
/bin/autopartition-lvm: error_handler: exception with type Error
...

The exact same receipe on the same machine with the etch installer
works fine. So I'm not sure if this is now the indeed behavior of
guided-with-lvm (compared to etch) or just some regression.

Andreas

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information




Bug reassigned from package `debian-installer' to `partman-auto-lvm'. Request was from Christian Perrier <bubulle@debian.org> to control@bugs.debian.org. (Sun, 22 Feb 2009 06:48:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Tue, 24 Feb 2009 17:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Walter <simswalter@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 24 Feb 2009 17:33:02 GMT) Full text and rfc822 format available.

Message #12 received at 516347@bugs.debian.org (full text, mbox):

From: Simon Walter <simswalter@gmail.com>
To: 516347@bugs.debian.org
Subject: debian-installer: guided-with-lvm no longer allows multiple primary partition
Date: Tue, 24 Feb 2009 18:30:27 +0100
Hello.

I'm facing the same problem while preseededing partionning recipes in
the lenny amd64 installer on a 10Gb xen virtual hard drive, but it is not lvm
specific, as it appears also in partman-auto with regular recipes.

I don't know more than you if it comes from an incorrect recipe, or some
regression from etch.

Either of the two following recipes exits with a "Can't have a partition
outside the disk!"/"This probably happened because there are too many
(primary) partitions in the partition table." error message.



Recipe 1 fails : /boot + lvm root partition :
d-i     partman-auto/method     string lvm
d-i  partman-auto/expert_recipe  string custom  :: \
        96 128 128 ext3 $primary{ } $bootable { } \
    method{ format } format{ } use_filesystem{ } \
    filesystem{ ext3 } options/nodev{ nodev } mountpoint{ /boot } \
        . \
        100 1000 -1 ext3 $lvmok{ } method{ format } format{ } \
    use_filesystem{ } filesystem{ ext3 } mountpoint{ / } .
/var/log/partman :
parted_server: Opening infifo
/bin/autopartition-lvm: IN: NEW_PARTITION =dev=hda primary ext3
131604480-10939622399 beginning 10819000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext3
parted_server: add_primary_partition(disk(21381120),257040-21387899)
parted_server: OUT: Error


parted_server: OUT: Can't have a partition outside the disk!



Recipe 2 fails : /boot + regular primary root partition :
d-i     partman-auto/method     string regular
d-i  partman-auto/expert_recipe  string custom  :: \
        96 128 128 ext3 $primary{ } $bootable { } \
    method{ format } format{ } use_filesystem{ } \
    filesystem{ ext3 } options/nodev{ nodev } mountpoint{ /boot } \
        . \
        100 1000 -1 ext3 $primary{ } method{ format } format{ } \
    use_filesystem{ } filesystem{ ext3 } mountpoint{ / } .
/var/log/partman :
parted_server: Opening infifo
/bin/perform_recipe: IN: NEW_PARTITION =dev=hda primary ext3
131604480-10939622399 beginning 10819000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext3
parted_server: add_primary_partition(disk(21381120),257040-21387899)
parted_server: OUT: Error


parted_server: OUT: Can't have a partition outside the disk!

In either case, parted_server is asked to create a primary partition
which goes beyond the disk end :
10819000001 (size) + 131604480 (beginning) = 10950604481
Traces in partman-auto and partman-auto-lvm shell scripts  shows that
the disk size is correctly :
+ disksize=10947133440
I still got to track back how this improper size value is computed.

Changing recipe 2 to have a logical root partition leads to a
successfull partitionning :
d-i     partman-auto/method     string regular
d-i  partman-auto/expert_recipe  string custom  :: \
        96 128 128 ext3 $primary{ } $bootable { } \
    method{ format } format{ } use_filesystem{ } \
    filesystem{ ext3 } options/nodev{ nodev } mountpoint{ /boot } \
        . \
        100 1000 -1 ext3 method{ format } format{ } \
    use_filesystem{ } filesystem{ ext3 } mountpoint{ / } .

parted_server: Opening infifo
/bin/perform_recipe: IN: NEW_PARTITION =dev=hda logical ext3
131604480-10939622399 full 10819000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type logical
parted_server: requested partition with file system ext3
parted_server: OUT: OK

As the position is "full" instead of "beginning", the given size is
ignored, and the partitionning succeed :
# fdisk -l /dev/hda

Disk /dev/hda: 10.9 GB, 10947133440 bytes
255 heads, 63 sectors/track, 1330 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c38bd

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          16      128488+  83  Linux
/dev/hda2              17        1330    10554705    5  Extended
/dev/hda5              17        1330    10554673+  83  Linux


Regards.

-- 
Simon Walter




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Tue, 03 Mar 2009 23:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Walter <simswalter@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 03 Mar 2009 23:00:05 GMT) Full text and rfc822 format available.

Message #17 received at 516347@bugs.debian.org (full text, mbox):

From: Simon Walter <simswalter@gmail.com>
To: 516347@bugs.debian.org
Subject: debian-installer: guided-with-lvm no longer allows multiple primary partition
Date: Tue, 3 Mar 2009 23:57:11 +0100
Hi,

Looking closer at partman logs, I now doubt that this is a
partman-auto-lvm specific issue.


The disk size as seen by the installer is 10947133440 bytes

The initial preseeded recipe is :
96 128 128 ext3 $primary{ } $bootable { } method{ format } \
                        format{ } use_filesystem{ } filesystem{ ext3 }
mountpoint{ /boot } . \
100 1000 -1 ext3 $lvmok{ } method{ format } format{ } \
                         use_filesystem{ } filesystem{ ext3 } mountpoint{ / }

Which is transformed by expand_recipe into the following actual scheme
for creating the primary partitions :
128 0 128 ext3 $primary{ } $bootable { } method{ format } \
                         format{ } use_filesystem{ } filesystem{ ext3
} mountpoint{ /boot } . \
10819 96 -1 ext3 $primary{ } method{ lvm }

This scheme should fit on the disk (10819+128=10947 MiB)

But the partman log extract at the end of this post shows that :
1)  when parted_server is asked to create a 128 MiB partition at the
beginning of the disk,
It creates a 131.6 MiB (131604480 bytes) partition beginning at
position 32256, and ending at 131604479.
2) parted_server is then asked to create a 10819 MiB primary partition
to hold the physical volume,
but starting at position 131604480, it can find enough space on the
disk and fails :

How can the gap between what is asked and what is performed by
parted_server be explained ?
- 131572224 B doesn't equal 128 MB, so an International System Units
vs binary Units mismatch doesn't seem to be involved.
- the disk size seems not to be involved either, as having tried a lvm
preseeded recipe on a 70 GB physical hard drive have given the same
result (will try tomorrow with bigger disks)
- is some overhead missing in the partition size calculation by expand_recipe ?
- should the scheme be recomputed with feedback from the parted_server
before creating following partitions ?


On Etch, the same recipe works because the default behavior is to
create the physical volume in a logical partition, using the entire
free space (position parameter set to "full").

Any thoughts/questions on the subject are welcome :
- directions to look further
- examples of lvm preseed recipe working with the lenny installer
- requests for precision or execution traces

Regards.

Simon Walter.


Partman log extract :

parted_server: main_loop: iteration 30
parted_server: Opening infifo
/bin/autopartition-lvm: IN: NEW_PARTITION =dev=hda primary ext3
0-10947133439 beginning 128000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext3
parted_server: add_primary_partition(disk(21381120),0-250000)
parted_server: OUT: OK


parted_server: OUT: 1   32256-131604479 131572224       primary ext3
 /dev/hda1


parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 31
parted_server: Opening infifo
/bin/autopartition-lvm: IN: PARTITIONS =dev=hda
parted_server: Read command: PARTITIONS
parted_server: command_partitions()
parted_server: Opening outfifo
parted_server: OUT: OK


parted_server: OUT: 1   32256-131604479 131572224       primary ext3
 /dev/hda1


parted_server: OUT: -1  131604480-10939622399   10808017920
pri/log free    /dev/hda-1


parted_server: Partitions printed
parted_server: OUT:


parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 32
parted_server: Opening infifo
/bin/autopartition-lvm: IN: PARTITION_INFO =dev=hda 131604480-10939622399
parted_server: Read command: PARTITION_INFO
parted_server: command_partition_info()
parted_server: Opening outfifo
parted_server: command_partition_info: info for partition with id
131604480-10939622399
parted_server: partition_with_id(131604480-10939622399)
parted_server: OUT: OK


parted_server: command_partition_info: partition found
parted_server: OUT: -1  131604480-10939622399   10808017920
pri/log free    /dev/hda-1


parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 33
parted_server: Opening infifo
/bin/autopartition-lvm: IN: NEW_PARTITION =dev=hda primary ext3
131604480-10939622399 beginning 10819000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext3
parted_server: add_primary_partition(disk(21381120),257040-21387899)
parted_server: OUT: Error


parted_server: OUT: Can't have a partition outside the disk!


parted_server: OUT:


parted_server: OUT: Cancel


parted_server: OUT:


open_dialog NEW_PARTITION primary ext3 0-10947133439 beginning 128000001
parted_server: OUT: 1   32256-131604479 131572224       primary ext3
 /dev/hda1
/bin/autopartition-lvm: IN: NEW_PARTITION =dev=hda primary ext3
131604480-10939622399 beginning 10819000001
parted_server: OUT: Error


parted_server: OUT: Can't have a partition outside the disk!


-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.18-6-xen-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Mon, 30 Mar 2009 15:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Oded Naveh" <skilinux@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Mon, 30 Mar 2009 15:15:02 GMT) Full text and rfc822 format available.

Message #22 received at 516347@bugs.debian.org (full text, mbox):

From: "Oded Naveh" <skilinux@gmail.com>
To: <516347@bugs.debian.org>
Subject: debian-installer: guided-with-lvm no longer allows ? primary partition.
Date: Mon, 30 Mar 2009 18:11:20 +0300
Similar behavior observed with recipes defining only one primary partition (/boot).
The effect of the bug was dependent on the size of that partition.

If changing the partition size (try 200 200 200) allows partitioning, then we're talking the same bug.
Try a few more sizes as I suspect it also depends on the drive parameters (e.g. size and CHS).

Examples for recipes can be found in:
http://svn.debian.org/wsvn/debian-edu/trunk/src/debian-edu-install/lib/partman/recipes/?rev=57324
90 and 94 don't work, the others work o.k.





Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Tue, 16 Jun 2009 21:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Anthony L. Awtrey" <tony@awtrey.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 16 Jun 2009 21:33:02 GMT) Full text and rfc822 format available.

Message #27 received at 516347@bugs.debian.org (full text, mbox):

From: "Anthony L. Awtrey" <tony@awtrey.com>
To: 516347@bugs.debian.org
Subject: Re: debian-installer: guided-with-lvm no longer allows multiple primary partition
Date: Tue, 16 Jun 2009 17:15:46 -0400
[Message part 1 (text/plain, inline)]
Yup, this is biting me too... Sorry for the long stream-of-conscious 
report here, but I wrote as I worked through this issue and it shows. ;) 
I don't know what someone may find important or not.

It's an odd bug though. When I create a small /boot partition as the 
first item in the recipe, it rolls right along.

d-i partman-auto/expert_recipe string mydisk :: \
    64 300 300 ext3                             \
      $primary{ } $bootable{ }                  \
      method{ format } format{ }                \
      use_filesystem{ } filesystem{ ext3 }      \
      options/noatime{ noatime }                \
      label{ boot }                             \
      mountpoint{ /boot }                       \
    .                                           \
    10000 10000 70000 ext3                      \
      $lvmok{ }                                 \
      method{ format } format{ }                \
      use_filesystem{ } filesystem{ ext3 }      \
      options/noatime{ noatime }                \
      mountpoint{ / }                           \
    .                                           \
    512 1024 300% linux-swap                    \
      $lvmok{ }                                 \
      method{ swap } format{ }                  \
    .                                           \
    500 10000 1000000000 ext3                   \
      $lvmok{ }                                 \
      method{ format } format{ }                \
      use_filesystem{ } filesystem{ ext3 }      \
      options/noatime{ noatime }                \
      mountpoint{ /home }                       \
    .

But if I remove the small boot partition and move root to the first 
primary partition it fails.

d-i partman-auto/expert_recipe string mydisk :: \
    10000 10000 70000 ext3                      \
      $primary{ } $bootable{ }                  \
      method{ format } format{ }                \
      use_filesystem{ } filesystem{ ext3 }      \
      options/noatime{ noatime }                \
      mountpoint{ / }                           \
    .                                           \
    512 1024 300% linux-swap                    \
      $lvmok{ }                                 \
      method{ swap } format{ }                  \
    .                                           \
    500 10000 1000000000 ext3                   \
      $lvmok{ }                                 \
      method{ format } format{ }                \
      use_filesystem{ } filesystem{ ext3 }      \
      options/noatime{ noatime }                \
      mountpoint{ /home }                       \
    .

The failure from the partman logs:

/bin/autopartition-lvm: IN:
/bin/autopartition-lvm: IN: boot
parted_server: Processing flag boot
parted_server: The flag set true.
/bin/autopartition-lvm: IN: NO_MORE
parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 40
parted_server: Opening infifo
/bin/autopartition-lvm: IN: NEW_PARTITION =dev=hda primary ext3 
10001940480-60011642879 beginning 50011000001
parted_server: Read command: NEW_PARTITION
parted_server: command_new_partition()
parted_server: Note =dev=hda as changed
parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext3
parted_server: add_primary_partition(disk(117210240),19535040-117212774)
parted_server: OUT: Error


Obviously a disk with 117210240 sectors isn't going to allow a partition 
 ending at sector 117212774. I've been tracing through the code to try 
and determine where the sectors and sizes are calculated with limited 
success. The modular partman-* package structure makes it somewhat 
difficult to track down.


Well, in some cases it looks like the autopartition-lvm is passing 
around incorrect values for partition sizes and offsets. For example, my 
failure case passes the following parameters to parted-server's 
command_new_partition() function.

/home parameters:
type    fs_type range_start-range_end   position  length
primary ext3    10001940480-60011642879 beginning 50011000001

Note that since this partition is being calculated from the beginning, 
the range_end is really just the end of the disk. If you add 10001940480 
(range_start) + 50011000001 (length) you get 60012940481 bytes which is 
larger than the total size of the disk of 60011642879 bytes.

Note how parted_server.c converts the sizes to disk sectors in the logs:

part_start = 19535040
part_end   = 117212774 <--- more sectors than the disk has

The formula used in parted_server.c for calculating the part_end value is:

1824: part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
1825: part_end = (range_start + length) / PED_SECTOR_SIZE_DEFAULT;

So if there is a bounds check just after this code to keep the part_end 
value at less than the range_end it should work (see attached patch).

I'll dig some more in the partman-auto-lvm package and see if the 
calculations are borked there. Based upon the other bug reports claiming 
this is not an lvm specific issue, I bet the size/offset calculations 
are being done in some shared resource.

Does anyone know how to force the debian installer to use an unsigned 
udeb source? I have a local debian mirror for netboot installs, but 
since deb started using signed installer packages I've found it 
difficult to replace or override the default installer udebs.

Tony
[parted_server.c.diff (text/plain, inline)]
--- parted_server.c.orig        2009-06-17 17:08:04.000000000 +0000
+++ parted_server.c     2009-06-17 16:34:12.000000000 +0000
@@ -1823,6 +1823,10 @@
         } else if (!strcasecmp(position, "beginning")) {
                 part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
                 part_end = (range_start + length) / PED_SECTOR_SIZE_DEFAULT;
+                // Truncate the partition end to fit the maximum disk size
+                if ( part_end > ( range_end / PED_SECTOR_SIZE_DEFAULT ) ) {
+                  part_end = ( range_end / PED_SECTOR_SIZE_DEFAULT );
+                }
         } else if (!strcasecmp(position, "end")) {
                 part_start = (range_end - length) / PED_SECTOR_SIZE_DEFAULT;
                 part_end = ((range_end - PED_SECTOR_SIZE_DEFAULT + 1)

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Wed, 17 Jun 2009 22:30:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Julio C. Ortega" <jortega@onuva.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Jun 2009 22:30:10 GMT) Full text and rfc822 format available.

Message #32 received at 516347@bugs.debian.org (full text, mbox):

From: "Julio C. Ortega" <jortega@onuva.com>
To: 516347@bugs.debian.org
Subject: debian-installer: guided-with-lvm no longer allows multiple primary partition
Date: Wed, 17 Jun 2009 17:53:31 -0430
[Message part 1 (text/plain, inline)]
> Yup, this is biting me too... Sorry for the long stream-of-conscious 
> report here, but I wrote as I worked through this issue and it shows. ;) 
> I don't know what someone may find important or not.
> 
> It's an odd bug though. When I create a small /boot partition as the 
> first item in the recipe, it rolls right along.
> [.....] 
> 
> part_start = 19535040
> part_end   = 117212774 <--- more sectors than the disk has
> 
> The formula used in parted_server.c for calculating the part_end value is:
> 
> 1824: part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
> 1825: part_end = (range_start + length) / PED_SECTOR_SIZE_DEFAULT;
> 
> So if there is a bounds check just after this code to keep the part_end 
> value at less than the range_end it should work (see attached patch).
> 
> I'll dig some more in the partman-auto-lvm package and see if the 
> calculations are borked there. Based upon the other bug reports claiming 
> this is not an lvm specific issue, I bet the size/offset calculations 
> are being done in some shared resource.
> 
> Does anyone know how to force the debian installer to use an unsigned 
> udeb source? I have a local debian mirror for netboot installs, but 
> since deb started using signed installer packages I've found it 
> difficult to replace or override the default installer udebs.
> 
> Tony
> 
> [parted_server.c.diff (text/plain, inline)]
> 
> --- parted_server.c.orig        2009-06-17 17:08:04.000000000 +0000
> +++ parted_server.c     2009-06-17 16:34:12.000000000 +0000
> @@ -1823,6 +1823,10 @@
>          } else if (!strcasecmp(position, "beginning")) {
>                  part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
>                  part_end = (range_start + length) / PED_SECTOR_SIZE_DEFAULT;
> +                // Truncate the partition end to fit the maximum disk size
> +                if ( part_end > ( range_end / PED_SECTOR_SIZE_DEFAULT ) ) {
> +                  part_end = ( range_end / PED_SECTOR_SIZE_DEFAULT );
> +                }
>          } else if (!strcasecmp(position, "end")) {
>                  part_start = (range_end - length) / PED_SECTOR_SIZE_DEFAULT;
>                  part_end = ((range_end - PED_SECTOR_SIZE_DEFAULT + 1)

Greetings all.

I've hit this bug also.

I've also tried the patch from Anthony to no avail.

I've been trying to make a recipe for a PowerPC based IBM Machine.
keeping "/" from entering the LVM, because Debian (and other distros
too) have major bugs when "/" it's inside it (in this architecture). So
there's no point on making only a "/boot" partition that stays out of it.

I've made it work at last making these changes in
lib/partman/lib/auto-lvm.sh: (partman-auto-lvm UDEB)

17c17
      echo "$scheme${NL}100 1000 -1 ext3 \$primary{ } method{ $method }"
---
      echo "$scheme${NL}100 1000 -1 ext3 method{ $method }"


As we know, device mapper doesn't care if it's physical volume it's on a
primary or a logical partition. He is there only to activate it(/them).

I've also included in this test installation (made a couple of them,
successfully) a partman-base modified UDEB with anthony's patch (but, as
stated earlier, it's not making difference)

Thanks to anthony for keeping alive this bug, and for the proposed
patch, else i couldn't have solved it.

The recipe im using is below.

d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              8 1 1 prep                                      \
                      $primary{ }                             \
                      $bootable{ }                            \
                      method{ prep }                          \
              .                                               \
              8192 10000 8192 ext3                            \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext3 }    \
                      mountpoint{ / }                         \
              .                                               \
              64 512 300% linux-swap                          \
                      $lvmok{ }                               \
                      method{ swap } format{ }                \
              .                                               \
              500 10000 -1 ext3                               \
                      $lvmok{ }                               \
                      $defaultignore{ }                       \
                      method{ format } format{ }              \
		      use_filesystem{ } filesystem{ ext3 }    \
                      mountpoint{ /srv }                      \
              .


Again. Thanks, and have a nice day.

-- 
--------------------------------
Julio C. Ortega
Equipo de Infraestructura
ONUVA | Integración de Sistemas

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#516347; Package partman-auto-lvm. (Tue, 30 Jun 2009 14:21:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Anthony L. Awtrey" <tony@awtrey.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 30 Jun 2009 14:21:14 GMT) Full text and rfc822 format available.

Message #37 received at 516347@bugs.debian.org (full text, mbox):

From: "Anthony L. Awtrey" <tony@awtrey.com>
To: 516347@bugs.debian.org
Cc: 511442@bugs.debian.org
Subject: Re: debian-installer: guided-with-lvm no longer allows multiple primary, partition
Date: Tue, 30 Jun 2009 10:12:53 -0400
On  Tue, 16 Jun 2009 17:15:46 -0400, Anthony Awtrey wrote:
> Well, in some cases it looks like the autopartition-lvm is passing
> around incorrect values for partition sizes and offsets. For example,
> my failure case passes the following parameters to parted-server's
> command_new_partition() function.

Okay, looks like both 516347 and 511442 may have a common root cause

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511442

Ferenc Wagner says in bug 511442: "Then lvm_extents_from_human in 
lvm-base.sh assumes SI kilobytes [kB] to compute the number of extents 
to create the LV with, which thus gets a factor of 1024/1000 smaller 
than expected."

It appears that this new method used to determine sizes may not work in 
all cases.

I have a number of different systems that I want to use the same preseed 
partman-auto-lvm expert recipe on. The basic partition structure I want 
is a root (with the kernel boot files) on a maximum 10GB primary 
partition with the rest of the disk allocated in an LVM volume. Right 
now I only have swap and home in the lvm, but I planned on allocating 
other small volumes for special purposes.

What I have discovered is that changing the size of the primary root 
partition or adding an additional primary partition influences the way 
the LVM calculations work or fail. I have about 10 different boxes with 
different sized hard drives ranging from 40GB to 160GB. I have failed to 
come up with a single recipe that works across all the different platforms.

The errors range from "Can't have a partition outside the disk!" to 
"Unexpected error while creating volume group" and those errors change 
depending on how much space is allocated in the primary partitions. I 
can often tweak the size of the primary paritions to make one platform 
work, but then other platforms with different sized partitions will fail.

I have finally given up and gone back to using regular partitions with 
labels, but I still have a series of hardware / lvm recipe combinations 
that fail reliably and will be happy to test a fix if someone can tell 
me how to supersede the signed udeb packages with my updated and 
unsigned ones.

Tony




Bug reassigned from package `partman-auto-lvm' to `partman-auto'. Request was from Colin Watson <cjwatson@debian.org> to control@bugs.debian.org. (Tue, 14 Jul 2009 12:39:03 GMT) Full text and rfc822 format available.

Reply sent to Colin Watson <cjwatson@debian.org>:
You have taken responsibility. (Tue, 14 Jul 2009 16:09:03 GMT) Full text and rfc822 format available.

Notification sent to Andreas Unterkircher <unki@netshadow.at>:
Bug acknowledged by developer. (Tue, 14 Jul 2009 16:09:03 GMT) Full text and rfc822 format available.

Message #44 received at 516347-close@bugs.debian.org (full text, mbox):

From: Colin Watson <cjwatson@debian.org>
To: 516347-close@bugs.debian.org
Subject: Bug#516347: fixed in partman-auto 87
Date: Tue, 14 Jul 2009 15:33:37 +0000
Source: partman-auto
Source-Version: 87

We believe that the bug you reported is fixed in the latest version of
partman-auto, which is due to be installed in the Debian FTP archive:

partman-auto_87.dsc
  to pool/main/p/partman-auto/partman-auto_87.dsc
partman-auto_87.tar.gz
  to pool/main/p/partman-auto/partman-auto_87.tar.gz
partman-auto_87_i386.udeb
  to pool/main/p/partman-auto/partman-auto_87_i386.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 516347@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated partman-auto package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 14 Jul 2009 14:35:51 +0100
Source: partman-auto
Binary: partman-auto
Architecture: source i386
Version: 87
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Description: 
 partman-auto - Automatically partition storage devices (partman) (udeb)
Closes: 516347
Changes: 
 partman-auto (87) unstable; urgency=low
 .
   * Add support for writing sizes as a number plus a percentage of RAM, e.g.
     "2000+50%". This is useful when doing automatic partitioning with the
     expectation of creating swap files.
   * If we're creating primary partitions and find that we've reached the end
     of the recipe, use "full" rather than "beginning" as the place passed to
     NEW_PARTITION, thereby avoiding rounding problems and matching the
     process for creating logical partitions (closes: #516347, LP: #287571).
 .
   [ Updated translations ]
   * Hindi (hi.po)
Checksums-Sha1: 
 3a464bf658210163142c99aafbe75b2719b3865b 938 partman-auto_87.dsc
 e5fa8142d137ff1ef946f17fda44fea165751507 107329 partman-auto_87.tar.gz
 7174e3d973b7d90a9621040d1736d8bdf0a4c8fd 75044 partman-auto_87_i386.udeb
Checksums-Sha256: 
 457cedb2e2ac7ca8af01405a6f78cc2eb418155a6acca0dc844f0a9d573cc433 938 partman-auto_87.dsc
 32b36fd5c648e0fda0a00be7f63fd750e9476e655a3168365517b3c23947cd70 107329 partman-auto_87.tar.gz
 0be76dad36a60d0a1c67ac5d26c6a1cec0189ce362de7656ced0ebd14f860536 75044 partman-auto_87_i386.udeb
Files: 
 c6df922ce4ba040dd2c31c19dde846f5 938 debian-installer standard partman-auto_87.dsc
 379b365ce5a08ad68db627a6cc7ddb26 107329 debian-installer standard partman-auto_87.tar.gz
 3dce655a85fd9e091563cff8fc4f9f45 75044 debian-installer standard partman-auto_87_i386.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Colin Watson <cjwatson@debian.org> -- Debian developer

iD8DBQFKXJBI9t0zAhD6TNERAglIAJ9Q+RW34SRvZC7nG/eBFQSJfp0XngCfRhnV
EjCSP/vGXmMjEnnjCDB2lJI=
=4ue5
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 20 Sep 2009 07:32:45 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 16:08:35 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.