You are not logged in.

#1 2013-07-26 13:19:16

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

[solved] how to installing Arch on one full encrypted partition

Hi,
Could you help me to install Arch, root and home on one encrypted partition + Grub?

Can I have only
sda1 - boot
sda2 - root and home?

I tried in Wiki but it is really difficult for me to set up this kind of configuration.
I'm really appreciate your help.

Last edited by infoslaw (2013-07-31 12:35:34)

Offline

#2 2013-07-26 13:53:45

bleach
Member
Registered: 2013-07-26
Posts: 223

Re: [solved] how to installing Arch on one full encrypted partition

have you seen/tried dm-crypt with LUKS

Last edited by bleach (2013-07-26 13:56:14)

Offline

#3 2013-07-26 14:42:57

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

Re: [solved] how to installing Arch on one full encrypted partition

bleach wrote:

have you seen/tried dm-crypt with LUKS

I tried LUKS+LVM

I created boot on sda1
and
cryptsetup luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 lvm

here I'm confusing becasue I would like to use root and home on sda2 only...

pvcreate /dev/mapper/lvm
vgcreate MyStorage /dev/mapper/lvm
lvcreate -L 15G MyStorage -n rootvol
lvcreate -L 35G MyStorage -n homevol
lvcreate -L 200G MyStorage -n mediavol

so is it correct...?

pvcreate /dev/mapper/lvm
vgcreate MyStorage /dev/mapper/lvm
lvcreate -L 300G MyStorage -n myhdd (where 300GB all free partition space)

format it:

mkfs.ext4 /dev/mapper/MyStorage-myhdd

again not sure...

mount /dev/MyStorage/myhdd /mnt
mkdir /mnt/home
mount /dev/MyStorage/myhdd /mnt/home

next:

pacstrap /mnt base base-devel
and
genfstab -U -p /mnt  | sed 's/rw,relatime,data=ordered/defaults,relatime/' >> /mnt/etc/fstab

arch-chroot /mnt
reginal settings, time, host name
generate initramfs:
mkinitcpio -p linux
changing root password

installing and configuring bootloader:
pacman -S grub-bios

and here I stop with Grub error when:

grub-install --target=i386-pc --recheck /dev/sda

Grub cannot find sda


so cannot also processed last step to modify:

GRUB2 and initcpio so that it will unlock LUKS container on boot

Edit /etc/mkinitcpio.conf, and change HOOKS=" " to include:

....... keymap encrypt lvm2 filesystems..."

Next, edit /etc/default/grub and change the following line to say:

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:MyStorage"


Your help highly appreciate.

Last edited by infoslaw (2013-07-26 14:44:30)

Offline

#4 2013-07-26 15:26:50

aeqwa
Member
From: Germany, Wuppertal
Registered: 2013-04-04
Posts: 6

Re: [solved] how to installing Arch on one full encrypted partition

infoslaw wrote:

so is it correct...?

pvcreate /dev/mapper/lvm
vgcreate MyStorage /dev/mapper/lvm
lvcreate -L 300G MyStorage -n myhdd (where 300GB all free partition space)

format it:

mkfs.ext4 /dev/mapper/MyStorage-myhdd

again not sure...

mount /dev/MyStorage/myhdd /mnt
mkdir /mnt/home
mount /dev/MyStorage/myhdd /mnt/home

That doesn't work, because you can't mount one partition to two diffrent directorys.
You need to create one for root and one for home if you want to seperate them.
lvcreate -L 100GB MyStorage -n root
lvcreate -L 100GB MyStorage -n home


mkfs.ext4 /dev/mapper/MyStorage-root
mkfs.ext4 /dev/mapper/MyStorage-home
mount /dev/mapper/MyStorage-root /mnt
mkdir /mnt/home
mount /dev/mapper/MyStorage-home /mnt/home


i3wm / urxvt / luakit

Offline

#5 2013-07-26 15:29:52

bleach
Member
Registered: 2013-07-26
Posts: 223

Re: [solved] how to installing Arch on one full encrypted partition

if you want root and home

pvcreate /dev/mapper/lvm
vgcreate MyStorage /dev/mapper/lvm
lvcreate -L {your size}G MyStorage -n rootvol
lvcreate -L {your size}G MyStorage -n homevol

mkfs.ext4 /dev/mapper/MyStorage-rootvol
mkfs.ext4 /dev/mapper/MyStorage-homevvol


mount /dev/MyStorage/rootvol /mnt
mkdir /mnt/home
mount /dev/MyStorage/homevol /mnt/home

notice how you mounted /dev/MyStorage/myhdd twice on root and home.

the grub wiki shows what to do with lvm

Offline

#6 2013-07-26 15:40:07

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: [solved] how to installing Arch on one full encrypted partition

You can have two different drive layouts:
1) sda
... sda1 - boot (unencrypted)
... sda2 - LUKS volume
... ... LUKS volume: one filesystem for everything except boot

2) sda
... sda1 - boot (unencrypted)
... sda2 - LUKS volume
... ... LUKS volume - LVM
... ... ... LVM volume 1: root
... ... ... LVM volume 2: home

Offline

#7 2013-07-26 15:48:59

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

Re: [solved] how to installing Arch on one full encrypted partition

so I must mount 2 partitions 1 for root and 2'nd for home? is it possible to install everything on 1 partition in this case sda2?
sorry but it's confuse me maybe I missing something
what if f.e. I will set up:

lvcreate -L 50G MyStorage -n rootvol
lvcreate -L 250G MyStorage -n homevol

