You are not logged in.
I was wondering if there is a way to make a backup of my operating system that is bootable. It seems that truecrypt does this for Windows, but not Linux. Is there some way to make a partition both encrypted and bootable? For example, a bootloader that asks for a password, then does on-the-fly decryption?
Thank you!
PS: I have another related thread, but this is a different problem, so it's on a different thread
Last edited by UnsolvedCypher (2013-07-07 14:09:12)
Offline
I think you should change the title to include "encrypted" in there somewhere.
I think that if you just use dd with a Luks/dm-crypt setup (and of course include the /boot partition with the kernel and initramfs), this should be pretty easy. I don't really know anything about truecrypt in regard to its ability to do full system encryption. So I can't help you there. But there are some very nice native Linux tools that can handle this just fine.
Offline
Good call on the title, I missed that for some reason. Could you give some examples of native Linux tools that do this, as you said there were some?
Last edited by UnsolvedCypher (2013-06-29 04:04:46)
Offline
Luks/dm-crypt. That is the normal way of doing full system encryption with Linux. Then Arch's mkinitcpio incudes an "encrypt" hook that can decrypt on boot. So if you do a bit-by-bit cmopy of the partition (dd), you should be able to decrypt it with the same key file or passphrase.
Offline
Thank you! Can I do this with rsync as well, as I need to back up regularly and recopying everything would be wasteful?
Offline
Thank you for the suggestions, guys! I have created a partition which I intend to be my root partition, and I've encrypted it with luks. I'm having a little trouble understanding the wiki page. How do I tell the bootloader that it should prompt me for a password and use it to decrypt the luks volume?
Thanks!
Offline
Yeah the wiki page is a bit crazy. But you would use a hook in mkinitpcio. It is about 2/3 down the wiki page... in a section that is marked as outdated because it still refers to rc.conf (at least it was last time I checked).
To see all the available hooks with mkinitcpio, run "mkinitcpio -L" then if you want more info on a hook run "mkinitcpio -H <hook>"
Offline
Thanks! I used https://wiki.archlinux.org/index.php/LU … f_initcpio in case anyone stumbles over this thread later. One day, I will help clean up the Wiki page when I am knowledgeable enough! Right now, I am rsyncing the drive, but I will post later and say how it went.
Offline
I'm getting a UUID not Found error, and I am never prompted for a passphrase. Is there anything more I need to add other than the encrypt hook to mkinitcpio? The wiki page talks a lot about LVM, but do I have to use LVM to use luks? I'm backing/encrypting one physical partition, so LVM doesn't simplify anything.
Thank you!
Offline
You don't need to use lvm with Luks, but it makes things nice if yu have multiple partiitons. That is, insead of decrypting the root, and then using /etc/crypttab to decrypt the rest of the partitions, you can use a single partition that is unencrypted and then just have an LVM on top of it.
You need to do a bit more than just add the encrypt hook. Did you read the output of "mkinitcpio -H encrypt"? Otherwise, you can find examples of what you need on the kernel command line from the wiki. I know the page is crazy, but its there, I've seen it.
Offline
Yes, I did the other stuff as well, I just forgot to mention it (oops!). I think there is something strange about my bootloader, as it drops me to the grub recovery shell because it can't find the UUID. However, I switched to syslinux a while ago and no longer use GRUB or even have it installed, and I never mention the UUID that the bootloader can't find (which is the UUID of the /boot partition) anywhere except for fstab, which the bootloader wouldn't be able to see anyways since it's on the encrypted root partition. I think there is some kind of hidden GRUB that is being used, but I have no idea where to find or remove it. Do you have any idea where that could be?
Thanks!
Offline
I can't tell you how your computer is configured, or whether or not you properly installed syslinux over the old grub. But if you are getting the syslinux menu, you should have installed it right. Unfortunately, with the need to update grub to grub to because of the /usr merge, I have been hearing a large number of people indicating that they have installed various bootloaders to the partition. Typicall if this can be avoided, it should be.
All I can tell you is that although the Luks page can be a bit overwhelming, all the information you need is there. Read through it, and if you come across specific issues, come back and ask. But as of right now, your question is not specific enough to really give you any real solid advice. This section seems to be a nice set of instructions on how to get thigns set up. https://wiki.archlinux.org/index.php/Sy … the_system But again, you need to read through the page to try to get a good grasp of what you are trying to accomplish.
Offline
If you are getting a grub shell but are meant to be booting with syslinux, then that problem needs to be addressed because no matter how perfectly you configure syslinux, it won't help if grub is being used. Did you install syslinux according to the wiki instructions? I know there are 2 methods, though I don't use syslinux myself, so maybe try the other if the first doesn't work for you?
If you still have trouble, post the commands you are using to install syslinux and the output you get together with the config file(s) so people who do use it can take a look.
Last edited by cfr (2013-06-30 19:35:58)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
I think I've figured out the actual encryption part, my only remaining problem is removing whatever traces of grub there are. I don't have access to my computer at the moment, but when I do, I will post more information about whether I can get the syslinux screen up, etc. Also, I deleted my /boot and recreated it by reinstalling Linux and syslinux, and I still have the grub issue. Should I start a new thread for this?
Thanks!
Offline
What do you mean when you say you deleted /boot? Presumably you mean you deleted the contents of /boot/? (Otherwise reinstalling syslinux and linux wouldn't recreate it if e.g. you had removed the partition.)
You need to install syslinux to disk. Did you do that or did you just install the package?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
You are right, I removed the contents, not the actual partition. And I did install to disk, not just the package.
Offline
If you still have trouble, post the commands you are using to install syslinux and the output you get together with the config file(s) so people who do use it can take a look.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
To install syslinux, I used
syslinux-install_update -i -a -mHere is my syslinux.cfg:
# Config file for Syslinux -
# /boot/syslinux/syslinux.cfg
#
# Comboot modules:
# * menu.c32 - provides a text menu
# * vesamenu.c32 - provides a graphical menu
# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
# * hdt.c32 - hardware detection tool
# * reboot.c32 - reboots the system
# * poweroff.com - shutdown the system
#
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
# If /usr and /boot are on the same file system, symlink the files instead
# of copying them.
#
# If you do not use a menu, a 'boot:' prompt will be shown and the system
# will boot automatically after 5 seconds.
#
# Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
# The wiki provides further configuration examples
DEFAULT arch
PROMPT 1 # Set to 1 if you always want to display the boot: prompt
TIMEOUT 50
# You can create syslinux keymaps with the keytab-lilo tool
#KBDMAP de.ktl
# Menu Configuration
# Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
#UI menu.c32
#UI vesamenu.c32
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU TITLE Arch Linux
#MENU BACKGROUND splash.png
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
MENU RESOLUTION 1920 1080
# boot sections follow
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*
LABEL arch
MENU LABEL Arch Linux
LINUX ../vmlinuz-linux
APPEND cryptdevice=/dev/sda3:NaomiEncrypted root=/dev/mapper/NaomiEncrypted
INITRD ../initramfs-linux.img
LABEL archfallback
MENU LABEL Arch Linux Fallback
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux-fallback.img
#LABEL windows
# MENU LABEL Windows
# COM32 chain.c32
# APPEND hd0 1
LABEL hdt
MENU LABEL HDT (Hardware Detection Tool)
COM32 hdt.c32
LABEL reboot
MENU LABEL Reboot
COM32 reboot.c32
LABEL off
MENU LABEL Power Off
COMBOOT poweroff.comI don't get any prompt, and instead I just get
grub: device [UUID of /boot partition] not found and then I am dropped to the grub recovery shell.
Thank you for all your help so far!
Last edited by UnsolvedCypher (2013-07-02 12:43:37)
Offline
Maybe try the manual installation method?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
It looks like there was a file with an immutable flag, so after clearing that up, I was able to delete everything, reinstall syslinux, and everything works now. Thank you for all your help!
Offline