Does merging partitions change sdb4 to sdb2?

Using GParted I would like to merge my Manjaro partition with the empty space infront of it. What I am not sure about though is, if the partition that is now sdb4 would change to sdb2 (the deleted one) and cause boot problems.

I would merge them from another Linux Distri that I am running, so that I do not have to use the boot image.

Will sdb4 remain sdb4 and would merging those two cause boot problems?

In the forum I found a guide but in that guide the first partition is being merged with empty space unlike on my drive. https://www.rootusers.com/use-gparted-to-increase-disk-size-of-a-linux-native-partition/

I don’t think I’ve ever merged partitions, so I’m not sure.

However if it changes, all you have to do is edit /etc/fstab with the new UUID. It’s not difficult.

Make sure you backup your data, and have a live USB (or another install) to hand just in case.

https://wiki.archlinux.org/title/Fstab

2 Likes

don’t expand to the left - your uuid will change and your system will not boot.

I should imagine the UUID would change regardless of the direction of expansion; admittedly, I’ve never put that to the test with a root partition.

@Fred_VIE

Rather than extending the partition, I would opt to move it to the left, instead. In this way, the partition remains intact, and its UUID arguably unchanged; at least, this is the working theory.

I invite any necessary critique on this procedure.

Later, you could extend the partition to the right, if desired, and follow the @dmt suggestion to change the UUID.

Or, you could (after moving the partition to the left) shrink the / root partition, and then create a new partition in the empty space to the right, and clone/copy/move your /home directory to the new partition.

Again, you would need to adjust /etc/fstab accordingly.

Having a separate /home partition is advantageous in many ways;

1 Like

Wait, would that mean I could just move my home dir to another drive before or after I installed the OS there and it would work the same like the old install? (maybe after fixing the fstab entry)

Just waying my options here because with all the distri testing I kinda made a partition mess on my smaller drives and this could give me the chance to redo all the messed up drives without having to go through manually reinstalling everything that I am using at this point.

Yes.

In this instance, after.

One huge advantage to having a separate /home partition is that you can completely reinstall if you choose to, without it affecting your /home partition. Of course, you’d need to make sure not to have the partition selected for formatting. :wink:

It’s recommended to make a backup copy of /home beforehand.

The whole process should ideally be done from a Live installer, or USB, with all the needed tools available. You would also need to use a chroot environment to access your installed system.

You could also have opted for a separate /home partition during initial install; by choosing the manual partitioning method.

1 Like

I’m backing that up regularily onto a different drive, so np.

The only weird thing I found was that, even though all folders in the /home dir are marked (except for logs), they do not all show in my backup folder. Is that normal or does that point to a problem with the backup?

So that could that be done on a new install with the old /home dir without causing problems because it comes from a system where it was on the same partition as Linux?

How would the System know that it is on another partition?

I assumed that there is a roadblock that needs reading more howto’s of which I only understand 50 % :confused: so I guess this is the one.

The chroot environment I would need to actually see the installed system and to copy the backup into the /home dir and to edit the fstab?

I guess the chroot environment is the reason that I can not see Manjaro when I am on Kubuntu but I can see Kubuntu on Manjaro? Meaning Kub does not have that?

So with the backup of the /home dir I can simply play around with the partition manager to check if moving causes problems and if they can be fixed by editing the fstab file - to learn a bit more along the way - and with the next clean install (or by just moving the partition to the left instead of merging it with the empty space) I simply copy the /home folder back, or onto a 2nd partition only for this dir. (When I learn how Linux knows that it is actually there.)

Always move to the left and grow to the right.
This helps keep the heads intact.
If you follow this procedure (dont grow to the left!) on a modern ssd or nvme it should be mostly safe.
Of course messing with partitions/filesystems is never 100% safe, so make backups if you can.

1 Like

I suppose it depends how you copied /home – I typically used a tar command to compress /home contents to an archive file; complete with file/dirctory permissions (this is important).

I once had the command saved as a script for convenience, but no longer have it. You could likely find a workable procedure using ‘linux tar backup home directory’ or a similar search term.

It could; it’s the same principle; however, it’s probably better to restore it from an archive file as described, rather than simply copying it from one location to another.

This is where fstab is useful. You would add the UUID and the ‘/home’ mount point as an entry in fstab. Have a look at your own fstab file for an example of the syntax:

cat /etc/fstab

After partitions are moved, created, etc, you can use:

sudo blkid

… from within a manjaro-chroot environment, to find the appropriate UUIDs.

Yes, from that environment you are in the installed system as the root user – everything you do affects that system – careful, there be dragons there!

There’s no avoiding that, sorry. :slight_smile:

No, that’s not related.

I suggest you compile all the information you need and create a procedure to follow in a notebook, or similar; have everything you need laid out, no matter how trivial it might seem.

And more importantly, ask someone here for clarification of anything you’re not sure about, before committing.