[Maas-devel] curtin custom partitions

Kyle O'Donnell kyleo at 0b10.mx
Sat Aug 9 02:04:29 UTC 2014


first off Newell thanks so much for your help on this!

ok here is were I ended up...

updated to the newest version of curtin

changed block-meta.py to support x86_64 for the newly added /boot

updated /etc/maas/preseeds/curtin_userdata though I dont think this actually did anything:

paritioning_commands:
  10_wipepart: ['curtin wipe', '--quick', '--all-unused-disks']
  20_makepart: ['curtin', 'block-meta', 'simple-boot']

changed curtin/helpers/common to hardcode the desired partition sizes

I also added some force clear/create partition tables for good measure in the pt_gpt function:

    sgdisk -Z "$target" # this kills everything
    sgdisk -og "$target" # this recreates the gpt
    sgdisk -p "$target" # this prints the table

i tried (unsuccessfully) to create a 50G partition via:

        sgdisk --new "15:2048:+1M" --typecode=15:ef02 \
            --new "1:4096:2097152" --typecode=1:8300 \
            --new "2::104960000" --typecode=2:8300 "$target" ||
            { error "failed to gpt partition $target"; return 1; }

        sgdisk --new "15:2048:+1M" --typecode=15:ef02 \
            --new "1:4096:+1G" --typecode=1:8300 \
            --new "2::+50G" --typecode=2:8300 "$target" ||
            { error "failed to gpt partition $target"; return 1; }

        sgdisk --new "15:2048:+1M" --typecode=15:ef02 \
            --new "1:4096:+1G" --typecode=1:8300 \
            --new "2::50G" --typecode=2:8300 "$target" ||
            { error "failed to gpt partition $target"; return 1; }

All of the above resulted in a /dev/sda2 that was the full size of the remaining disk
checkout the debug output...

Number  Start (sector)    End (sector)  Size       Code  Name
   1            4096         2097152   1022.0 MiB  8300  
   2         2099200       104960000   49.0 GiB    8300  
  15            2048            4095   1024.0 KiB  EF02  

+ sgdisk -v /dev/sda

No problems found. 5750030267 free sectors (2.7 TiB) available in 3
segments, the largest of which is 5750026206 (2.7 TiB) in size.

Notice it says partition 2 is 49G and the output says  the largest partition is 2.7TiB WTF?!?!?!?!

Then I tried to add in a 3rd partition to see what it would do, worst case I can just delete this after the fact:

        sgdisk --new "15:2048:+1M" --typecode=15:ef02 \
            --new "1:4096:+1G" --typecode=1:8300 \
            --new "2::+50G" --typecode=2:8300 \
            --new "3::+50G" --typecode=2:8300 "$target" ||

this had the 'desired' result but i'll be removing /dev/sda3

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        50G  951M   46G   2% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             48G  4.0K   48G   1% /dev
tmpfs           9.5G  684K  9.5G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             48G     0   48G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda1       976M   42M  867M   5% /boot

# sgdisk -p /dev/sda
Disk /dev/sda: 5854986240 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 38A5CC89-2EBA-4255-A6C4-8632BB72247E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5854986206
Partitions will be aligned on 2048-sector boundaries
Total free space is 5643171773 sectors (2.6 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            4096         2101247   1024.0 MiB  8300  
   2         2101248       106958847   50.0 GiB    8300  
   3       106958848       211816447   50.0 GiB    8300  
  15            2048            4095   1024.0 KiB  EF02  



----- Original Message -----
From: "Kyle O'Donnell" <kyleo at 0b10.mx>
To: "Newell Jensen" <newell.jensen at canonical.com>
Cc: "maas-devel" <maas-devel at lists.launchpad.net>
Sent: Friday, August 8, 2014 11:45:53 AM
Subject: Re: [Maas-devel] curtin custom partitions

1.5.2 (latest distributed with 14.04)

i have filed a report thanks

https://bugs.launchpad.net/maas/+bug/1354426

----- Original Message -----
From: "Newell Jensen" <newell.jensen at canonical.com>
To: "Kyle O'Donnell" <kyleo at 0b10.mx>
Cc: "maas-devel" <maas-devel at lists.launchpad.net>
Sent: Friday, August 8, 2014 11:44:26 AM
Subject: Re: [Maas-devel] curtin custom partitions

Kyle,

See comments inline below:


On Fri, Aug 8, 2014 at 5:34 AM, Kyle O'Donnell <kyleo at 0b10.mx> wrote:

> looks like I have found a bug in the common script which creates the
> partition
>
> 1) it says the default is gpt but without any options specified it is
> executing pt_mbr)
>

