LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-08-2016, 09:45 PM   #1
qombi
Member
 
Registered: Jan 2016
Posts: 34

Rep: Reputation: Disabled
Debian Boot Failure Luks on LVM


Any seasoned gnu/linux gurus out there that would be willing to assist me in troubleshooting a Debian boot failure? I have read forum post and articles to gain as much knowledge as possible. I still feel unsure on how to proceed further. I never found I felt clear information in regards to Grub2 boot failures w/ LUKS on LVM.

My drives are all part of one volume group volumegroup. In the volume group is the following logical volumes; lv_boot, lv_home, lv_root, and lv_share. On top of the logical volumes are LUKS encrypted partitions; lv_home > home_crypt, lv_root > root_crypt, and lv_share > share_crypt.

This is a home personal file server, Debian Wheezy 7.9. It hasn't been rebooted in most likely six months. The only changes I have made are apt-get upgrades to the server. Note, I haven't rebooted since the last upgrade for sure and possibly haven't after previous ones. I rebooted yesterday and was presented with error message "error: no such device: f6b77c56-72da-413b-8bc6-be03b724fdbf Entering rescue mode ... grub rescue>. From the prompt executed command ls to display (hd0) (hd1) (hd2) (hd3) and the set command to display prefix=(hd0)/grub root=hd0 I assume this is normal since my /boot partition is on an lv.

I booted from a live Knoppix disk and was able to activate the LVs, luksOpen all of the encrypted partitions, and mount all without issue. I was also able to fsck -C -V -f each partition and all passed. I also executed smartctl and tested each physical drive and they passed without errors. The only thing I can think may have possibly caused this issue is either a virus, an upgrade, or possibly disk corruption? I hope it isn't a virus, I haven't seen odd behavior until now.

I have read of the possibility of chrooting to my / from a live distro, and executing a grub-install. I haven't ever performed this before. Also wasn't sure if it would work with the lvm/luks configuration. I am a little nervous though, would love advice before doing anything. I also would like to try to understand what has happened. Below I have pasted information in regards to my system. Where should I go next? Thanks so much.



blkid output below, please note the error missing UUID matches /dev/mapper/lv_boot, so that is the correct UUID.


/dev/sda1: UUID="0YgaZr-eS1S-Oavg-Eivj-lJM0-MeVV-CBWVp0" TYPE="LVM2_member"
/dev/sdb1: UUID="MMCG1D-VYlS-DpbG-8G7Q-voxK-fW4W-FHvSfZ" TYPE="LVM2_member"
/dev/sdc: UUID="CzyLmN-KcDr-4ZzT-fdDl-byBs-OPIe-JB5CXf" TYPE="LVM2_member"
/dev/sdd: UUID="d3l2c5-xePC-wxAe-Vxxo-AAhg-DTV2-n2Akpm" TYPE="LVM2_member"
/dev/mapper/lv_boot: LABEL="boot" UUID="f6b77c56-72da-413b-8bc6-be03b724fdbf" TYPE="ext2"
/dev/mapper/lv_root: UUID="05201dc1-a2db-461b-a999-f8e7d40e46c8" TYPE="crypto_LUKS"
/dev/mapper/lv_share: UUID="d921c506-3fa3-46da-9626-1e70668aa2b2" TYPE="crypto_LUKS"
/dev/mapper/lv_home: UUID="fb8038a8-6020-47f6-8cac-fa2599bd3101" TYPE="crypto_LUKS"
/dev/mapper/root_crypt: LABEL="root" UUID="4d5edea4-ec99-4d2e-ade1-1322c7594b2b" TYPE="ext4"
/dev/mapper/share_crypt: LABEL="share" UUID="63503a9f-ff15-4897-a5d2-ad1523c3e63c" TYPE="ext4"
/dev/mapper/home_crypt: LABEL="home" UUID="eee20a81-0c28-4f94-98ba-bcdf21c83f45" TYPE="ext4"

cat crypttab:

root_crypt UUID=05201dc1-a2db-461b-a999-f8e7d40e46c8 none luks
swap_crypt /dev/mapper/swap /dev/urandom cipher=aes-xts-plain64,size=256,swap
home_crypt UUID=fb8038a8-6020-47f6-8cac-fa2599bd3101 /root/afile luks
share_crypt UUID=d921c506-3fa3-46da-9626-1e70668aa2b2 /root/afile luks


cat fstab:

# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/root_crypt / ext4 errors=remount-ro 0 1
/dev/mapper/lv_boot /boot ext2 defaults 0 2
/dev/mapper/home_crypt /home ext4 defaults 0 2
/dev/mapper/share_crypt /share ext4 defaults 0 2
/dev/mapper/swap_crypt none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0

cat grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

cat grub.cfg:

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os {
load_video
insmod gzio

echo 'Loading Linux 3.2.0-4-amd64 ...'
linux /vmlinuz-3.2.0-4-amd64 root=/dev/mapper/root_crypt ro quiet
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.2.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
load_video
insmod gzio

echo 'Loading Linux 3.2.0-4-amd64 ...'
linux /vmlinuz-3.2.0-4-amd64 root=/dev/mapper/root_crypt ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.2.0-4-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
 
Old 01-10-2016, 07:33 AM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
It looks like your missing this
Code:
GRUB_PRELOAD_MODULES="lvm"
in /etc/default/grub
 
Old 01-10-2016, 10:05 AM   #3
qombi
Member
 
Registered: Jan 2016
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thanks for the information. I actually added that to /etc/default/grub and chroot'd to my / and executed grub-install. I received an error message in regards to pv0 not found but my system boots again. I believe the error message is a bug in grub per what I have read after extending lvs.
 
  


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
How to set up custom boot backgrounds from boot to login with LVM and LUKS? spudzy Linux - Software 1 10-09-2014 09:03 AM
[SOLVED] lilo: dual boot luks with lvm BashTin Slackware 4 07-17-2014 06:54 AM
[SOLVED] Trouble shooting boot failure with uefi+lvm on luks Phorize Slackware 5 12-04-2013 02:33 PM
[SOLVED] Mount a Fedora Luks/LVM in Debian 7 Zyblin Linux - Software 5 11-09-2013 12:44 AM
LUKS LVM with usb token at boot mrmnemo Ubuntu 3 02-26-2011 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:34 AM.

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