and after 2 years system say that not enough space on root partition? have I any option to enlarge quota?

Offline

#8 2013-07-26 21:15:18

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

Re: [solved] how to installing Arch on one full encrypted partition

progandy wrote:

You can have two different drive layouts:
1) sda
... sda1 - boot (unencrypted)
... sda2 - LUKS volume
... ... LUKS volume: one filesystem for everything except boot

2) sda
... sda1 - boot (unencrypted)
... sda2 - LUKS volume
... ... LUKS volume - LVM
... ... ... LVM volume 1: root
... ... ... LVM volume 2: home


Ad 1. I think that is excellent solution for me. Must read more how to encrypt LUKS method and after install system with home on sda2.
Currently on old machine I have:
sda1 - boot
sda2 - swap
sda3 - root
sda4 - home (crypto-LUKS)

Thanks for help.

Offline

#9 2013-07-26 21:34:27

Gregosky
Member
From: UK
Registered: 2013-07-26
Posts: 86

Re: [solved] how to installing Arch on one full encrypted partition

Hi All,

I'm lucky to find this question asked today.

I'm trying to build similar setup as virtualbox guest (which I can later upload to linode). I was successful building such setup for my home computer I'm writing to you from however that was somehow easier because I was not limited to use GRUB (I prefer syslinux).

So my problem is that I have built my virtualbox guest, followed roughly the tutorial found on arch wiki (dm-crypt + luks) and went all way down to booting into my new system. And it remains on "Booting..." forever... I was trying to play around with autodetect option in mkinitcpio HOOKS - no luck. Once I try to boot - it looks like GRUB is not loaded at all. So I have double checked if my sdc have boot flag set - it does (again - I used fdisk to do all partitioning work whereas I'm used to use gdisk so maybe I missed something there... The only thing that differs for my sdc - boot disk - is that I have toggled >>boot<< flag).

So I'm out of ideas..

I would appreciate any help.. Thanks!

I decided to create separate thread as my problem is slightly different.

Last edited by Gregosky (2013-07-26 22:01:38)

Offline

#10 2013-07-26 21:40:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [solved] how to installing Arch on one full encrypted partition

infoslaw wrote:

so I must mount 2 partitions 1 for root and 2'nd for home? is it possible to install everything on 1 partition in this case sda2?
sorry but it's confuse me maybe I missing something
what if f.e. I will set up:

lvcreate -L 50G MyStorage -n rootvol
lvcreate -L 250G MyStorage -n homevol

and after 2 years system say that not enough space on root partition? have I any option to enlarge quota?

Don't allocate more space than you need and then it is easy to grow partitions. Isn't that the point of LVM?

I really think you need to do some more reading before you do this - you seem to have a very hazy idea of what you are setting up. The LVM, LUKS, encryption etc. pages of the wiki have a lot of information. Although parts are out of date, there is still lots of good information and I really encourage you to use it. Right now, you don't seem to have a good sense of either the advantages or disadvantages of the configuration you are considering. And in the end, only you can know what will suit your needs.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#11 2013-07-26 22:20:12

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,346
Website

Re: [solved] how to installing Arch on one full encrypted partition

Gregosky wrote:

I decided to create separate thread as my problem is slightly different.

Don't do this. You have hijacked this thread with a crosspost. Please read the Forum Etiquette.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Online

#12 2013-07-26 22:37:40

Gregosky
Member
From: UK
Registered: 2013-07-26
Posts: 86

Re: [solved] how to installing Arch on one full encrypted partition

jasonwryan wrote:

Don't do this. You have hijacked this thread with a crosspost. Please read the Forum Etiquette.

I created another post before I have seen your comment - I can't delete question above, should I then delete another thread I created? Thanks.

Offline

#13 2013-07-26 22:58:18

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

Re: [solved] how to installing Arch on one full encrypted partition

cfr wrote:
infoslaw wrote:

so I must mount 2 partitions 1 for root and 2'nd for home? is it possible to install everything on 1 partition in this case sda2?
sorry but it's confuse me maybe I missing something
what if f.e. I will set up:

lvcreate -L 50G MyStorage -n rootvol
lvcreate -L 250G MyStorage -n homevol

and after 2 years system say that not enough space on root partition? have I any option to enlarge quota?

Don't allocate more space than you need and then it is easy to grow partitions. Isn't that the point of LVM?

I really think you need to do some more reading before you do this - you seem to have a very hazy idea of what you are setting up. The LVM, LUKS, encryption etc. pages of the wiki have a lot of information. Although parts are out of date, there is still lots of good information and I really encourage you to use it. Right now, you don't seem to have a good sense of either the advantages or disadvantages of the configuration you are considering. And in the end, only you can know what will suit your needs.


Thank you very much for your advice. I think that understand bit about it but of course still many to explore in this matter.
I think that don't need to set up logical partitions and more prefer LUKS method which already use for my home folder encryption in my current system.

Offline

#14 2013-07-26 23:33:08

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,346
Website

Re: [solved] how to installing Arch on one full encrypted partition

Gregosky wrote:
jasonwryan wrote:

Don't do this. You have hijacked this thread with a crosspost. Please read the Forum Etiquette.

I created another post before I have seen your comment - I can't delete question above, should I then delete another thread I created? Thanks.

No, the other thread is fine.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Online

#15 2013-07-31 12:29:38

infoslaw
Member
From: UK, Belfast
Registered: 2013-05-06
Posts: 87

Re: [solved] how to installing Arch on one full encrypted partition

this has been solved I choose LUKS to encrypt my /home on sda4

Offline

Board footer

Powered by FluxBB