0

The layout of my current disk is:

enter image description here

I am following the advice from https://unix.stackexchange.com/a/501410/674 to rearrange the partitions on the disk. Are the following steps ok?

  • shrink sda3 (/) to 60G, and leave a 204G unallocated region at the end of the disk (I have done this)
  • move sda4 (/home) to the front of the 93G unallocated space (this step is in progress)
  • move sda3 (/) to the end of the disk, i.e. behind the 204G newly unallocated region, so that the two unallocated regions (93G and 204G) are merged into one 297G unallocated region.
  • extend sda4 (/home) to include the 297G unallocated region

I am now performing the second step in gparted from a live Lubuntu, and gparted warned me that if the partition to be moved contains /boot or is Windows system partition C:, moving the partition most likely fails to boot. I have a bios grub partition, a root partition and a home partition. /boot is in partition sda3 (/). Will I be able to move sda3 (/) to the end of the disk in step 3, without failing to boot? It seems that I will need to reinstall grub according to https://askubuntu.com/questions/299886/partitions-is-it-safe-to-move-partition-containing-boot and https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Update: after following the above steps, the layout of the disk is

enter image description here

I don't need to do anything with grub, and can reboot into Lubuntu on the disk successfully. Why do I not need to do anything with grub, after moving partition sda3 (/) containing /boot? Can it be because the region originally occupied by sda3 (/) is currently unused in sda4 (/home)? How can I verify my Lubuntu was booted from the relocated sda3 (/) not from its original region now free space in sda4 (/home)?

$ cat /boot/grub/grub.cfg |grep boot
   set boot_once=true
  set boot_once=true
  if [ -z "${boot_once}" ]; then
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
        linux   /boot/vmlinuz-4.15.0-45-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-4.15.0-45-generic
            linux   /boot/vmlinuz-4.15.0-45-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-45-generic
            linux   /boot/vmlinuz-4.15.0-45-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-45-generic
            linux   /boot/vmlinuz-4.15.0-44-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-44-generic
            linux   /boot/vmlinuz-4.15.0-44-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-44-generic
            linux   /boot/vmlinuz-4.15.0-43-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-43-generic
            linux   /boot/vmlinuz-4.15.0-43-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-43-generic
            linux   /boot/vmlinuz-4.15.0-42-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-42-generic
            linux   /boot/vmlinuz-4.15.0-42-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-42-generic
            linux   /boot/vmlinuz-4.15.0-39-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-39-generic
            linux   /boot/vmlinuz-4.15.0-39-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-39-generic
            linux   /boot/vmlinuz-4.15.0-38-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-38-generic
            linux   /boot/vmlinuz-4.15.0-38-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-38-generic
            linux   /boot/vmlinuz-4.15.0-36-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-36-generic
            linux   /boot/vmlinuz-4.15.0-36-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-36-generic
            linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-4.15.0-33-generic
            linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=d0fed0a4-c82a-414e-8fb2-aa10070bf938 ro recovery nomodeset 
        initrd  /boot/initrd.img-4.15.0-33-generic
    knetbsd /boot/memtest86+.elf
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8

Thanks.

  • Perhaps look in to how the bios_grub flagged partition is involved in the boot process and how gparted treats this situation. To make your system fail to boot, if it is somehow (unlikely) using a supposed to be blank area to boot from, would be to zero (or TRIM/discard for SSD) the data in that area of the disk. To zero practically all free space on a disk you can use the dd tool with something like dd if=/dev/zero of=~/zero.tmp bs=1M; sync; rm ~/zero.tmp – BeowulfNode42 Mar 10 at 2:25
  • Note: don't run that dd command on an SSD, it will shorten the life of your disk. If using an SSD see the fstrim command man7.org/linux/man-pages/man8/fstrim.8.html – BeowulfNode42 Mar 10 at 2:30

Your Answer

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

Browse other questions tagged or ask your own question.