LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-27-2010, 03:21 PM   #1
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Rep: Reputation: 1
Encryption with multiboot and one boot partition


Hello,

I'm trying to get a fully encrypted system with several linux partitions.
I use one big encrypted (luks) partition which I divide into several smaller with LVM but I still need to set the boot folder on a non-encrypted partition.

So my question is : is there a way to have only one boot partition instead of one for each system ?

Thank you
 
Old 07-27-2010, 04:03 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
I don't see why not, as long as all of the kernels and initrds have unique names, are referred to in your bootloader and all have the capability of opening up the LUKS container and mounting their unique partition.

You will probably need to do a bit of manual editing for each initrd so that it mounts the correct partition as root, and I would think the biggest hurdle would be the semi-automatic installers of most distros, which might not be friendly to an unusual setup.

Your English is perfect.

Last edited by mostlyharmless; 07-27-2010 at 04:08 PM.
 
1 members found this post helpful.
Old 07-28-2010, 01:39 AM   #3
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Original Poster
Rep: Reputation: 1
Hum why not. But there is no risk of conlict ?
Like I think debian and ubuntu use the same kind of name for their kernels.
Or I was thinking, is it possible to use subfolders ?
So my /boot folder would be something like :
Code:
/
.boot/
..archlinux/
....some files
....kernel26.img
....vmlinuz26
..grub/
....some files
....grub.cfg
..ubuntu/
....some files
....initrd.img-2.6.31-19-generic-pae
....vmlinuz-2.6.31-19-generic-pae
But then in my grub I've to use only custom entries I guess
something like
Code:
menuentry "Arch Linux" {
	insmod ext2
	set root='(hd0,7)' # boot partition
	echo	Loading Linux vmlinuz26 ...
	linux	/archlinux/vmlinuz26 root=/dev/mapper/vgrp-rootarch ro  quiet
	initrd	/archlinux/kernel26.img
}
but it's when I'll have to update my kernel that I guess the problems will come.

But anyway why exactly do I need to have the boot folder on an non-encrypted partition ? Is it just to load the module to decrypt the partition or I really need the kernel to be available ?

And yes your are right, I've to fight against the installer sometime. I'm using maybe my 5th virtual machine

Thanks for the English, I prefer warm if I use unusual formulations sometimes

Last edited by martvefun; 07-28-2010 at 02:12 AM.
 
Old 07-28-2010, 03:00 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You may have an issue if you install a new distro and accidentally opt to format your old /boot partition.
Another possible problem I can see is if one distro uses a patched kernel, but only if the filenames for the kernel and initrd files are identical. Sharing the /boot partition, make sure you use a larger /boot partition. Maybe 500 MB or 1 GB to make room for the extra kernels and leave room for kernel security updates depending on how many distro's you will be installing.

Another option is to install /boot on the root partition of each distro, and then modify menu.lst and /etc/fstab of each distro to reference the unencrypted boot partition, copying needed files to it and cutting and pasting the stanza for the new distro to the old menu.lst file.
Then if something goes wrong installing Distro D, you have the files and configuration settings for the other distro's still present.

Make sure you backup the MBR of the /boot partition, as well as the "fstab -l" and "fstab -lu" results.
Use pvdisplay and lvdisplay to track your physical and logical volumes as well.

I've used cryptsetup for a partition, but never on an lvm volume before partition. I don't see that being a problem. One big advantage doing it this way is that you don't need to enter a passphrase for each encrypted partition.

You could have a problem trying to install an older distro. The luks versions may not be compatible.

Last edited by jschiwal; 07-28-2010 at 03:06 AM.
 
1 members found this post helpful.
Old 07-28-2010, 04:02 AM   #5
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Original Poster
Rep: Reputation: 1
Thank you I'll try this way
 
Old 07-28-2010, 11:23 AM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
But there is no risk of conlict ?
Like I think debian and ubuntu use the same kind of name for their kernels.
Definitely there will be conflict, especially with upgrades if you don't do them manually. and rename the files. Subfolders might be more organized, but the problem would remain.
Quote:
But anyway why exactly do I need to have the boot folder on an non-encrypted partition ? Is it just to load the module to decrypt the partition or I really need the kernel to be available ?
Yes, well you need the kernel to use the module to decrypt...

jschiwal's suggestion is much cleaner, and will probably keep you out of trouble. On the subject of the passphrase, you can setup your initrd to read a keyfile from a removable device such as a USB key that you mount and unmount just for that purpose... but it takes some manual editing of the initrd, which would be lost with an upgrade. It all depends on what you want.
 
Old 07-28-2010, 11:53 AM   #7
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Original Poster
Rep: Reputation: 1
Thank you but I'm not looking for the perfect encryption (I read also a tutorial where the full /boot folder is on a USB key to avoid modifications).
Encrypt only /home folder would have been enough for me if I didn't have the problem with the shared partition for my data (the configuration files, profiles,... are on the system partition but my documents, music,... are on a specific partition I share between each system)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Full disk encryption on boot partition paul_mat Linux - Security 13 03-12-2008 02:11 AM
Multiboot Full Disk Encryption Polarian Linux - General 1 07-12-2007 08:37 PM
XP/Linux multiboot, boot partition advantageous? seawolf Linux - General 2 04-30-2005 01:55 PM
XP/Linux multiboot, boot partition advantageous? seawolf Linux - Newbie 1 04-30-2005 01:48 PM
Multiboot with /boot partition, kernel overwritten TiMiN8R Linux - Software 8 11-12-2004 02:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration