Difference between revisions of "User:Arwen/repartition"

From PINE64
Jump to navigation Jump to search
(→‎Partitioning the eMMC: Added note about partitions 2, 3 & 4)
(→‎Partitioning the eMMC: Re-ordered the info into separate planning and implementation)
Line 12: Line 12:
== Using a MicroSD card ==
== Using a MicroSD card ==
This example shows using a SD card as temporary boot location.
This example shows using a SD card as temporary boot location.
== Planning a partition table ==
Planning a partition table is sometimes preferred than simply making it work. If you make a mistake, you may have to live with it for a while til you can re-partition your disk.
* '''Low level boot:''' The boot loader U-Boot and ARM64 support information must be installed as specified. These are partitions 2, 3 and 4 in the example below. You can then access the U-Boot or ARM Trusted Firmare code easier than having to remember beginning of disk off-sets. If you would prefer, you can leave these off. But, make absolutely sure you start at block 32768 or later for any other partitions.
* '''Boot partition:''' The example below shows a 256MB <code>/boot</code> partition, which maybe desirable for Initial RAM disks. The default OS, Debian, that came with the Pinebook Pro uses only a 64MB partition. After various updates on the default Debian OS, a Pinebook Pro uses 50MB, which is 77% full. No real room for Initial RAM disks. Note that the current boot loader requires that the <code>/boot</code> be partition 1. This puts it out of order if you use dedicated '''Low level boot''' partitions, but is otherwise harmless.
* '''Swap:''' Some prefer a swap partition to a swap file. This documentation shows an equal sized swap partition as the memory, (4GB). You can use smaller, though larger does not really get you anything. Further, if you prefer to use a swap file, that can be left off of your partition table.
* '''Root:''' When using the default Debian OS, with some updates and minor packages added, the <code>/</code> partition used size is about 4.5GBs. In general, plan for growth to perhaps double or more. If you do not intend to experiment with other OSes on your disk, or seperate out application & potentially <code>/home</code>, your <code/</code> could be the remaining space on your disk.


== Partitioning the eMMC ==
== Partitioning the eMMC ==
As user "root", perform the following step.
As user "root", perform the following step, (or modified for your use). This will:
This will:
* Wipe the existing partition table
* Wipe the existing partition table
* Create new, empty GPT partition table
* Create new, empty GPT partition table
* Create the 3 boot support partitions
* Create the 3 boot support partitions
* Create 2 identically sized OS partitions. Change as needed.
* Create a larger <code>/boot</code> partition of 256MBs
 
* Create a dedicated swap paritition of 4GBs
Note: You can change the sizes of the user partitions, but not 2, 3 or 4. The boot loader U-Boot and ARM64 support information must be installed as specified. Thus, the reserved locations for partitions 2-4.
* Create 2 identically sized OS partitions of 27GBs each


Here is a commands to make a parition table;
Here is a commands to make that partition table;
<pre>
<pre>
# sfdisk /dev/mmcblk1 --wipe always --label GPT <<EOF
# sfdisk /dev/mmcblk1 --wipe always --label GPT <<EOF

Revision as of 21:34, 26 January 2020

Repartitioning your Pinebook Pro

There are multiple reasons to desire a different file system layout. In my case, I want to separate the OS from user data.

Make a backup

Backup your existing OS and data. Multiple times if it's important data.

Understand the risks

If you perform the steps wrong, you could end up with an un-bootable laptop. Even using a SD card may not help. If the eMMC thinks it's good enough to boot, it may not try the SD card.

Read about recovery options

Worse case, you may have to open up your Pinebook Pro and perform a boot with

Using a MicroSD card

This example shows using a SD card as temporary boot location.

Planning a partition table

Planning a partition table is sometimes preferred than simply making it work. If you make a mistake, you may have to live with it for a while til you can re-partition your disk.

  • Low level boot: The boot loader U-Boot and ARM64 support information must be installed as specified. These are partitions 2, 3 and 4 in the example below. You can then access the U-Boot or ARM Trusted Firmare code easier than having to remember beginning of disk off-sets. If you would prefer, you can leave these off. But, make absolutely sure you start at block 32768 or later for any other partitions.
  • Boot partition: The example below shows a 256MB /boot partition, which maybe desirable for Initial RAM disks. The default OS, Debian, that came with the Pinebook Pro uses only a 64MB partition. After various updates on the default Debian OS, a Pinebook Pro uses 50MB, which is 77% full. No real room for Initial RAM disks. Note that the current boot loader requires that the /boot be partition 1. This puts it out of order if you use dedicated Low level boot partitions, but is otherwise harmless.
  • Swap: Some prefer a swap partition to a swap file. This documentation shows an equal sized swap partition as the memory, (4GB). You can use smaller, though larger does not really get you anything. Further, if you prefer to use a swap file, that can be left off of your partition table.
  • Root: When using the default Debian OS, with some updates and minor packages added, the / partition used size is about 4.5GBs. In general, plan for growth to perhaps double or more. If you do not intend to experiment with other OSes on your disk, or seperate out application & potentially /home, your <code/ could be the remaining space on your disk.

Partitioning the eMMC

As user "root", perform the following step, (or modified for your use). This will:

  • Wipe the existing partition table
  • Create new, empty GPT partition table
  • Create the 3 boot support partitions
  • Create a larger /boot partition of 256MBs
  • Create a dedicated swap paritition of 4GBs
  • Create 2 identically sized OS partitions of 27GBs each

Here is a commands to make that partition table;

# sfdisk /dev/mmcblk1 --wipe always --label GPT <<EOF
unit: sectors
first-lba: 64
/dev/mmcblk1p2 : start=       64, size=    16320, type=8DA63339-0007-60C0-C436-083AC8230908, uuid=1B5A4130-0958-455D-B9AB-C1F2E232FFF8, name="IDBLoader",         attrs="RequiredPartition"
/dev/mmcblk1p3 : start=    16384, size=     8192, type=8DA63339-0007-60C0-C436-083AC8230908, uuid=D0972B65-4091-4E34-9A4C-8BD949C35E16, name="U-Boot",            attrs="RequiredPartition"
/dev/mmcblk1p4 : start=    24576, size=     8192, type=8DA63339-0007-60C0-C436-083AC8230908, uuid=6C5329F3-9A03-4664-A15C-44E869EDE05C, name="TrustedFirmware-A", attrs="RequiredPartition"
/dev/mmcblk1p1 : start=    32768, size=   524288, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=3956C6AC-1AC8-4E45-A2A5-FD3CCA60D0CD, name="Linux-boot"
/dev/mmcblk1p5 : start=   557056, size=  8388608, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=C1565C17-D5C2-410C-892E-7371CB22947D, name="Linux-swap"
/dev/mmcblk1p6 : start=  8945664, size= 56598481, type=B921B045-1DF0-41C3-AF44-4C6F280D3FAE, uuid=E55D2252-DAC4-4EEB-AD41-D47F52B9889F, name="Linux-root"
/dev/mmcblk1p7 : start= 65544192, size= 56598481, type=B921B045-1DF0-41C3-AF44-4C6F280D3FAE, uuid=FB2E55D1-EA3B-418F-BB54-B9E92DF813F7, name="Linux-root-alternate"
EOF