|
|
Line 443: |
Line 443: |
|
| |
|
| <syntaxhighlight lang="bash">nixos-rebuild switch --fast --option binary-caches http://nixos-arm.dezgeg.me/channel --option binary-cache-public-keys nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%</syntaxhighlight> | | <syntaxhighlight lang="bash">nixos-rebuild switch --fast --option binary-caches http://nixos-arm.dezgeg.me/channel --option binary-cache-public-keys nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%</syntaxhighlight> |
|
| |
| === Resizing the boot partition ===
| |
| {{note|Since 19.09, those instructions serve no purpose as the first partition only holds the raspberry pi firmware files, not the <tt>/boot</tt> partition.}}
| |
|
| |
| {{warning|Platforms needing a secondary boot loader before the boot partition, (when using <code>dd</code> to add u-boot, MLO or SPL) will need to take in consideration where the original <code>/boot</code> partition starts.}}
| |
|
| |
| It is possible that you run out of disk space on the boot partition after some system upgrades.
| |
| To resize the boot partition:
| |
| * (If not already done, boot once to trigger the initial partition resizing)
| |
| * Backup the files currently stored in the boot partition
| |
| * Repartition and make sure to delete and then recreate the boot partition (fat32, primary, label: <code>NIXOS_BOOT</code>)
| |
| * Copy the files from the backup back to the new boot partition
| |
|
| |
| === Disable use of <tt>/boot</tt> partition ===
| |
| {{note|Since 19.09, those instructions serve no purpose as <tt>/boot</tt> is already on the main partition.}}
| |
|
| |
| The <tt>/boot</tt> partition is quite small on the NixOS on ARM images. This means that few generations can be kept, and <code>nixos-rebuild</code> can often fail due to lack of space.
| |
|
| |
| Here are quick [https://github.com/NixOS/nixpkgs/issues/22014#issuecomment-290152982 instructions to disable use of the (small) <tt>/boot</tt> partition]. The disk used in the following example is <tt>/dev/mmcblk1</tt> which may differ depending on use of SD card and the particular device.
| |
|
| |
| {{commands|<nowiki>
| |
| # umount /boot
| |
| </nowiki>}}
| |
|
| |
| Comment out the fileSystems."/boot" entry from configuration.nix
| |
|
| |
| {{commands|<nowiki>
| |
| # $EDITOR /etc/configuration.nix
| |
| </nowiki>}}
| |
|
| |
| Use fdisk or cfdisk to remove the bootable flag from the FAT32 partition, and set it for the ext4 partition
| |
|
| |
| {{commands|<nowiki>
| |
| # fdisk -l /dev/mmcblk1
| |
| Disk /dev/mmcblk1: 58.2 GiB, 62537072640 bytes, 122142720 sectors
| |
| Units: sectors of 1 * 512 = 512 bytes
| |
| Sector size (logical/physical): 512 bytes / 512 bytes
| |
| I/O size (minimum/optimal): 512 bytes / 512 bytes
| |
| Disklabel type: dos
| |
| Disk identifier: 0x2178694e
| |
|
| |
| Device Boot Start End Sectors Size Id Type
| |
| /dev/mmcblk1p1 * 16384 262143 245760 120M b W95 FAT32
| |
| /dev/mmcblk1p2 262144 122142567 121880424 58.1G 83 Linux
| |
|
| |
| # echo -e 'a\n1\na\n2\nw' | fdisk /dev/mmcblk1
| |
|
| |
| Welcome to fdisk (util-linux 2.31.1).
| |
| Changes will remain in memory only, until you decide to write them.
| |
| Be careful before using the write command.
| |
|
| |
|
| |
| Command (m for help): Partition number (1,2, default 2):
| |
| The bootable flag on partition 1 is disabled now.
| |
|
| |
| Command (m for help): Partition number (1,2, default 2):
| |
| The bootable flag on partition 2 is enabled now.
| |
|
| |
| Command (m for help): The partition table has been altered.
| |
| Syncing disks.
| |
|
| |
|
| |
| # fdisk -l /dev/mmcblk1
| |
| Disk /dev/mmcblk1: 58.2 GiB, 62537072640 bytes, 122142720 sectors
| |
| Units: sectors of 1 * 512 = 512 bytes
| |
| Sector size (logical/physical): 512 bytes / 512 bytes
| |
| I/O size (minimum/optimal): 512 bytes / 512 bytes
| |
| Disklabel type: dos
| |
| Disk identifier: 0x2178694e
| |
|
| |
| Device Boot Start End Sectors Size Id Type
| |
| /dev/mmcblk1p1 16384 262143 245760 120M b W95 FAT32
| |
| /dev/mmcblk1p2 * 262144 122142567 121880424 58.1G 83 Linux
| |
| </nowiki>}}
| |
|
| |
| Then rebuild the system.
| |
|
| |
| {{commands|<nowiki>
| |
| $ nixos-rebuild switch
| |
| </nowiki>}}
| |
|
| |
| You may want to verify the presence of the <tt>/boot/extlinux/extlinux.conf</tt> file.
| |
|
| |
|
| == Details about the boot process == | | == Details about the boot process == |