0

On Ubuntu 22.04.2. I am attempting to resize the partition containing my /home using free space which exists immediately before/to the left of the current location of the partition. The actual /home is a volume within the partition in question (ditto for root and swap), which may be an artifact from a CentOS installation that previously lived within the partition currently being used for Ubuntu. This partition does not include /boot, which I've made sure lives in a different partition on the same drive.

The output of lsblk -o NAME,MAJ:MIN,SIZE,FSTYPE,MOUNTPOINTS when booted normally:

NAME           MAJ:MIN   SIZE FSTYPE      MOUNTPOINTS
loop0            7:0       4K squashfs    /snap/bare/5
loop1            7:1   243.8M squashfs    /snap/code/119
loop2            7:2   116.8M squashfs    /snap/core/14784
loop3            7:3    55.6M squashfs    /snap/core18/2697
loop4            7:4      62M squashfs    /snap/core20/1587
loop5            7:5    63.3M squashfs    /snap/core20/1822
loop6            7:6    72.9M squashfs    /snap/core22/522
loop7            7:7    81.6M squashfs    /snap/discord/150
loop8            7:8   163.3M squashfs    /snap/firefox/1635
loop9            7:9   240.6M squashfs    /snap/firefox/2356
loop10           7:10   80.7M squashfs    /snap/gmail-app/7
loop11           7:11  164.8M squashfs    /snap/gnome-3-28-1804/161
loop12           7:12    219M squashfs    /snap/gnome-3-34-1804/77
loop13           7:13  400.8M squashfs    /snap/gnome-3-38-2004/112
loop14           7:14  346.3M squashfs    /snap/gnome-3-38-2004/119
loop15           7:15  452.4M squashfs    /snap/gnome-42-2204/56
loop16           7:16   91.7M squashfs    /snap/gtk-common-themes/1535
loop17           7:17  329.5M squashfs    /snap/inkscape/10521
loop18           7:18  100.1M squashfs    /snap/julia/74
loop19           7:19   67.3M squashfs    /snap/jupyter/6
loop20           7:20   10.1M squashfs    /snap/liquidctl/34
loop21           7:21  115.8M squashfs    /snap/slack/68
loop22           7:22   45.9M squashfs    /snap/snap-store/582
loop23           7:23   49.8M squashfs    /snap/snapd/18357
loop24           7:24    304K squashfs    /snap/snapd-desktop-integration/49
loop25           7:25    428K squashfs    /snap/snapd-desktop-integration/57
loop26           7:26  320.4M squashfs    /snap/vlc/3078
sda              8:0     2.7T             
├─sda1           8:1       1M             
├─sda2           8:2      15M             
└─sda3           8:3     2.7T ntfs        /media/ben/HDD
nvme0n1        259:0     1.8T             
├─nvme0n1p1    259:1     499M ext4        /boot
├─nvme0n1p2    259:2      99M vfat        /boot/efi
├─nvme0n1p3    259:3      16M             
├─nvme0n1p4    259:4     1.2T ntfs        
└─nvme0n1p6    259:5   145.5G LVM2_member 
  ├─centos-swap
  │            253:0    14.6G swap        [SWAP]
  ├─centos-home
  │            253:1    80.8G ext4        /home
  └─centos-root
               253:2      50G ext4        /var/snap/firefox/common/host-hunspell
                                          /

When booted from USB:

NAME            MAJ:MIN   SIZE FSTYPE      MOUNTPOINTS
loop0             7:0     2.1G squashfs    /rofs
loop1             7:1      62M squashfs    /snap/core20/1587
loop2             7:2       4K squashfs    /snap/bare/5
loop3             7:3   163.3M squashfs    /snap/firefox/1635
loop4             7:4   400.8M squashfs    /snap/gnome-3-38-2004/112
loop5             7:5    45.9M squashfs    /snap/snap-store/582
loop6             7:6     284K squashfs    /snap/snapd-desktop-integration/14
loop7             7:7      47M squashfs    /snap/snapd/16292
loop8             7:8    91.7M squashfs    /snap/gtk-common-themes/1535
sda               8:0     2.7T             
├─sda1            8:1       1M             
├─sda2            8:2      15M             
└─sda3            8:3     2.7T ntfs        
sdb               8:16   28.7G iso9660     
├─sdb1            8:17    3.6G iso9660     /cdrom
├─sdb2            8:18    4.1M vfat        
├─sdb3            8:19    300K             
└─sdb4            8:20   25.1G ext4        /var/crash
                                           /var/log
nvme0n1         259:0     1.8T             
├─nvme0n1p1     259:1     499M ext4        
├─nvme0n1p2     259:2      99M vfat        
├─nvme0n1p3     259:3      16M             
├─nvme0n1p4     259:4     1.2T ntfs        
└─nvme0n1p6     259:5   145.5G LVM2_member 
  ├─centos-swap 253:0    14.6G swap        
  ├─centos-home 253:1    80.8G ext4        
  └─centos-root 253:2      50G ext4        

and the same after 'deactivating' the partition I want to move in Gparted:

NAME        MAJ:MIN   SIZE FSTYPE      MOUNTPOINTS
loop0         7:0     2.1G squashfs    /rofs
loop1         7:1      62M squashfs    /snap/core20/1587
loop2         7:2       4K squashfs    /snap/bare/5
loop3         7:3   163.3M squashfs    /snap/firefox/1635
loop4         7:4   400.8M squashfs    /snap/gnome-3-38-2004/112
loop5         7:5    45.9M squashfs    /snap/snap-store/582
loop6         7:6     284K squashfs    /snap/snapd-desktop-integration/14
loop7         7:7      47M squashfs    /snap/snapd/16292
loop8         7:8    91.7M squashfs    /snap/gtk-common-themes/1535
sda           8:0     2.7T             
├─sda1        8:1       1M             
├─sda2        8:2      15M             
└─sda3        8:3     2.7T ntfs        
sdb           8:16   28.7G iso9660     
├─sdb1        8:17    3.6G iso9660     /cdrom
├─sdb2        8:18    4.1M vfat        
├─sdb3        8:19    300K             
└─sdb4        8:20   25.1G ext4        /var/crash
                                       /var/log
nvme0n1     259:0     1.8T             
├─nvme0n1p1 259:1     499M ext4        
├─nvme0n1p2 259:2      99M vfat        
├─nvme0n1p3 259:3      16M             
├─nvme0n1p4 259:4     1.2T ntfs        
└─nvme0n1p6 259:5   145.5G LVM2_member 

I loaded Ubuntu 22.04 from a USB, used GParted to "deactivate" the partition (still unclear on the relationship between deactivate and unmount; my intention is to unmount the partition so it can be moved, but unmount is not explicitly provided as an option), queued and applied a move and resize to make the partition in question fill the space preceding it, and acknowledged a warning about not moving /boot before beginning the move. I then receive the below warning:

Partition(s) 6 on ... have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. You should reboot now before making further changes.

This warning gives the option to continue, but it seems unwise to do so. How can I (relatively) safely move and resize my partition?

GParted screenshot. The key symbol is not present when the drive is deactivated, but it generally takes several attempts to actually deactivate it.

  • Your description is hard to follow. It would help if you provided the output of lsblk -o NAME,MAJ:MIN,SIZE,FSTYPE,MOUNTPOINTS when booted normally and when booted in the Ubuntu live environment. One thing is for sure, you cannot alter partitions with GParted if they are mounted. – PonJar Feb 22 '23 at 18:49
  • @PonJar Added requested context and tried to improve clarity. Let me know if there's anything else I can do to improve my question. – Ben Landrum Feb 22 '23 at 19:47
  • You have LVM or volumes which normally are inside one full drive partition. You have to expand partition and deal with volumes. If not encrypted, you can skip that part. https://askubuntu.com/questions/262211/how-do-i-resize-an-encrypted-lvm-to-install-another-copy-of-ubuntu & http://askubuntu.com/questions/852019/i-wish-to-expand-my-lvm2-partition & http://askubuntu.com/questions/196125/how-can-i-resize-an-lvm-partition-i-e-physical-volume – oldfred Feb 22 '23 at 20:13
  • @oldfred I’ve read the posts you linked and understand that I have an issue with LVM2. Is there a good way to separate the LVM into partitions? The tools I can immediately find for dealing with LVM (system-config-lvm and kvpm) don’t seem to be supported/available on 22.04, or at least are not visible to apt-get even after extending sources in Software and Updates. My LVM is also not encrypted. – Ben Landrum Feb 22 '23 at 20:54
  • I suggest you read up on LVM. I find this tutorial helpful. https://www.tecmint.com/extend-and-reduce-lvms-in-linux/ If nothing else the commands included will help you understand what you are dealing with. You can create a new partition in the unallocated space you have and add it into your volume group. This may not be the best solution, I’ve only got experience of adding space through adding extra devices. – PonJar Feb 22 '23 at 21:00
  • You might find this interesting https://www.linuxjournal.com/content/review-gui-lvm-tool – PonJar Feb 22 '23 at 22:06
  • And according to this you were on the right track. http://gparted-forum.surf4.info/viewtopic.php?id=16987 However assuming the resize works ok you will still have to use the various commands to add pv to the volume group and resize the filesystem – PonJar Feb 22 '23 at 22:09
  • @PonJar your linux journal link gives me a 404. My primary concern with deactivating the LVM is that I'm not optimistic about the boot locating the new partitions. This is a recent install (<5h of active use), and I'm increasingly feeling that the path of least resistance may be to delete the LVM partition, reinstall Ubuntu, and avoid LVM when setting up the new install. Regardless of what I end up doing thanks a lot for the LVM background. – Ben Landrum Feb 22 '23 at 22:27
  • Sorry about the 404, not sure what happened there. Try this one https://www.linuxjournal.com/content/review-gui-lvm-tools . If this is a new installation I would definitely start again. LVM is great if your storage needs are growing to the extent you need multiple disks and a single partition. In desktop situations they can be unnecessary complexity in my opinion – PonJar Feb 23 '23 at 09:26
  • Is it possible that you left the label string empty when creating the partition? I had the same issue, which went away after adding a partition label. – Rainer Glüge Sep 21 '23 at 18:07

0 Answers0