Partitions. is it safe to move partition containing /boot?

I am running dualboot (Windows 7 and Ubuntu 12.04) and I would like to make more space for my Ubuntu partition. I am doing it from a live cd through gparted.

I was about to resize my windows partition to get unallocated space and resized my ubuntu to fill it. But then i got this:

"Moving a partition might cause your operating system to fail to boot.

You have queued an operation to move the start sector of partition /dev/sda3. Failure to boot is most likely to occur if you move the GNU/Linux partition containing /boot, or if you move the Windows system partition C:. You can learn how to repair the boot configuration in the GParted FAQ. http://gparted.org/faq.php

Moving a partition might take a very long time to apply."

I got scared and didn't dare to do it, but I still want more space on my ubuntu partition. What should I do ?

Thank you so much in advance

Markus


Solution 1:

It cannot be said enough, make a backup and confirm it actually has the required data in it before making a system change like this.

That said, I find that if I move the starting block location of the boot drive (eg from sector 63 to 2048) I have to reinstall grub before the system will boot. For info on how see the ubuntu page How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB.

Solution 2:

I slightly modified the position and size of my / partition using GParted from an Ubuntu 15.04 Live USB key. I had previously bit-for-bit copied it from a magnetic HDD to this SSD and wanted to align the partitions.

At the start I had Grub installed both on the disk itself and on another disk. After moving/resizing the partition I used the instructions linked to from the GParted FAQ that you referenced.

For partition /dev/sdc2 on my Grub 2-based Ubuntu machine with no LVM/RAID this was:

sudo -i
mkdir /tmp/mydir
mount /dev/sda5 /tmp/mydir
mount --bind /dev /tmp/mydir/dev
mount --bind /proc /tmp/mydir/proc
mount --bind /sys /tmp/mydir/sys
chroot /tmp/mydir
grub-install /dev/sdc
exit
reboot

Be sure to replace both the partition and disk with the correct ones for you, and check the actual linked instructions if you have a dissimilar setup.

This may not have been necesssary because the other disk I had Grub installed to was still able to boot the system.

Solution 3:

If you move the partition that contains /boot (usually where Ubuntu is installed), Grub will not be able to load and will go into a recovery line mode when booting up your computer.

I myself haven't moved my Partition to give me more room because of that scary message.

For this next step, make sure you have a Ubuntu live CD/USB on you to boot from.

Make sure to backup all your important files, then use your GParted live CD to move the partition you want to move.

Then reboot your computer, boot into your Ubuntu live CD/USB, and with a Terminal, run sudo update-grub. If that doesn't run, try sudo apt-get install --reinstall grub && sudo grub-install. Then sudo update-grub.

Hopefully this works.