Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[S] Install Jessie Alongside Win8 on Existing LUKS/LVM Disk

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
jrredho
Posts: 13
Joined: 2015-03-03 18:00

[S] Install Jessie Alongside Win8 on Existing LUKS/LVM Disk

#1 Post by jrredho »

Hey All,

I'm trying to upgrade my Win8/Wheezy 64-bit machine to Jessie 8.1 by installing from the amd64-bit netinstall iso image on a USB flash drive. I had done the previous, Wheezy, install on a disk partition that was whole-partition LUKS/LVM drive, with separate logical partitions for swap, root, and home.

Before doing the upgrade, I booted to the BIOS to ensure that my UEFI system had the correct, CSM and Legacy modes enabled in it, so that installer would boot using the non-efi BIOS mode.

Step one of the upgrade was to boot the netinstall and enter the rescue mode so that I could manually do the cryptsetup/LVM business. When I returned to the installer, I mounted the now-recognized logical partitions normally, choosing to format only the swap and / partitions.

During the entire process, I had to go into rescue mode one more time to manually mount the unencrypted /boot partition, along with my /home partition. I copied a backup of my old /etc/crypttab from the latter, and after returning to the installer, finished the install. That finish included installing grub on my hard drive's main boot partition.

Everything seemed to finish with no problems. However, when I try to boot the debian bootloader, I get tossed to grub rescue with the message that '/grub/x86_64-efi/normal.mod' doesn't exist. At this point I returned to the installer, mounted the /boot partition, and saw that there grub-install didn't create that an x86_64-efi directory at all. Instead, it had created an i386 directory. The exact name escapes me at the moment.

Judging from the feedback I've read on teh googles, I *think* that my install was clean other than the last bit that was related to installing the bootloader. It would sure be nice if one of you pros here would be kind enough to give me some notion whether or not that's correct, and, if so, how to reinstall the bootloader in such a way as to make all of this work.

Many thanks!

cheers,
john
Last edited by jrredho on 2016-12-13 01:20, edited 1 time in total.

User avatar
theAdmiral71
Posts: 4
Joined: 2014-08-09 17:21
Location: Boise, Idaho, USA

Re: Install Jessie Alongside Win8 on Existing LUKS/LVM Disk

#2 Post by theAdmiral71 »

Are you still working on this problem as described in this thread?

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Install Jessie Alongside Win8 on Existing LUKS/LVM Disk

#3 Post by jrredho »

theAdmiral71 wrote:Are you still working on this problem as described in this thread?
I was still working this periodically until a week ago, when, something struck me as funny: I'd failed to boot the install iso (via usb flashdrive) using UEFI. After I did that, and following what is now a pretty well-engrained process via the Repair Mode option for doing cryptsetup, backing out to the partitioner to mount /boot and the LVM partitions, grub installed the correct boot files on /boot. That path did mean that I had to go through the entire install yet again. :)

Although I'm now golden, I cannot say that it's a straight-forward process for either:

(1) Accommodating an existing LUKS/LVM setup with separate logical volumes for /, /home, and swap without formatting /home (and thus losing your data); and,
(2) Figuring out how that you need to boot in UEFI mode to get the correct grub install.

Regardless, thanks for asking!

cheers,
john

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Install Jessie Alongside Win8 on Existing LUKS/LVM Disk

#4 Post by jrredho »

Hey All,

I really hesitate to re-open this thread, but I recently found myself in the situation of having, yet again, to re-install Jessie on my dual-boot, Win10/Debian Jessie, laptop and thought it made sense to post a more successful follow up. It really surprises me that more people don't post on this topic; either most people readily understand how to do this, or I'm just denser than the average Debian user! Either way, it's on to my story:

(1) Since I wanted to boot a UEFI version, and only the 64-bit Debian install disks make this possible, I chose to use a late-model, amd64-based Debian Jessie Net Installer iso that I copied onto a USB disk.

(2) I booted to this USB disk using UEFI boot mode.

