Putting GParted Live on the hard drive and boot menu?

Bo Berglund bo.berglund at gmail.com
Sun Oct 31 09:50:30 UTC 2021


Has anyone here had success in putting GParted Live on the boot menu of your PC?

I have Windows and 2 flavours of Ubuntu 20.04.3 (desktop and server) on my boot
menu and I would love to also have GParted Live there when managing the disk
rather than attaching a USB stick and going through the hoops to make it boot
off of USB.
My system uses UEFI.

I found this how-to on the GParted homepage:
https://gparted.org/livehd.php#live-hd-grub

I tried to follow it while adjusting the description for the fact that my disk
contains a lot of partitions and the one I just added for GParted is named
/dev/nvme0n1p10, a far cry from the /dev/sda4 used in the how-to.

Its name sequence number is 10 but it is not the 10th on the drive because
/dev/nvme0n1p4 is placed *last* on the disk so 10 is actually 9 on the disk...
Partition numbers start at 1 and go all the way up to 10.

My last attempt uses this /etc/grub.d/40_custom file (lines are wrapped by my
news reader):

#!/bin/sh
exec tail -n +3 $0
# 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.
menuentry "GParted live" {
  set root=(hd0,9)
  linux /live-hd/vmlinuz boot=live config union=overlay username=user components
noswap noeject vga=788 ip= net.ifnames=0 live-media-path=/live-hd
bootfrom=/dev/nvme0n1p10 toram=filesystem.squashfs
  initrd /live-hd/initrd.img
}

But I have tried *both* 9 and 10 to no avail.

The GParted files are copied from the GParted Live ISO onto the partition 10
(formatted as ext4) and the "live" dir has been renamed "live-hd" as per the
instructions in the how-to.

sudo os-prober finds only Windows and the other Ubuntu when executed on the
desktop Ubuntu, where I manage grub.

Alternate test
--------------
On the grub-user list I got advice to use grub-imageboot and I found this
how-to:
https://itectec.com/ubuntu/ubuntu-how-to-boot-from-an-iso-file-in-grub2-duplicate/

But it also does not work even though it reaches the boot menu.
When I use the GParted entry in the menu it throws an error:

error: file '/boot/memdisk' not found.
error: you need to load the kernel first.

Unfortunetely the grub-user list seems to be pretty quiet, there are no other
replies or new posts after I received the single advice to use grub-imageboot.
:(

So I am back here...


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list