partition layouts and configuration

Alexander Sack asac at canonical.com
Mon Dec 15 23:12:14 UTC 2014


On Mon, Dec 15, 2014 at 2:45 PM, Jimmy Tang <jcftang at gmail.com> wrote:
> Hi All
>
> I'm trying to grasp the filesystem and partition layouts as described here
> http://developer.ubuntu.com/snappy/filesystem-layout/
>
> How ever I wish to try and build an image for an arm based system (Novena),
> the usual layout for the novena boards that I have (like all the imx6i based
> systems) require that the first partition is reserved and formatted as a
> fat32 partition for loading up the kernel.
>
> I couldn't find any information on how to shift the partition layout by one.
> This is my desired layout
>
> - bootloader - /dev/sda1 - 512mb - fat32 partition
> - system-a - /dev/sda2 - 2gb - ext 2/3/4 primary root filesystem
> - system-b - /dev/sda3 - 2gb - ext 2/3/4 secondary root filesystem
> - writable - /dev/sda4 - rest of the disk - ext 2/3/4 persistent user data
>
> How does one configure core/snappy to alternate between sda2 and sda3 when
> updates/reboots occur?

Maybe its buggy, but in theory we are looking for partition label and
not hard coded device paths. Setting those for your partitions
accordingly might give what you want.

In /usr/lib/python3/dist-packages/ubuntucoreupgrader/parser.py we have:

  WRITABLE_DATA_LABEL = 'writable'

  SYSTEM_DATA_A_LABEL = 'system-a'

  SYSTEM_DATA_B_LABEL = 'system-b'

... and then ...

def get_root_partitions_by_label():
    '''
    Returns a list of tuples of the recognised root filesystem partitions
    available on this system. The tuples contain the following triplet:

        ( <partition-name>, <full-device-path>, <mountpoint> )

    '''
    cmd = 'lsblk'
    recognised = (SYSTEM_DATA_A_LABEL, SYSTEM_DATA_B_LABEL)
...


I assume you have tried this?

 -  Alexander



More information about the snappy-devel mailing list