(3) You have to use the Expert Install mode to have the necessary granularity in the install process. Since I'm not really an expert, I hesitated at this for some time, but I was trying to follow the process described in this blog post and decided to go ahead.

(4) As pointed to in that link, at the "Load Additional Modules" step in the expert install procedure, I selected "crypto-dm-modules" (and maybe lvm2(?)).

(5) Then went step by step through the installer until just prior to the Partitioning step, there I selected escape to a shell from the installer pick and again followed the instructions in the link, although adapted, of course, to my existing LUKS/LVM disk partition (/dev/sda8 for me) and, on that partition, logical volume group (VG):

# anna-install crypto-dm-modules cryptsetup-udeb
# cryptsetup luksOpen /dev/sda8 sda8_crypt
# vgscan
# lvdisplay
Find the concerning volume group and activate it with:
# vgchange -a y VG

(6) Selected the Partition Disks menu pick, and chose manual partitioning

(7) Here I was presented with a bunch of disk partitions, along with the partitions that were in my volume group. I went directly to those, and:

Configured my root, home, swap logical volume partitions (Here I selected format types, ext4 for root and home, swap for swap, and mount points that were consistent
with how I'd formatted them originally; I also selected 'Do Not Format' for home.)

Mounted unencrypted boot partition, /dev/sda7 (ext2) on /boot

Also note: after each partition, selected "Done setting up partition".

After all of the partitions were set, I went to the bottom and selected "Finish partitioning and write changes to disk".

(8) The next time I hit an installer prompt, I again escaped to a shell and mounted my existing home partition on which I had a saved copy of my working /etc/crypttab file. This all looked something like this (sorry, memory's a bit fuzzy here):

# mount /dev/mapper/sda8_crypt/VG/homevol /target/home
# cp /target/home/jrredho/crypttab_saved /target/etc/crypttab

Note: I did not write this earlier, but you should save this prior to the installation on a partition/location that doesn't get overwritten or formatted in the previous steps. Fortunately for me, I'd done this after all of my troubles last year with an installation.

(8) Continued through the installer step-by-step until I got to the <Continue> prompt at the "[!!] Finish the Installation" box. I DID NOT SELECT <Continue> TO PROCEED.

(9) Instead, I adapted the directions I found, of all places, here. This meant:

(a) Escaping to a shell (<alt>-F2);
(b) Mounting everything I needed (/, /home, /boot) under /target.
(c) Chrooting to /target
(d) Mounting /proc:
# mount /proc
(e) Update the initial (booting) ram filesystem:
# update-initramfs -k all -u
(f) Unmount /proc:
# umount /proc
(g) Exit chroot shell:
# exit
(h) Exit escaped-to shell (<alt>-F1).

(10) Selected reboot system.

Now, if for some reason at Step (10), your Installer forces a kernel build (mine did this at least one time :) ), your initial ram filesystem won't be aware of your encrypted disk or, naturally, your logical volumes. All is not lost! You simply have to restart from your Install USB, select Advanced Options, and choose "Rescue System" (or whatever it is). You'll be taken through a series of steps to set the language, keyboard, etc, but there will also be some hardward detection. This detection phase will recognize that you have a luks-encypted partition and prompt you for a password. After this, you'll be sent to the partition menu again; you'll have to repeat Steps (6) and (7), but selecting 'Do not format' for any of your partitions. And don't forget to include mounting your /boot partition.

Then you'll be offered a Repair/Rescue menu. Select to escape to a shell using the menu pick, making sure that everything's all setup like Step (9), then, ensure that your copy of /target/etc/crypttab didn't overwritten. If it did then again copy the old saved crypttab to /target/etc/crypttab and, after that, follow Steps (b) - (g) from Step (9) again. Finally, escape your menu-selected shell via '# exit', and select 'Reboot system' from the Repair/Rescue menu.

That should be all you need to get you where you need to be, and you'll be happily booting into a freshly installed Debian-based system!

Hopefully this will of some help to anyone else who, like me, has had problems doing Debian installs with separate /home, /, and swap partitions on a LUKS/LVM hard drive partition.

Good luck...

cheers,
john

Post Reply