2

What I am Trying To Do: I am trying to move my root file system from its small partition on /dev/sda6 to a new larger partition on /dev/sda8.

My Problem: The small partition sda6 is still being mounted on boot, despite changing the fstab root file system UUID to the UUID of sda8.


Edit About Accepted Answer

The accepted solution takes a few steps back and just moves around and resizes partitions so that the original root and home partitions have more space. All this trouble about fstab and partitions mounted on boot is completely avoided.


What I Have Done So Far:

  1. Create new partition sda8.
  2. Copy small partition sda6 to sda8.
  3. Create new UUID for sda8.
  4. Modify sda6 (small partition) /etc/fstab file to use sda8 UUID as root file system.

I expect the problem to be related to grub, or that I am editing the old partition's fstab, or something about the new partition's fstab file. I might have a fundamental misunderstanding here.

sda6 (small partition) /etc/fstab

UUID=7aead843-45c2-4456-a1d4-02c67af0769c /               ext4    errors=remount-ro 0       1
UUID=485E-AB22  /boot/efi       vfat    umask=0077      0       1
UUID=ec4e914c-caaa-43e2-aeb2-4f346ba0411c /home           ext4    defaults        0       2
UUID=cc8208be-d94f-493a-a19f-94d7083c0f84 none            swap    sw              0       0

block ids

/dev/sda6: UUID="39c4c3de-19ec-4fea-917d-45e0a0178f76" TYPE="ext4" PARTUUID="c5096f2e-5526-4801-8612-ae385d3c3e6e"
/dev/sda8: UUID="7aead843-45c2-4456-a1d4-02c67af0769c" TYPE="ext4" PARTUUID="05db311f-a362-4ba2-8a0b-c7ae4fc2c380"

journalctl section of last boot

...
Jan 04 17:37:23 GL4D2B kernel:  sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7 sda8
Jan 04 17:37:23 GL4D2B kernel: sd 1:0:0:0: [sda] Attached SCSI disk
Jan 04 17:37:23 GL4D2B kernel: scsi 3:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: Attached scsi generic sg2 type 0
Jan 04 17:37:23 GL4D2B kernel: EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] 15360000 512-byte logical blocks: (7.86 GB/7.32 GiB)
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] Write Protect is off
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] Mode Sense: 23 00 00 00
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] No Caching mode page found
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Jan 04 17:37:23 GL4D2B kernel:  sdb: sdb1
Jan 04 17:37:23 GL4D2B kernel: sd 3:0:0:0: [sdb] Attached SCSI removable disk
Jan 04 17:37:23 GL4D2B systemd[1]: Inserted module 'autofs4'
Jan 04 17:37:23 GL4D2B systemd[1]: systemd 240 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -ID
Jan 04 17:37:23 GL4D2B systemd[1]: Detected architecture x86-64.
Jan 04 17:37:23 GL4D2B systemd[1]: Set hostname to <GL4D2B>.
Jan 04 17:37:23 GL4D2B systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
Jan 04 17:37:23 GL4D2B kernel: Lockdown: systemd: /dev/mem,kmem,port is restricted; see man kernel_lockdown.7
Jan 04 17:37:23 GL4D2B kernel: Lockdown: systemd: BPF is restricted; see man kernel_lockdown.7
Jan 04 17:37:23 GL4D2B systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
Jan 04 17:37:23 GL4D2B systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
Jan 04 17:37:23 GL4D2B systemd[1]: /lib/systemd/system/spice-vdagentd.service:8: PIDFile= references path below legacy directory /var/run/, updating /var/run/spice-vdagentd/spice-vdagentd.pid → /run/spice-vdagen
Jan 04 17:37:23 GL4D2B systemd[1]: Listening on udev Kernel Socket.
Jan 04 17:37:23 GL4D2B systemd[1]: Listening on udev Control Socket.
Jan 04 17:37:23 GL4D2B systemd[1]: Created slice system-systemd\x2dfsck.slice.
Jan 04 17:37:23 GL4D2B kernel: EXT4-fs (sda6): re-mounted. Opts: errors=remount-ro
...

Gparted Screenshot A screenshot of my disk partitions according to gparted.

7
  • Why didn't you just boot to a Ubuntu Live DVD/USB, start gparted, and then move/resize partitions to get the sizes you wanted? Anyway, you probably have to do a sudo update-grub. – heynnema Jan 4 '20 at 23:28
  • Your /EFI/ubuntu/grub.cfg uses UUID of your install to find full grub.cfg. Example: askubuntu.com/questions/957914/… Often easier just to do a new install and copy your configuration files from your backup back into system. And perhaps have separate /home so you do not need large / (root) partition. – oldfred Jan 5 '20 at 0:59
  • @heynnema I did sudo update-grub and now ubuntu on /dev/sda8 is bootable on grub menu, but when I boot it, it still mounts /dev/sda6. Also, I cannot move/resize the root partition because it is abut to other partitions on disk. – Dylan Landry Jan 5 '20 at 17:20
  • sda6 still mounts or still boots? Is your fstab and blkid output still the same as shown, or has it changed? Show me a screenshot of gparted, and I can tell you how to resize sda6 without all of this grief. – heynnema Jan 5 '20 at 17:33
  • @heynnema I've added a gparted screenshot to my question. sda6 was mounted as the root file system, for sure. Grub said I was booting into ubuntu on sda8 (had sda8 in title), but it might be that it really booted sda6. I'd like to try your resize advice first, before investigating that stuff any further. Thanks tons. – Dylan Landry Jan 5 '20 at 17:51
1

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • resize /dev/sda3 using Windows Disk Management app. Resize it down to 400G, or less

  • in Ubuntu, undo your mods to /etc/fstab and make it mount /dev/sda6 by UUID

  • reboot Ubuntu to confirm proper /etc/fstab and GRUB menu (do a sudo update-grub later)

  • boot to a Ubuntu Live DVD/USB

  • start gparted
  • delete /dev/sda8
  • move /dev/sda5 partition all the way left
  • move /dev/sda6 partition all the way left
  • resize /dev/sda6 to at least 60G by dragging the right side to the right
  • move /dev/sda7 partition all the way left
  • resize /dev/sda7 by dragging the right side all the way right
    • if you want to create a small NTFS partition for sharing files between Windows and Ubuntu, leave some space
  • click the Apply icon
  • reboot
  • do sudo update-grub
3
  • I'm following along, I'll let you know what happens. – Dylan Landry Jan 5 '20 at 18:37
  • It worked! Turned out the solution was to back up and learn what's possible with partitioning. I know the more specific the solution is to my situation the less helpful it may be to others. So, thanks for sticking through with me. – Dylan Landry Jan 5 '20 at 20:06
  • @DylanLandry Glad it all worked for you. Show me a current gparted screenshot... – heynnema Jan 5 '20 at 20:12

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.