0

At the moment, I’m trying out KUbuntu 18.04 and I’m wondering if someone can show me how to do an install that looks like:

/dev/sda1 -> /boot -> 1GB (by the way, what format should boot be?)

/dev/sda2 -> /swap -> 1GB

/dev/sda3 -> / -> LVM (Having one volume group which in turn contains one logical volume)

/dev/vol-grp/root -> 8 GB formatted as ext4

I tried using the Graphical Installer of KUbuntu and I cannot figure out how to create an LVM.

No Option to create LVM

If this is not possible, can someone show me how to do this on the commandline. I’m unsure if I should use fdisk or parted or something else. I also could not find information on how to create an LVM using them.

3
  • Do not know LVM, but there is this thread. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 and help.ubuntu.com/community/ManualFullSystemEncryption
    – oldfred
    Oct 5, 2018 at 17:22
  • Thank you oldfred. This seems to say Manual, but the instructions are using the installer for most part. Can you please point me to where the LVM is created in these instructions. The closest I could come to was help.ubuntu.com/community/ManualFullSystemEncryption/… Finally, I would like to avoid putting the boot in the LVM, while these instructions put the boot in it, so this may not help me.
    – O.O.
    Oct 5, 2018 at 18:48
  • Boot used to always be separate, but newer configurations do not have to be. LInk above has many links with more details as process is somewhat more involuted then just click, erase entire drive & install with standard installer. See this. help.ubuntu.com/community/ManualFullSystemEncryption/… I am pretty sure you can add an ext2 or ext4 /boot partition, but have to be sure to specify it when installing as /boot.
    – oldfred
    Oct 5, 2018 at 19:10

1 Answer 1

0

I think the problem I was facing that motivated this question was that the Kubtuntu 18.04 installer did not allow you to create/modify the LVM other than the defaults i.e. if you did not want the LVM on the entire Disk, you had to do it manually. The way I solved this problem was:

  • Use the Kubtuntu 18.04 USB/DVD and select the option Try (as against choosing Install).
  • Once you get into this try to use the KDE Partition Manager, or just parted to create the partitions you want

Once Kubuntu loads (i.e. from the USB/DVD) with the option to Try, you have two options: Open the Konsole or use KDE Partition Manager. The discussion below is for the Konsole, but I think it is easier to use the KDE Partition Manager. All of this was done in a VM, hence the disk sizes are much smaller than you would expect for a typical HDD

Get into root

sudo -i 

Figure out which disk you are going to instal using:

df -h 

Sometimes you have to guess using the disk sizes

Assuming the disk is at /dev/sda, the following is the sequence of commands you can use in parted.

parted /dev/sda

I’m doing MBR here, so for GPT your requirements would be differerent

mklabel msdos

Make the boot partition (The numbers specified are in MB):

mkpart
Partition type?  primary/extended? primary
File system type?  [ext2]? ext2
Start? 1
End? 1000
set 1 boot on

Make the Swap Partition

mkpart
Partition type?  primary/extended? primary
File system type?  [ext2]? linux-swap
Start? 1000
End? 2000
set 2 swap on <- Did not work, and I don’t know why

To observe your results

print free

To create the space for the LVM Now we need to specify all of the remaining space. If you specify the MB, you leave some space at the end of the device. Hence I used %.

mkpart primary 2000 100%
set 3 lvm on

If you have an SSD, then do an align check

align-check opt 1
align-check opt 2
align-check opt 3

Finally quit parted using

q

Create filesystems on the boot and swap partitions

mkfs.ext2 /dev/sda1
mkswap /dev/sda2

Finally to create the LVM and format the space as ext4

pvcreate /dev/sda3
vgcreate vol_grp /dev/sda3
lvcreate -L 7GB -n root vol_grp
mkfs.ext4 /dev/vol_grp/root

Note: I have not used the entire space of the volume group because I wanted to use the rest of the space to create a snapshot when I have to backup root i.e. /

You can check your work using:

parted -l

Finally, reboot the machine with the Install Medium, and this time choose Install. Run through the process. When you get to Disk Setup select Manual and then continue.

Here make the following changes:

Prepare Partitions

Typo: Please read kubuntu in the above image as root

Select /dev/mapper/vol_grp/root and hit Change In the dialog that pops up set:

  • Use as: Do not use this partition -> Ext4 Journaling file System
  • Format: Upto you check/uncheck since we have already done the format above
  • Mount Point -> /

Select /dev/sda1 and hit Change In the dialog that pops up set:

  • Use as: Ext2 Filesystem
  • Format: Upto you
  • Mount Point -> /boot

Finally at the bottom select - Device for bootloader installation: /dev/sda1

Now you are set!! Let the Kubuntu installation proceed as usual.

Note: I think it is easier to use the KDE Partition Manager. In my further attempts esp. with disks bigger than the ones above, I have faced alignment issues, and I had no way to fix them. I noticed that KDE Partition Manager automatically handles the alignment for you. If not select the Align option under Advanced.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .