You are not logged in.

#1 2018-07-06 11:25:38

hmpl
Member
Registered: 2017-07-13
Posts: 4

How to delete /home and expand / on a LUKS/LVM system

Hello everyone,

Maybe this question was already asked, but I can't find a guide online that tells me exacly what to do.
I installed Arch Linux some months ago and at that time I chose to have a separate home partiotion.
This is how I installed it:

# update pacman database and install reflector
pacman -Syy
pacman -S reflector
reflector -c "Switzerland" -f 12 -l 10 -n12 --save /etc/pacman.d/mirrorlist

# lists all recognized devices
fdisk -l

# create the partition table
gdisk /dev/sda

Command: o
#This option deletes all partition and creates a gpt table

Command: n
Partition number: (enter)
Start: enter
size: +512MiB
Hex code: ef00

Command: n
Partition number: (enter)
Start: enter
size: (enter)
Hex code: 8e00

Command: w

Do you want to proceed?
y

mkfs.fat -F32 /dev/sda1

cryptsetup luksFormat /dev/sda2
YES

Passphrase: #...

cryptsetup open --type luks /dev/sda2 lvm   #(lvm is the name)

# to check
ls /dev/mapper/lvm
# we should see something

pvcreate /dev/mapper/lvm

vgcreate Laptop /dev/mapper/lvm   #(Laptop is the volume name)

lvcreate -L8G Laptop -n swap
lvcreate -L50G Laptop -n root
lvcreate -l 100%FREE Laptop -n home

mkfs.ext4 /dev/mapper/Laptop-root
mkfs.ext4 /dev/mapper/Laptop-home
mkswap /dev/mapper/Laptop-swap

mount /dev/mapper/Laptop-root /mnt
mkdir /mnt/home
mkdir /mnt/boot
mount /dev/mapper/Laptop-home /mnt/home
mount /dev/sda1 /mnt/boot
swapon /dev/mapper/Laptop-swap

pacstrap /mnt base base-devel vim
... 

Could someone tell me also if this procedure is called LUKS on LVM or LVM on LUKS? I didn't really understand it from the wiki.

I noticed I don't need a separete /home partition and I also want to have more space for other applications. How can I get rid of this home partition, expand / and add a new home folder there (in /). I will make a backup of all important data on another drive. I would be pleased if someone could give me some instructions. Thank you a lot for reading this topic!

Offline

#2 2018-07-06 11:56:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,435

Re: How to delete /home and expand / on a LUKS/LVM system

As you first encrypted the device this is LVM on LUKS you don't get access to your logical volumes before decrypting the device.

As for the other questions those are one of the main reasons for using LVM:

https://wiki.archlinux.org/index.php/LV … cal_volume
https://wiki.archlinux.org/index.php/LV … _in_one_go


Which instructions are you following? All of these would by direct consequence be at least guessable while following the wiki?

Offline

#3 2018-07-06 12:06:33

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,718
Website

Re: How to delete /home and expand / on a LUKS/LVM system

Mod note: Not an installation issue, moving to NC.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB