Siduction Forum

Siduction Forum => Installation - Support => Topic started by: bgoodri on 2014/12/26, 19:42:19

Title: Unable to boot after install
Post by: bgoodri on 2014/12/26, 19:42:19
Short version: The siduction install says it is successful, but my new (Lenovo T540p) laptop cannot boot from its SSD.

Longer version: I followed the instructions at the top of http://manual.siduction.org/hd-install-crypt (http://manual.siduction.org/hd-install-crypt) to create a LVM volume and inside that an unencrypted boot volume plus an encrypted volume to hold /, home/ and data/ . I have done this a couple of times before with sidux and aptosid, so I think I got it right but here is the info just to make sure:

Code: [Select]
root@siduction:/home/siducer# lvs -v
    DEGRADED MODE. Incomplete RAID LVs will be processed.
    Finding all logical volumes
  LV      VG    #Seg Attr       LSize   Maj Min KMaj KMin Pool Origin Data%  Meta%  Move Cpy%Sync Log Convert LV UUID                                LProfile
  boot    T540p    1 -wi-a----- 252.00m  -1  -1  253    0                                                     P1gjSR-9Fpw-F5sw-Y2wO-BdwT-x7BI-NEezyI
  notboot T540p    1 -wi-ao---- 476.50g  -1  -1  253    1                                                     r7cm1N-GMWI-d17f-5ZM2-9G3m-bPO9-u1rNRj
  data    stuff    1 -wi-a----- 399.50g  -1  -1  253    6                                                     pHREY8-IyXY-acId-Fd9m-bPMv-KJrE-zBucV7
  home    stuff    1 -wi-a-----   4.50g  -1  -1  253    5                                                     Bc7lS2-zs8F-v0Ai-RrPT-ze4A-aM3n-yNGrUH
  root    stuff    1 -wi-a-----  70.00g  -1  -1  253    4                                                     43k2pD-bnKd-UjVv-MUN0-Cflw-T1gN-WmTHSm
  swap    stuff    1 -wi-a-----   2.00g  -1  -1  253    3                                                     kQI1xC-yGUE-auzk-RMc4-ncVJ-n2sE-sQhcy2

root@siduction:/home/siducer# parted -l /dev/sda
Model: ATA SAMSUNG MZ7TE512 (scsi)
Disk /dev/sda: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  512GB  512GB


Model: Generic Flash Disk (scsi)
Disk /dev/sdb: 2056MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End     Size    Type     File system  Flags
 1      778kB  2056MB  2055MB  primary


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/stuff-home: 4832MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  4832MB  4832MB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/stuff-data: 429GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0.00B  429GB  429GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/stuff-swap: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system     Flags
 1      0.00B  2147MB  2147MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/stuff-root: 75.2GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  75.2GB  75.2GB  ext4


Error: /dev/mapper/notboot: unrecognised disk label
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/notboot: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/T540p-boot: 264MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0.00B  264MB  264MB  ext4


Error: /dev/mapper/T540p-notboot: unrecognised disk label
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/T540p-notboot: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

However, when I go to boot, it just falls through the internal disk to the next boot option without doing anything. I have changed everything (I think) in the BIOS Setup to favor traditional mechanisms (disable Secure Boot, disable UEFI in favor of Legacy Mode, disable Microsoft "optimizations", etc.).

If I put in the siduction CD, the boot menu comes up. If I choose option #3 "Boot from hard disk", it just says something like "Booting from hard disk" and then hangs. If I instead choose F4 -> Hard disk -> /dev/sda1, it says "Probing devices [sda1]" a few times, then fails to find root with the message "module ehci-orion not found in modules.dep". In initramfs, I can execute lvm commands, and it looks fine.

I also have the HDD from my old laptop (whose motherboard died) in a USB enclosure that I can boot from, which brings me to grub 2.x text mode. I got rid of everything (which was aptosid stuff) under its boot/ volume and copied into it everything from the boot/ volume on the SSD. This also fails to boot. However, if I go to the grub command line I can do "ls (hd0,1)" and "ls (hd0,2)", both of which say "uncrecognized file sysrtem". But the unusual thing is that if I do "ls lvm/vg-boot" or "ls lvm/vg-crypt", it recognizes those as LVM volumes on the USB disk but does not recognize "lvm/T540p-boot" or "lvm/T540p-notboot" as LVM volumes on the SSD.

I have tried many of the suggestions at the top of http://www.rodsbooks.com/gdisk/bios.html (http://www.rodsbooks.com/gdisk/bios.html) . I also tried booting in UEFI mode. I think the next thing I will try is "crypt with traditional partitioning methods" at the bottom of http://manual.siduction.org/hd-install-crypt (http://manual.siduction.org/hd-install-crypt). But I wanted to first ask if anyone spotted a mistake I made or has successfully managed to get LUKS working with a recent SSD and / or Lenovo laptop?
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/27, 08:22:59
I have tried many of the suggestions at the top of http://www.rodsbooks.com/gdisk/bios.html (http://www.rodsbooks.com/gdisk/bios.html) . I also tried booting in UEFI mode. I think the next thing I will try is "crypt with traditional partitioning methods" at the bottom of http://manual.siduction.org/hd-install-crypt (http://manual.siduction.org/hd-install-crypt). But I wanted to first ask if anyone spotted a mistake I made or has successfully managed to get LUKS working with a recent SSD and / or Lenovo laptop?

That did not work either. I am currently thinking that it doesn't have anything to do with LUKS and is instead a problem with quirky or buggy Lenovo firmware.

I can't boot directly from my USB thumb drive either (I have to boot in Legacy Mode with the CD-ROM to start and from there tell it to boot from the USB disk). I followed http://forum.siduction.org/index.php?topic=4254.msg35577#msg35577 (http://forum.siduction.org/index.php?topic=4254.msg35577#msg35577) but when it tries to boot directly from the USB thumb drive, I get an infinite number of

Code: [Select]
error: no such device: /boot/grub/x86_64_efi/2014-11-23-03-42-53-00

It is true there is no such directory, or any subdirectory under /boot/grub/x86_64_efi/ . If I grep

Code: [Select]
siducer@siduction:/media/usbboot$ grep -r -F "11-23" efi/
Binary file efi/boot/bootia32.efi matches
Binary file efi/boot/bootx64.efi matches

and then open bootx64.efi in nano, I see near line 1074

Code: [Select]
export from
search --file --set=root /boot/grub/x86_64-efi/2014-11-23-03-42-53-00
set prefix=(${root})/boot/grub
source $prefix/grub.cfg

Is that 2014-11-23-03-42-53-00 directory supposed to be created automatically? Should I create it manually?
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/27, 13:18:22
Since nothing you have tried is working, maybe would be worth the time to attempt the simplest possible conventional partitioning and installation on that system, just to sort out whether the issue has to do with the LUKS/encryption or whether it is a UEFI or grub-related problem.  I recently (like 3 weeks ago) installed siduction on a new HP 350 G1, which has a UEFI boot system.  I replaced the OEM hdd with a Samsung SSD, set UEFI to "legacy" mode, and partitioned it in advance using GPT.  Here is the layout, and the contents of the /boot directory:


Code: [Select]
root@HP-350G1:/# blkid -c /dev/null -o list
device             fs_type   label      mount point            UUID
---------------------------------------------------------------------------------------------------
/dev/sda1          ext4                 /                      223028f5-d048-4314-825e-a01fa84e1c80
/dev/sda2          swap                 <swap>                 1aad0591-0649-4754-82d7-e903e3d42396
/dev/sda3          ext4      DATA       /mnt/DATA              a4e3ec5d-f62b-4e66-a998-c6053ff07675
root@HP-350G1:/# ls /boot
config-3.17-4.towo-siduction-amd64        memtest86+_multiboot.bin
config-3.18-0.towo.3-siduction-amd64      System.map-3.17-4.towo-siduction-amd64
config-3.18-0.towo-siduction-amd64        System.map-3.18-0.towo.3-siduction-amd64
config-3.18-1.towo-siduction-amd64        System.map-3.18-0.towo-siduction-amd64
grub                                      System.map-3.18-1.towo-siduction-amd64
initrd.img-3.17-4.towo-siduction-amd64    vmlinuz-3.17-4.towo-siduction-amd64
initrd.img-3.18-0.towo.3-siduction-amd64  vmlinuz-3.18-0.towo.3-siduction-amd64
initrd.img-3.18-0.towo-siduction-amd64    vmlinuz-3.18-0.towo-siduction-amd64
initrd.img-3.18-1.towo-siduction-amd64    vmlinuz-3.18-1.towo-siduction-amd64
memtest86+.bin
root@HP-350G1:/# ls /boot/grub
fonts  grub.cfg  grubenv  i386-pc  locale  unicode.pf2


As you can see, I left /boot under the / filesystem.  It is a "plain vanilla" configuration except for the data partition mounted under /mnt. From grub, it boots to the KDE desktop in about 10 seconds.
Title: Re: Unable to boot after install
Post by: piper on 2014/12/27, 13:34:57
I  agree with dibl, keep it simple for first install, then mess with LUKS/encryption
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/27, 17:58:02
With just using gparted to make a single ext4 partition, it installs and then boots in legacy mode. Is there anything I can post from a working install that would help indicate why it does not boot if there is a separate /boot partition?
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/27, 18:40:44
Are you saying that if you make a separate small partition, like 500MB, and try to install using that one as /boot, and the rest as /, it won't boot?  Can you tell by looking at it from the live CD session whether it appears to be installed correctly, i.e. that the /boot and /boot/grub files are as expected (see my post above), and the rest of the system is on the / partition? if so, it starts to sound like a grub configuration problem, and if we take a look at /boot/grub/grub.cfg we might be able to discover what's going on, by comparing the UUID that it is trying to boot with the UUID of the /boot partition.
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/27, 19:27:12
Are you saying that if you make a separate small partition, like 500MB, and try to install using that one as /boot, and the rest as /, it won't boot?  Can you tell by looking at it from the live CD session whether it appears to be installed correctly, i.e. that the /boot and /boot/grub files are as expected (see my post above), and the rest of the system is on the / partition? if so, it starts to sound like a grub configuration problem, and if we take a look at /boot/grub/grub.cfg we might be able to discover what's going on, by comparing the UUID that it is trying to boot with the UUID of the /boot partition.

Previously, I was referring to a monolithic partition with everything under / as working. But what you suggested also works: 2 partitions with sda1 for /boot and sda2 for /. The first grub entry looks like

Code: [Select]
menuentry 'siduction 2014.1.0 indiansummer (kde) GNU/Linux' --class siduction --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f696379f-0ec1-4648-b75a-8dce2c1b1281' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  d184bfa3-8709-40c1-aea9-502fcb348bb7
        else
          search --no-floppy --fs-uuid --set=root d184bfa3-8709-40c1-aea9-502fcb348bb7
        fi
        echo    'Loading Linux 3.17-4.towo-siduction-amd64 ...'
        linux   /vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=f696379f-0ec1-4648-b75a-8dce2c1b1281 ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.17-4.towo-siduction-amd64
}

That looks fine. In contrast, when I was following the LUKS / crypt instructions ( http://manual.siduction.org/hd-install-crypt (http://manual.siduction.org/hd-install-crypt) ), the grub entry was

Code: [Select]
menuentry 'siduction 2014.1.0 indiansummer (kde) GNU/Linux' --class siduction --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9c22cdf9-a031-4a23-b072-2c8c22560aff' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/VfAVdP-2ADN-nddZ-A6sq-Ou8X-30Yx-cqlRH5/P1gjSR-9Fpw-F5sw-Y2wO-BdwT-x7BI-NEezyI'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/VfAVdP-2ADN-nddZ-A6sq-Ou8X-30Yx-cqlRH5/P1gjSR-9Fpw-F5sw-Y2wO-BdwT-x7BI-NEezyI'  cd6dafd2-d495-42f9-8b21-6ea9d8423d39
        else
          search --no-floppy --fs-uuid --set=root cd6dafd2-d495-42f9-8b21-6ea9d8423d39
        fi
        echo    'Loading Linux 3.17-4.towo-siduction-amd64 ...'
        linux   /vmlinuz-3.17-4.towo-siduction-amd64 root=/dev/mapper/stuff-root ro cryptopts=source=/dev/mapper/T540p-notboot,target=notboot,lvm=/dev/stuff/root quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.17-4.towo-siduction-amd64
}

which did not boot.

I could get by with an unencrypted / and /boot as long as my home directory and data partition were encrypted. I presume it would automatically prompt me to unlock the encrypted partition before it attempted to access anything under the home directory, right?
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/27, 19:35:44
I have never needed to set up an encrypted system, so I'm pretty useless on that front.  What little I have ever read about it suggests that you only really need your data and your swap partition encrypted -- no benefit to encrypting the OS itself.  If there's no need to split /boot off from /, then I think you need three partitions and I think / (including /boot) does not need to be encrypted.  If you can get it booting / correctly, then you can limit the challenge to setting up the encrypted data and swap partitions, and not have to fight a booting issue.  But you should check my theory that the OS does not need to be encrypted against whatever google can serve up on the topic.
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/27, 19:43:45
Looks like Arch wiki (https://wiki.archlinux.org/index.php/disk_encryption) has good guidance for you.  Note that you need to modify /etc/fstab to mount /tmp and selected /var directories on a tmpfs to protect temporary files that could compromise user information.
Title: Re: Unable to boot after install
Post by: melmarker on 2014/12/27, 22:22:37
and beware of bugs in initramfs - there may be problems with  asking for password (programs needed not in initramfs) - i see such a thing times ago in the forum. my suggestion was to add the needed parts to initramfs
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/27, 23:15:23

I could get by with an unencrypted / and /boot as long as my home directory and data partition were encrypted. I presume it would automatically prompt me to unlock the encrypted partition before it attempted to access anything under the home directory, right?

That didn't quite work. It did find grub on sda1 but didn't ask for the password to unlock the encrypted volume on sda2. Thus, it timed out looking for the UUIDs of the things within the encrypted volume (/home, /opt/, and /var/tmp). When it couldn't setup /var/tmp, it didn't want to continue booting. Does anyone know where the hook goes to unlock an encrypted volume? When I set up LUKS previously (i.e. when / was part of the encrypted volume), the computer just asked for the password right after grub handed over control.
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/28, 04:30:07
That didn't quite work. It did find grub on sda1 but didn't ask for the password to unlock the encrypted volume on sda2. Thus, it timed out looking for the UUIDs of the things within the encrypted volume (/home, /opt/, and /var/tmp). When it couldn't setup /var/tmp, it didn't want to continue booting. Does anyone know where the hook goes to unlock an encrypted volume? When I set up LUKS previously (i.e. when / was part of the encrypted volume), the computer just asked for the password right after grub handed over control.

Answer: /etc/crypttab, which wasn't generated automatically by the siduction installer.

It is almost working now. The only problem is that /grub/grub.cfg uses the wrong UUID for root while the one in /boot/grub/grub.cfg is correct:

Code: [Select]
root@T540p:/home/goodrich# grep -F "UUID" /boot/grub/grub.cfg
        linux   /boot/vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro  quiet
                linux   /boot/vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro  quiet
                linux   /vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro  quiet
root@T540p:/home/goodrich# grep -F "UUID" /grub/grub.cfg
        linux   /vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=f696379f-0ec1-4648-b75a-8dce2c1b1281 ro  quiet
                linux   /vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=f696379f-0ec1-4648-b75a-8dce2c1b1281 ro  quiet
        linux /boot/vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro quiet
                linux /boot/vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro quiet
                linux /boot/vmlinuz-3.17-4.towo-siduction-amd64 root=UUID=d184bfa3-8709-40c1-aea9-502fcb348bb7 ro quiet

If I type e in grub to edit the command and replace the f6... with the d1..., then it boots fine. What is the best way to fix this?
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/28, 10:19:45

If I type e in grub to edit the command and replace the f6... with the d1..., then it boots fine.


Do that, then at the root prompt run


Code: [Select]
update-grub
Title: Re: Unable to boot after install
Post by: bgoodri on 2014/12/28, 18:38:27
update-grub seems to update the grub.cfg under /boot/grub but it boots using the grub.cfg under /grub

Code: [Select]
root@T540p:/home/goodrich# ls -l /boot/grub/grub.cfg
-r--r--r-- 1 root root 8882 Dec 28 01:05 /boot/grub/grub.cfg
root@T540p:/home/goodrich# ls -l /grub/grub.cfg
-r--r--r-- 1 root root 9109 Dec 27 12:52 /grub/grub.cfg
root@T540p:/home/goodrich# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.18-1.towo-siduction-amd64
Found initrd image: /boot/initrd.img-3.18-1.towo-siduction-amd64
Found linux image: /boot/vmlinuz-3.17-4.towo-siduction-amd64
Found initrd image: /boot/initrd.img-3.17-4.towo-siduction-amd64
Found linux image: /vmlinuz-3.17-4.towo-siduction-amd64
Found initrd image: //initrd.img-3.17-4.towo-siduction-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
done
root@T540p:/home/goodrich# ls -l /boot/grub/grub.cfg
-r--r--r-- 1 root root 8882 Dec 28 12:29 /boot/grub/grub.cfg
root@T540p:/home/goodrich# ls -l /grub/grub.cfg
-r--r--r-- 1 root root 9109 Dec 27 12:52 /grub/grub.cfg

I know that it boots with the grub.cfg under /grub because that one does not have any entries for the 3.18 kernel

Code: [Select]
root@T540p:/home/goodrich# grep -c -F "3.18" /grub/grub.cfg
0

Should I just symlink /grub to /boot/grub?
Title: Re: Unable to boot after install
Post by: dibl on 2014/12/28, 22:28:33
... it boots using the grub.cfg under /grub


Where did that come from?  /grub is a subdirectory under /boot.  You can symlink it, I suppose, so it will boot, but it is not the correct configuration and bad things might happen when grub or related packages get an update. For example, when a new kernel is installed, update-grub will run, and /boot/grub/grub.cfg will be updated.
Title: Re: Unable to boot after install
Post by: piper on 2014/12/28, 23:12:29
grub.cfg is automatically generated by grub-mkconfig using templates
from /etc/grub.d and settings from /etc/default/grub and really shouldn't be edited in normal conditions

update-grub, update-grub2 - stub for grub-mkconfig