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

 

 

 

Create grub2 backup

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
fant0mask
Posts: 5
Joined: 2018-01-30 09:25

Create grub2 backup

#1 Post by fant0mask »

I've installed my debian along a version of Windows 10. I have encrypted my debian lvm volume with luks. The grub2 boot file I installed on a USB stick. I would like to make a exact copy of the USB stick containing the grub2 in case if I loose my existing one.
Can anyone guide me how to achieve this, as I have tried numerous tutorials but I was unable to fully complete it.
Thanks

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Create grub2 backup

#2 Post by Head_on_a_Stick »

fant0mask wrote:I have tried numerous tutorials but I was unable to fully complete it
You should list all of the methods you have already tried (along with full, verbatim error messages in the case of failure) in order to prevent duplication of effort by those who chose to assist you.

I would use

Code: Select all

# cp /dev/sdX /dev/sdY ; sync
Did you try that?
deadbang

fant0mask
Posts: 5
Joined: 2018-01-30 09:25

Re: Create grub2 backup

#3 Post by fant0mask »

Thank you for your reply.
I have tried to execute

Code: Select all

 # cp /dev/sdX /dev/sdY ; sync 
After booting, I get the following error:

Code: Select all

error: attempt to read or write outside of partition
Entering rescue mode...
grub rescue> 
I have tried to:

Code: Select all

set root=(hd0,msdos1)
set prefix=(hd0,msdos1)/boot/grub
insmod normal
and after I get again the error: attempt to read or write outside of partition

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Create grub2 backup

#4 Post by Head_on_a_Stick »

OK, a few things:
  • Did you actually type "/dev/sdX" & "/dev/sdY"? That won't work.
  • Was stick Y at least as big (if not bigger) than stick X?
I've never used LVM or LUKS so I'm probably missing some important detail.

Is your system UEFI?

How _exactly_ did you do this:
The grub2 boot file I installed on a USB stick
If this is a non-UEFI system on an msdos partition table then I think you only need the first 447 bytes of the MBR on the stick to boot.

The `cp` command should do that but you could save time by using dd(1) instead.
deadbang

Post Reply