0 Replies Latest reply on Jun 30, 2016 7:39 PM by mohamedshaharris_intel

    How to create swap file on Mi3.1


      You can create swapfile for swap by running this command:



      $ dd if=/dev/zero of=/swapfile bs=1024 count=1M



      count=1GB is the size for the swap partition. You can change 1M to size you needed.



      You need to change mod the swapfile:



      $ chmod 0600 /swapfile



      You to enable swap:



      $ mkswap /swapfile



      You need to modify file "/etc/fstab". Add this line:



      /swapfile swap swap defaults 0 0



      You type this command to enable swap:



      $ swapon -a



      You can check the swap is already enabled:



      $ swapon -s



      You need to modify your bootx64.conf in "/boot/efi/EFI/boot" on your target.



      You need to add the resume to swap partition on bootx64.conf on this line:

      kernel /bzImage root=LVM=/dev/mapper/rootfs-runtime rw rootwait i915.disable_power_well=0 resume=/swapfile



      You can reboot your system.



      If your system is build by enabling the SRM, you need to reassign back the certificate auth to this file.Steps



      provided below.

      After modification, assign this bootx64.conf with SST tool:

      Get the SST tool from project's folder.



      $ ./SST sign-bootloader --grub-efi=no --verbose=no --vendor-cert=./vendor-cert.pem --priv-key=./vendor-private.pem






      Copy both new bootx64.conf and bootx64.conf.auth to "/boot/efi/EFI/boot" on your target.



      Reboot the system



      After reboot the system you can check dmesg log for swap:



      $ dmesg |grep swap



      [ 0.000000] Kernel command line: rw rootwait i915.disable_power_well=0 resume=/swapfile



      root=LVM=/dev/mapper/VGWR52FE-LVWR4728 ownercert_loader.root_cert=0x1eeff000 memmap=4k$0x1eeff000

      [ 2.569611] PM: Checking hibernation image partition /swapfile

      [ 7.260135] Adding 1048572k swap on /swapfile. Priority:-1 extents:11 across:1433596k