I'm trying to extend my Ubuntu partition by shrinking down my Windows partition. Using Windows Disk Management Tool I've shrinked out 99.67 Gb and now I have it unallocated. I need to add this 99.67 Gb to my Ubuntu root partition.

I'm using GParted and following this tutorial.

Here's what the df command prints out:

➜  ~ df
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             1951080       12   1951068   1% /dev
tmpfs             392684     1040    391644   1% /run
/dev/sda8       50264772 45937836   1750552  97% /
none                   4        0         4   0% /sys/fs/cgroup
none                5120        0      5120   0% /run/lock
none             1963416        0   1963416   0% /run/shm
none              102400       32    102368   1% /run/user
/dev/sda1          98304    29567     68737  31% /boot/efi
shmfs            4194304  1162184   3032120  28% /dev/shm

so it seems that my Ubuntu root partition is sda8.

So, according to the tutorial, in file /etc/grub.d/40_custom I add the new menuentry. Here's how this file looks like:

exec tail -n +3 $0

menuentry "GParted Live ISO" {
    set isofile="/denis/iso/gparted-live-0.27.0-1-i686.iso"
    loopback loop (hd0,8)$isofile
    linux (loop)/vmlinuz boot=live config union=aufs noswap noprompt ip=frommedia findiso=$isofile toram=filesystem.squashfs
    initrd (loop)/live/initrd.img

However, I get this error when trying to boot "GParted Live ISO" from Grub: enter image description here and when I press any key to exit, Windows immediately starts to boot.

The iso file gparted-live-0.27.0-1-i686.iso is located in /home/denis/iso/ directory.

Could you please help me to find out what I'm doing wrong here and how to correctly load my GParted Live image from iso?

Update 1

I've investigated a bit and found the location for my iso file in /boot folder from grub, it's (hd1,gpt8)/. Here's the screenshot from Grub console: enter image description here

Here's how my new 40_custom menuentry looks like:

menuentry "GParted Live ISO" {
    set isofile="/boot/iso/gparted-live-0.27.0-1-amd64.iso"
    loopback loop (hd1,gpt8)$isofile
    linux (loop)/vmlinuz boot=live config union=aufs noswap noprompt ip=frommedia findiso=$isofile toram=filesystem.squashfs
    initrd (loop)/live/initrd.img

When I boot "GParted Live ISO" menuentry, I receive the following output: enter image description here

  • sda8 should correspond to 'hd0,7', as df counts partitions from 1, grub does from 0.
    – ridgy
    Dec 5 '16 at 13:57
  • set isofile="/home/denis/iso/gparted-live-0.27.0-1-i686.iso"
    – mook765
    Dec 5 '16 at 16:48
  • @ridgy this gives me the exact save error except now it says disk 'hd0,7' not found Dec 5 '16 at 20:39
  • Sorry, I was mistaken. Partitions really count from 1...
    – ridgy
    Dec 5 '16 at 20:49
  • @ridgy do you have any other ideas on why this error is happening? Dec 5 '16 at 21:04

Okay, here's how I finally got this working:

menuentry 'GParted 64-bit ISO' {
  set gfxpayload=text # ~= vga='normal'
  set isofile_abspath='/boot/iso/gparted-live-0.27.0-1-amd64.iso'
  set isofile_devpath="${devroot}${isofile_abspath}"
  loopback loop "(${root})${isofile_abspath}"
  linux '(loop)/live/vmlinuz' boot='live' union='overlay' username='denis' config components noswap noeject toram='filesystem.squashfs' ip='' nosplash findiso="${isofile_abspath}"
  initrd '(loop)/live/initrd.img'
  • This makes no sense. $root is not defined and $devroot is not used?
    – u628898
    May 10 '21 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.