Installation to SSD (quick guide)

From Manjaro Linux
Jump to: navigation, search

Overview

Warning: this section need to reviewed & checked possible renewed 19-05-2015
}

This is a quick guide intended for more experienced users in respect to installing Manjaro into a Solid State Drive (SSD). The installation example provided below concerns an installation undertaken on a 256GB SSD, using the following partitioning scheme:

  • 1MB GRUB BIOS (due to the use of a BIOS rather than a EFI)
  • 256MB Boot
  • 20GB LVM Root (with LUKS encryption), and
  • Remaining LVM space for Home (with LUKS encryption).


This particular scheme may of course be adjusted according to personal preference and requirements, including the addition of a Swap Partition or file, particularly if intending to use the hibernate function. The goal of the example provided is to optimise the partitioning of SSDs through sector allignment, in addition to the encryption of the entire drive.

SSD Quick Guide

Once Manjaro has booted:

1. Start The Manjaro CLI Installer, then select the Testing Installer

2. Set the Date and Time.

3. Go into the Disk(s) Preparation option, open a new tab, and then switch to Root by entering:

su
manjaro

4. As the installation is being undertaken on a SSD --and sector alignment is required-- GDisk will be used for partitioning.

note: In this instance, as the author is using s BIOS rather than a EFI, a 1MB Boot Partition will also be created. In addition, if using less than 2Gb of RAM and/or intending to use the hibernate function, then a Swap partition or file may also be added when LVM has been set up.


In the terminal enter the following series of commands (explanatory comments highlighted in red of course do not need to be entered):

gdisk /dev/sda    (or whatever your disk is)
o                 (writes new GPT boot sector)
n                 (create a new partition - BIOS GRUB - sda1)
+1M               (1MB is all that is required for the BIOS GRUB)
ef02              (code required to specify type for BIOS GRUB partition)
n		  (create another new partition - Boot - sda2)
+256M 		  (256MB specified for the Boot partition)
n                 (create a new partition - Root and Home - sda3)
w                 (write the partition table)
Y                 (confirm changes)

Accept all the defaults on starting sectors, and allocate partition sizes as required.


5. Create an encrypted LVM disk on sda3 (sda2 will be used to boot), by entering the following command:

cryptsetup luksFormat -y --cipher aes-xts-plain --key-size 512 /dev/sda3


6. Confirm in upper-case (and remember your password)

7. Open the encrypted disk for further work by entering the following commands:

note: Currently LVM is supposed to have problems observing sector limits, hence the data-alignment option is used.
cryptsetup luksOpen /dev/sda3 sda3_crypt
pvcreate --dataalignment 1024k /dev/mapper/sda3_crypt
vgcreate cryptVG /dev/mapper/sda3_crypt
lvcreate -n root -L 20G cryptVG
lvcreate -n home -l 100%FREE cryptVG

(In case the 20G doesn't work, you can try setting a percentage here, too. Try to estimate how much you need and then use 10%FREE for example). If you want to use swap (in case you use a hdd instead of an ssd), then add a third swap volume with "lvcreate -n swap -l 1% cryptVG".

8. Now return to the Manjaro CLI Installer, and select Set Filesystem Mountpoints:

  • Select /dev/mapper/cryptVG-root as Root
  • Select /dev/sda2 as Boot (ext2 file system)
  • Select /dev/mapper/cryptVG-home as Home


9. Back at the main Menu, select Install system and follow each step.

10. Select Configure system, change root password, setup user etc. Finally Edit system configuration

Tip: You may want to add "noatime, discard" to /etc/fstab, but you can also do it later.


IMPORTANT: You must edit mkinitcpio.conf: Add "encrypt" and "lvm2" - in that order - prior to "sata filesystem" under the HOOKS section. If you do not do this, then your system will not boot. Think about it: you first decrypt, then load logical volumes - it therefore needs to be in that order.

DO NOT leave Edit system configuration

11. Change to second tab and edit /install/etc/default/grub and change

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda3:cryptVG"

Leave Edit system configuration with BACK

12. Follow remaining steps. Install bootloader > grub_bios to mbr of /dev/sda

13. Finish and Reboot

14. Enter the crypt password.

15. Enjoy

See Also