Author Topic: Installing Manjaro on SSD and HDD with LVM for dummies (like myself)  (Read 7257 times)

0 Members and 1 Guest are viewing this topic.

Offline amonobeax

  • Jr. Mitglied
  • **
  • Posts: 75
  • Branch: Stable
  • Desktop: XFCE
  • GPU Card: NVIDIA GTX 770
  • GPU driver: non-free
  • Kernel: 3.14
  • Skill: Novice
In this Guide we will Install only Manjaro (0.8.10) in 2 storage devices one SSD for (/) and (/boot) and HDD for (/home) and swap.
In order to do that we'll use gdisk to partition both our disks and LVM to manage our disks in 1 system. For this install we will use BIOS boot instead of UEFI boot.

Requirements:

1- Manjaro LiveCD (0.8.10)
2- gdisk (we are using GPT table partitioning)
3- lvm (to deal with more than 1 disk)


Process:

1- First of all use the LiveCD to boot into Manjaro (free or non-free drivers)




2- Now we need start partitioning with gdisk:

This Steps bellow will destroy data, so if you have any in this disks plz backup!

2.1- The plan (explanation):
SSD:
Partition 1: BIOS BOOT (2KB)
This HAS TO BE THE FIRST PARTITION cause in this type of boot the system reads the first thing written in the Disk in order to boot.

Partition 2: '/boot' (256MB)
Not in lvm

Partition 3: '/' “Linux LVM” (System Size)

Unallocated room: GRUB WILL NEED unpartitioned space in the Disk to install Grub (look at 5.5)


HDD:
Partition 1: '/home' (Desired size to your personal files)
Could be total minus your swap partition size or if you don't want a swap partition the entire HDD disk.

Partition 2: swap (Default: 2x your RAM value)
Most ppl say Swap is not necessary anymore. Do some research to decide if you want a swap partition or not.


2.2- Partitioning:
If you don't know the device path (If you don't know what's the device name sda, sdb, sdc etc, use 'lsblk -f' do discover)

