You are not logged in.

#1 2017-06-13 06:13:24

LithoUser
Member
Registered: 2016-11-17
Posts: 139

From Debian to Arch with encryption

Hello !

Since I already use Arch for a few months on my laptop, I'd like to use it on my PC too. It's currently running Debian.

My concerns are :
1. My Debian system is fully encrypted, using LUKS on LVM ;
2. I'd like to install Arch using LUKS on LVM too ;
3. I want to format everything except my home partition, since I want to keep everything that is in my home partition as is (and do some cleaning on my own).

My actual fstab in Debian contains the following :

UUID=5bca3c1d-5728-4239-ba46-a5ae8ad8006a / ext4 errors=remount-ro 0 1
/dev/mapper/sdb1_gv-vl_home /home ext4 defaults,nodev,nosuid,noatime 0 2
/dev/mapper/sdb1_gv-vl_swap none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0

So : is this possible ? I have reinstalled Arch several times (with LUKS on LVM, etc.) but I've never been able to keep my home partition. Could someone point me in the right direction ? What I'd like is some guidelines, a tutorial or a specific page that I could follow on the wiki to achieve this, maybe ?

Thanx in advance for any help !

Offline

#2 2017-06-13 06:21:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: From Debian to Arch with encryption

rsync your home to an external drive, complete your FDE Arch install and then rsync it back.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-06-13 08:46:24

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: From Debian to Arch with encryption

LithoUser wrote:

I have reinstalled Arch several times (with LUKS on LVM, etc.) but I've never been able to keep my home partition.

Arch doesn't force you to delete and recreate partitions/volumes—it's just a matter of what you do during the partition/volume setup with {c,}{g,f}disk or parted. You can simply reformat your root partition (which doesn't appear to be encrypted, according to that fstab), mount it under /mnt, decrypt your home partition and mount the "mapper device" under /mnt/home, and you're good to run pacstrap.

(Actually, I'm not even sure it is absolutely necessary to have the home filesystem mounted during the base system installation)


pkgshackscfgblag

Offline

#4 2017-06-13 09:16:23

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: From Debian to Arch with encryption

You don't have to format anything when installing arch onto an existing linux system (with the intent of replacing it completely). You already have partitions, filesystems, ... so you just need to have enough free space to hold the files somewhere.

It's entirely possible to just mkdir /archlinux (on the existing root partition, provided enough space), do the chroot install inside there and, as a last step from a live cd, switch it around:

mkdir /archlinux
[... unpac, chroot, install, prepare, whatnot ...]
# reboot with a live system here, mount the root partition, chroot (root only w/o proc dev sys boot home ...)
mkdir /debian
mv * /debian
ls -al
# only debian/ should be left
mv /debian/archlinux/* /

These mv within one filesystem are instant. Lo and behold your Debian root filesystem turned into Archlinux root filesystem just like that.

Of course - this process deviates from the manual/wiki a bit, so you already have to know Linux well enough to be able to make the necessary adaptions.

Last edited by frostschutz (2017-06-13 09:18:04)

Online

#5 2017-06-13 12:31:32

ua4000
Member
Registered: 2015-10-14
Posts: 402

Re: From Debian to Arch with encryption

jasonwryan wrote:

rsync your home to an external drive

Note: this should be not your regular backup drive, use another external drive for this!
(Murphy's law)

Offline

#6 2017-06-14 04:55:51

LithoUser
Member
Registered: 2016-11-17
Posts: 139

Re: From Debian to Arch with encryption

Thanx for all these advices.

Well, my home folder contains 2 terabytes of movies that are not backuped, so my regular backup drive only contains all the rest. I can't buy an HDD large enough to rsync my entire home folder, so this is not an option for me.

You can simply reformat your root partition (which doesn't appear to be encrypted, according to that fstab), mount it under /mnt, decrypt your home partition and mount the "mapper device" under /mnt/home, and you're good to run pacstrap.

My root partition is encrypted on my laptop under Arch, and I intend to encrypt it on my PC too.
The part that scares me is "decrypt your home partition and mount the mapper device under /mnt/home". Can I just do the following :

cryptsetup luksOpen /dev/sdxY sdxY_crypt # Opens the LUKS-container
mount /dev/mapper/sdb1_gv-vl_home /mnt/home # If necessary

Or can someone confirm that mounting the home filesystem is not necessary ?

Offline

#7 2017-06-19 19:56:27

piratebill
Member
From: Sol System
Registered: 2011-10-20
Posts: 133

Re: From Debian to Arch with encryption

I'd ignore your home partition completely during install. Post install, edit your fstab to auto mount your home partition to /home, then create your new non root user and set its home directory to /home/yourOldUser. You probably will have to change the ownership of your old home directory to access it though.

sudo chown -R newUser /home/yourOldUser

Last edited by piratebill (2017-06-19 19:56:59)

Offline

Board footer

Powered by FluxBB