In trunk, line 210 for common has the format set to "gpt" by default.  What
version of curtin do you have?


>
> 2) there are params passed to the command executed within pt_mbr,
> specifically the size of the partition, which does not work, see some debug
> output below:
>
> starting COMMON KYLE
> ending common KYLE
> I AM EXECUTING pt_mbr
> 1 disk is larger than max for mbr (2TB)
> target /dev/sda size 2997752954880 end  maxend  pt1size 107372134
> 1 sfdisking with: echo '2048,107374182,L,*' | sfdisk --no-reread --force
> --Linux --unit S /dev/sda
>
> i over changed the value of pt1size to the desired size, and the command
> which is executed confirms that the command is passed that value.  the
> problem is sfdisk seems to ignore this and still create the

partition of the max size based n the 2TB limit.
>

You should file a bug report for this.

>
>
>
>
>
> ----- Original Message -----
> From: "Newell Jensen" <newell.jensen at canonical.com>
> To: "Kyle O'Donnell" <kyleo at 0b10.mx>
> Cc: "maas-devel" <maas-devel at lists.launchpad.net>
> Sent: Thursday, August 7, 2014 8:48:04 PM
> Subject: Re: [Maas-devel] curtin custom partitions
>
> Kyle,
>
> Looks like me email updated me with your new email after I sent
> mine...weird.
>
> In any event, the default partition function that is called in that shell
> script is pt_gpt, not pt_mbr.  The reason there is a cap on pt_mbr is due
> to the size limitation that MBR has:
>
> "The organization of the partition table in the MBR limits the maximum
> addressable storage space of a disk to 2 TB
> <http://en.wikipedia.org/wiki/Tebibyte> (232 × 512 bytes)."
>
>
>
>
>
> On Thu, Aug 7, 2014 at 5:34 PM, Kyle O'Donnell <kyleo at 0b10.mx> wrote:
>
> > I *think* I found it:
> >
> > /usr/lib/curtin/helpers/common
> >
> > specifically the pt_mbr function:
> >
> >     local start="2048" pt1size="" maxsize="4294967296"
> >
> > Which corresponds to the partition it creates:
> > /dev/sda1   *        2048  4294967295  2147482624   83  Linux
> >
> >
> > ----- Original Message -----
> > From: "Kyle O'Donnell" <kyleo at 0b10.mx>
> > To: "Newell Jensen" <newell.jensen at canonical.com>
> > Cc: "maas-devel" <maas-devel at lists.launchpad.net>
> > Sent: Thursday, August 7, 2014 7:22:02 PM
> > Subject: Re: [Maas-devel] curtin custom partitions
> >
> >
> >
> > How does it determine its going to create a single 2TB root filesystem?
> > What code can i change to do this?
> > On Aug 7, 2014 7:17 PM, Newell Jensen <newell.jensen at canonical.com>
> wrote:
> >
> > Kyle,
> >
> > Currently there is no support for creating a custom partition table using
> > the fastpath installer. This would be a nice feature.
> >
> > Newell
> >
> >
> > On Thu, Aug 7, 2014 at 1:35 PM, Kyle O'Donnell < kyleo at 0b10.mx > wrote:
> >
> >
> > Hi,
> >
> > I am trying to figure out how to create a custom partition table using
> the
> > fastpath installer. Has anyone done this before?
> >
> > I have ~2.7TB of usable drive space, the default install creates one 2TB
> > partition of root and nothing else. I'd like to be able to configure lvm,
> > but I would settle for being able to set the root partition size.
> >
> > Thanks,
> > Kyle
> >
> > --
> > Mailing list: https://launchpad.net/~maas-devel
> > Post to : maas-devel at lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~maas-devel
> > More help : https://help.launchpad.net/ListHelp
> >
> >
> > --
> > Mailing list: https://launchpad.net/~maas-devel
> > Post to     : maas-devel at lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~maas-devel
> > More help   : https://help.launchpad.net/ListHelp
> >
>

-- 
Mailing list: https://launchpad.net/~maas-devel
Post to     : maas-devel at lists.launchpad.net
Unsubscribe : https://launchpad.net/~maas-devel
More help   : https://help.launchpad.net/ListHelp




More information about the Maas-devel mailing list