LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-30-2016, 01:31 AM   #1
linuxStudent11
Member
 
Registered: Jun 2007
Posts: 164

Rep: Reputation: 18
Grub Boot Problem (Encrypted LVM) From Hell


I use Debian 8.

I have a nice backup system using rsync per this backup post..
Then my hard disk self-destructed.
The problem is the above post refers only to a cleartext installation, not encrypted lvm.
So IIRC I created a NEW encrypted lvm installation on a NEW disk, copied in the old grub.cfg file, and changed IDs....using a parallel installation.
  1. I changed the uuid of the /boot partition (in grub.cfg)
  2. I changed the uuid of the encrypted lvm partition
  3. ...similar changes to the /etc/fstab and /etc/cryptab (using losetup...I forget)
  4. I merged the old .mod files into the new /grub/...
  5. And I discovered I needed to change the LVM id of 2. above (how do I get this conveniently?)
At this point it actually worked...after a fashion. It bitched and moaned about some unknown disk not being present...which I could never find. It did this for 1.5 minutes. Then it came up.
Then I did another backup.

THEN I DID A SYSTEM UPDATE.

The grub update trashed everything. System is now completely and unbootably broken.

HHHAAAAAALLLPPP!!!!!
Ideally I'd love to create my own grub.cfg files. I'm learning never to trust grub updates, especially on encrypted lvm installs. Can someone recommend a great webpage for manually creating one's own grub.cfg? ...please?
 
Old 08-30-2016, 02:11 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Linux From Scratch uses grub but it doesn't have any grub scripts. You are expected to make your own grub.cfg and there is a section in the book on how to do it. How that would work with encrypted disks, I don't know. The example given is for a simple set-up.
 
Old 09-06-2016, 07:43 AM   #3
linuxStudent11
Member
 
Registered: Jun 2007
Posts: 164

Original Poster
Rep: Reputation: 18
I answered my own questions and solved my own problem(s) in this thread. I'll post my solution(s) soon.
The short answer(s) is that you ALSO need to delete then recreate the initramfs along with grub and everything else.
If you want my full solution sooner rather than later, just ask.
Best URLs to read:
  1. theory: https://en.wikipedia.org/wiki/Initrd
  2. theory: https://en.wikipedia.org/wiki/initramfs
  3. theory: https://en.wikipedia.org/wiki/Linux_startup_process
  4. theory/practice: https://www.gnu.org/software/grub/ma...index.html#Top
  5. theory/practice: https://wiki.archlinux.org/index.php/GRUB
  6. practice(BEST): https://ubuntuforums.org/showthread.php?t=2266650
    -- this almost better than all the rest put together...almost
    -- also need to bind mount /sys/ in above
  7. the man page on update-initramfs (use the -d first, THEN -c)
The above technique is outstanding for doing a total system recovery from rsync backup of a complete encrypted LVM system,. This is after a total encrypted/lvm disk crash.

I suspect I will bash script the whole process...just to make life simpler for next time. reference my previous backup thread here.

Last edited by linuxStudent11; 09-06-2016 at 07:53 AM. Reason: afterthought
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recover grub on a dual boot machine with encrypted LVM mzzxx11 Linux - Newbie 2 10-19-2015 12:41 PM
Dual Boot with Encrypted LVM GhengisCan Linux - General 1 07-12-2014 05:42 AM
Resizable encrypted LVM requiring just one password on boot (encrypted volume group)? Nyyr Linux - Software 9 01-24-2013 05:52 AM
[SOLVED] Recovering grub after Windows installation. Encrypted partitions and LVM. 1937 Debian 6 11-04-2010 05:22 PM
Grub/LVM boot problem jkoshi Fedora 6 02-28-2007 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:29 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