2.2.1- SSD
Code: [Select]
sudo -i
gdisk /dev/sdb
(I'll use sdb cause my SSD was connected as second storage device)

Code: [Select]
o (this option will make gdisk partition deleting previous existing partitions)
Confirm.

Code: [Select]
n sdb1 (this command will create 1 partition with the name sdb1, you can name your partition as you wish)
1- Set this partition in the beginning of the disk (remember this is essential for BIOS boot), gdisk will place partition in crescent order by default so you can just hit enter here
2- This option will ask about the starting point (here just hit enter to use the default)
3- This option will ask where to put the end of the partition
In sdb1 use +2K (for 2KB) and hit enter
[if you just hit enter with no value the partition will be set to use all the remaining room in the disk, if you put a value it will set the partition with that size (K= kbytes, M= MegaBytes, G=GigaBytes, and so on)]
4- Lastly you'll have to choose the partition type, “l” (lower case 'L') will give you all the options, for our plan put 'ef02' and confirm

Code: [Select]
n sdb21- default partition position (hit enter)
2- default starting point (hit enter)
3- End of partition: +256M (will place the end of the partition with it consuming exactly 256MB)
4- Partition type: 8300  (Linux Filesystem, cause this has to be outside lvm management)

Code: [Select]
n sdb31- defalt partition position (hit enter)
2- default starting point (hit enter)
3- End of partition: Here set the size you'll net to you system files (/), BUT REMEMBER YOU'LL NEED SOME unallocated ROOM TO INSTALL GRUB, so don't use all (save like 200MB to unallocated)
4- Partition type: 8e00 (Linux Lvm)

Code: [Select]
w (confirm, only this command write all the changes to the disk, you can use it here or at the end of each step it doesn't matter)


2.2.2 HDD

Code: [Select]
sudo -i
gdisk /dev/sda

Code: [Select]
o (confirm)

Code: [Select]
n sda11- default partition position (hit enter)
2- default starting point (hit enter)
3- End of partition: +16G (Provided you have 8G of RAM and want a swap)
4- Partition type: 8200  (Linux swap)


Code: [Select]
n sda21- default partition position (hit enter)
2- default starting point (hit enter)
3- End of partition: remaining room (just hit enter to use all remaining space)
4- Partition type: 8e00  (Linux LVM)

Code: [Select]
w (and confirm)

Okay both disks are partitioned and ready to LVM.



3. LVM
This guy will manage all this storage and partitions as one single. We will use here those partitions we made with “Linux LVM” type. Basically LVM work with Logical volumes but in order for these to work you'll need to create a volume group and physical volumes. As follows:

Code: [Select]
lvmdiskscan (will show all the partitions you have available to create volumes)
Code: [Select]
pvcreate /dev/sda2
pvcreate /dev/sdb3
(This command create the physical volumes needed to create a volume group)

If you want to see the progress you can use this command:
Code: [Select]
pvdisplay
Code: [Select]
vgcreate SystemStorage
/dev/sda2 /dev/sdb3
('SystemStorage' is just an example put any name you want here)
(this command create the volume group from which we can create the Logic volumes)

If you want to see the progress you can use this command:
Code: [Select]
vgdisplay
Code: [Select]
lvcreate -L 16G SystemStorage -n SystemSwap /dev/sda1

lvcreate -L (your /home size) SystemStorage -n SystemHome /dev/sda2

lvcreate -L (put the size of your root partition (/) here) SystemStorage -n SystemRoot /dev/sdb3
(Finally these are the Logic Volumes)
[the path /dev/sd* at the end of the commands will restrict where LVM can allocate data, so SWAP only uses the SWAP partition, '/home' only use sda2 and '/' only use sdb3 (which are in the SSD)]

If you want to see the progress you can use this command:
Code: [Select]
lgdisplay

4. Ativating LVM volumes
Your logical volumes should now be located in /dev/mapper/ and /dev/YourVolumeGroupName. If you cannot find them, use the next commands to bring up the module for creating device nodes and to make volume groups available:
Code: [Select]
modprobe dm-mod
vgscan
vgchange -ay




5. Installation
Now we're ready to install Manjaro!
Enter the CLI installer and pick the UEFI (still unstable) installation option.


5.1 Go thru the installation and when you reach the partitioning step remember:
You'll install the system in the LVM volumes NOT IN THE PARTITIONS ITSELVES. Let's make our hard work until now worth something shall we?


5.2 Mounting sytem points:

Swap at SystemSwap (in SystemStorage volumegroup)
Root (/) at SystemRoot ('')
Home (/home) at SystemHome ('')

Manjaro installer won't ask all this 3 mounting points (swap, '/' and '/home' as default) so you'll need to ask the installer for the ones you want to be separated (I guess '/home' is not separated by default). Remember that by default all system can be installed in (/), but we are dividing this installation so (/home) only access the HDD and (/) only access the SSD.


5.3 Finally do the installation.



5.4 Now go to configure your system and change 'mkinitcpio.conf' at /etc/mkinitcpio.conf:
At the 'Hooks' section (last lines of the section) add lvm2 like this:
Code: [Select]
HOOKS="base udev ... block lvm2 filesystems"
TAKE CARE! Don't delete anything just add. The order is important! And this word enable your system to read all those volumes we've created with LVM. Without this the system won't be able to see any volume we made.

That's the only configuration you'll need.

5.5 Go thru all the remaining steps until you reach the Bootloader installation step:
Pick the disk in with you left unallocated space at the partitioning phase (look 2.3.2.1 at sdb3) and pick GRUB as your bootloader.


5.6 That's it finish the installation and restart the system.


5.7 The last step in this long journey is to SET your BIOS to boot in the same disk in which you've put the BIOS BOOT partition (in 2.2.1 at sdb1).



SUGGESTED MATERIAL:
https://wiki.archlinux.org/index.php/LVM
https://forum.manjaro.org/index.php?topic=5635.0


Obs: Thanks to Vulpes who helped me with the last missing piece of this puzzle .

That's it brothers and sisters,
amonobeax
« Last Edit: 18. August 2014, 14:25:22 by amonobeax »

Offline mips

  • Held Mitglied
  • *****
  • Posts: 2892
  • Valkyrja
  • Branch: Testing
  • Desktop: XFCE
  • GPU Card: GTX 960
  • GPU driver: video-nvidia
  • Kernel: 3.16
  • Skill: Intermediate
May ask why you would want to put a ssd & hdd into a single volume?


To me it does not make sense to mix devices with such a big difference in speed unless you use the ssd as cache device for the slower drive which does not seem to be the case here?

Offline amonobeax

  • Jr. Mitglied
  • **
  • Posts: 75
  • Branch: Stable
  • Desktop: XFCE
  • GPU Card: NVIDIA GTX 770
  • GPU driver: non-free
  • Kernel: 3.14
  • Skill: Novice
May ask why you would want to put a ssd & hdd into a single volume?


To me it does not make sense to mix devices with such a big difference in speed unless you use the ssd as cache device for the slower drive which does not seem to be the case here?

No reason. I didn't even know putting it in a single Volume Group would make me lose performance (Is this benchmarked data?)
I thought that limiting LVM's logical volumes to determined partition would isolate the mount points ('/' and '/home') and avoid any performance issues.

But I've never done such benchmark.

EDIT:
For the record I'm using this installation right now, I've never experienced a slow down or something like it.
« Last Edit: 15. August 2014, 20:21:27 by amonobeax »

Offline Zileene

  • Held Mitglied
  • *****
  • Posts: 536
  • Branch: Stable
  • Desktop: awesomeWM,Gnome
  • GPU Card: various
  • GPU driver: the one that works
  • Kernel: 4.1
  • Skill: Intermediate
Re: Installing Manjaro on SSD and HDD with LVM for dummies (like myself)
« Reply #3 on: 16. September 2014, 19:00:35 »
Thanks for this writeup, I was looking for a simple explanation of how to set it up (again) :D
Now, I just need to wrap my head around encrypting the LVM group with LUKS... :o

Side note: the problem with LUKS/LVM full disk encryption is that it's done so rarely that you manage to forget it all,
right before you need to do it again...  ::)
(unless you're a techie that builds several machines a day...)

Have Fun! ^-^
Z.
While I may not always have the correct solution, my input could lead you in the right direction...
If you don't know what a command does, then type 'man <command>' or '<command> --help' to find out.