0

I want to make a backup copy of one disk to another using the dd mode of Clonezilla, this using the advanced options of "e2, j2, icds, and iefi" which have their descriptions in the advanced menu of Clonezilla, referenced in that link:

  1. "e2": sfdisk uses CHS of hard drive from EDD (for non-GRUB boot loader) CHS are the Cylinders, Heads, and Sectors of the EDD (assuming Existing Disk Drive).
  2. "j2": Clone Hidden Data between the MBR and the first partition
  3. "icds": Skip checking destination disk size before creating the partition table "
  4. iefi": Skip updating entries in NVI boot RAM after cloning

After completing the disk-to-disk clone from Clonezilla, there is still the issue that the GRUB UUID's are not correct, since GRUB still has the configuration of the drive that was copied.

From the Stack Exchange Ask Ubuntu Question, "How to change UUID in the /boot/grub/grub.cfg", there are a number of interesting approaches.

For instance there is the answer from that link from "Pierre ALBARÈDE":

You can directly change the UUID in /boot/grub/grub.cfg as you did. /boot/grub/grub.cfg is not updated automatically. However, if you want to preserve bootability you also need to change the UUID accordingly elsewhere, for example, with EFI/UEFI booting, in /boot/efi/EFI/ubuntu/grub.cfg and /etc/fstab.

Also, "Vojtech Trefny" documents how it is possible to boot to GRUB from the computer's BIOS boot menu in his answer to the question, "How to get to the GRUB menu at boot-time?"

Menu will appear if you press and hold Shift during loading Grub, if you boot using BIOS. When your system boots using UEFI, press Esc.

For permanent change you'll need to edit your /etc/default/grub file:

Place a # symbol at the start of line GRUB_HIDDEN_TIMEOUT=0 to comment it out. If that line doesn't exist, then you can comment out this line instead: # GRUB_TIMEOUT_STYLE=hidden, and then change GRUB_TIMEOUT=0 to GRUB_TIMEOUT=5, for instance, to give the grub menu a 5 second timeout before it automatically logs you in.

Save changes and run sudo update-grub to apply changes.

Documentation: https://help.ubuntu.com/community/Grub2

Is the answer to the question "How to change UUID in the /boot/grub/grub.cfg" given by "Pierre ALBARÈDE" the best approach? There are a number of options in that article, and I am still a little confused as to what the best approach from there or from somewhere else is. Still. when I issue the command "sudo blkid" to get the UUID's for all the disks on the system, I get an entry for the EFI (boot) partition sdc5 as:

sudo blkid

/dev/sdc5: UUID="1887-E4A1" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="d05239a5-e32f-4d3c-bc80-76bca4afb0b8"

There is the UUID and there is the Part UUID. Which UUID needs to be added to the GRUB menu? (I guess that I could inspect the menu of the source disk that I am duplicating to figure this out, but I am hoping that this part of the question can also be addressed in the answer.)

  1. The etc/defualt/grub file can be modified to allow a choice of boot options and "e" can be used to successfully boot to Ubuntu form the disk:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=menu GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""

#enable OS PROBER GRUB_DISABLE_OS_PROBER=false

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `vbeinfo'

#GRUB_GFXMODE=640x480

Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start

#GRUB_INIT_TUNE="480 440 1"

After that, the answer to the question "How to change UUID in the /boot/grub/grub.cfg" given by "Pierre ALBARÈDE" can be used to update the UUID's in: Directly change the UUID's in /boot/grub/grub.cfg (since /boot/grub/grub.cfg is not updated automatically), and also in /boot/efi/EFI/ubuntu/grub.cfg and also in /etc/fstab. Then run sudo update-grub.

Am I missing something in the steps needed to update the files that sudo update-grub does not update and then run sudo update-grub once booted into the new disk.

What is the best approach, so that the new cloned disk can boot, just like the old one, with the proper UUID's in each of the respective's configuration files?

  • I prefer new clean install & rsync data, list of installed apps, & any server apps in / (root) from your normal backup into new install. Proves backup is complete when you still have working install. And avoids all the issues of updating UUIDs/GUIDs in fstab, swap, & ESP (if UEFI). And you you clone again to refresh copy, you have to go thru the change of UUIDs again. If you do not rsync anything with UUID/GUIDs, you can then regularly update "clone". – oldfred Mar 28 '24 at 13:12

0 Answers0