1

I'm following the official article on how to install GParted Live on Hard Disk using GRUB https://gparted.org/livehd.php but I am unable to get it to work. I've created a FAT partition on /dev/sdb3, mounted to /mnt, extracted all the files from the zip file and renamed the folder live to live-hd, just as they say. Next, I've added the boot entry:

menuentry "GParted live" {
  set root=(hd1,3)
  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/sdb3 toram=filesystem.squashfs
  initrd /live-hd/initrd.img
}

Then updated grub sudo update-grub2. But when I boot to GParted I get an error:

Invalid sector size 65535
You need to load kernel first

As I understand it, (hd0,4) means the first disk, 4th partition (/dev/sdb4) so in my case that would be my second disk, 3rd partition so (hd1,3) /dev/sdb3. What am I doing wrong?

This is the layout of my disk:

$ parted -l
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sdb: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system     Name                  Flags
 1      1049kB  135MB  134MB  linux-swap(v1)  linux-swap            swap
 2      135MB   673MB  538MB  fat32           EFI System Partition  boot, esp
 4      673MB   249GB  249GB  ext4            Ubuntu 20.04
 3      249GB   250GB  629MB  fat32           GPARTED               msftdata

UPDATE

I looked at my other GRUB entries that I have in /boot/grub/grub.cfg and here is one that I use to boot my Ubuntu 20.04 and Windows

# Ubuntu 20.04
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0f745246-0966-49bb-8aff-b832b71a53a0' {
  recordfail
  load_video
  gfxmode $linux_gfx_mode
  insmod gzio
  if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
  insmod part_gpt
  insmod ext2
  set root='hd1,gpt4'
  if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  0f745246-0966-49bb-8aff-b832b71a53a0
  else
   search --no-floppy --fs-uuid --set=root 0f745246-0966-49bb-8aff-b832b71a53a0
  fi
  linux /boot/vmlinuz-5.13.0-39-generic root=UUID=0f745246-0966-49bb-8aff-b832b71a53a0 ro  
  initrd  /boot/initrd.img-5.13.0-39-generic
}

# Windows
menuentry 'Windows Boot Manager (on /dev/sdb2)' --class windows --class os $menuentry_id_option 'osprober-efi-94C2-ECC1' {
  insmod part_gpt
  insmod fat
  set root='hd1,gpt2'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  94C2-ECC1
  else
    search --no-floppy --fs-uuid --set=root 94C2-ECC1
  fi
  chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

So I changed my entry for GParted to this

 menuentry "Gparted live" {
  insmod part_gpt
  insmod ext2
  insmod fat
  set root='hd1,gpt3'
  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=UUID=606E-0DF2 toram=filesystem.squashfs
  initrd /live-hd/initrd.img
}

I changed the entry

set root=(hd1,3)

to

set root='hd1,gpt3'

but I get an error disk hd1,gpt3 not found

For testing I added a separate entry to boot my Ubuntu into rescue mode:

menuentry "Ubuntu Runlevel 1" {
  insmod gzio
  insmod part_gpt
  insmod ext2
  set root='hd1,gpt4'
  linux /boot/vmlinuz-5.13.0-39-generic root=UUID=0f745246-0966-49bb-8aff-b832b71a53a0 ro 1
  initrd /boot/initrd.img-5.13.0-39-generic
}

So here set root='hd1,gpt4' and partition UUID are the same as in my normal boot entry for Ubuntu but it doesn't work.

1
  • Boot drive is always hd0. So depending on which drive you boot from may make a difference with hdX entry. I use same entry and boot from different drives and have to manually edit the hdX to correct number depending on drive booted. Sometimes I just have to experiment.
    – oldfred
    Apr 9, 2022 at 2:36

1 Answer 1

1

After investigating it for a while I finally found solution to my problem. Here's my final GRUB2 menu entry.

menuentry "Gparted live" {
  insmod part_gpt
  insmod ext2
  insmod fat
  set root='hd1,gpt3'
  search --no-floppy --fs-uuid --set=root 606E-0DF2
  linux /live-hd/vmlinuz root=/dev/sdb3 boot=live config union=overlay username=user components noswap noeject vga=788 ip= net.ifnames=0 live-media-path=/live-hd toram=filesystem.squashfs
  initrd /live-hd/initrd.img
}

I made a few modifications to my original code so I can't tell what exact solve it. I added search --no-floppy --fs-uuid --set=root 606E-0DF2 line and moved root=/dev/sdb3 to the first argument to linux

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .