Re-partiion Opensuse by shrinking / and inflating /data on the same ssd

Hello,

I have installed opensuse 42.2 on a 119 GB ssd like this :

/dev/sda1 172 MB EFI boot FAT
/dev/sda2 2,01 MB swap
/dev/sda3 38 GB BtrFS /
/dev/sda4 79 GB Ext4 /data

/data is saturated and meanwhile / still has ~16 GB free .

I want to reduce sda3 to ~20 GB in order to increase sda4 to ~97 GB (on the remaining space) .

How to do this ?

And i don’t want to re-install.

NB : Yast2 seems to allow hot reducing of sda3 … Is it safe ?

Making your btrfs 100% full is strongly not recommended. And you will not be able to add this space to sda4 anyway (at least, if partitions are located on disk in the same order) - you would need to move data to start of free space after destroying sda4 and creating new large partition that starts at the beginning of new free space. Some software supports it. It would be more easy if you had LVM on sda4.

You can shrink btrfs online and I was able to change partition size and make system recognize it online, without umount or reboot, as well; I won’t claim it always works though.

And like @avidjaar suggested, we prefer computer facts above your interpretation of them.

Thus better post

fdisk -l

to avoid confusion.

fdisk -l
Disque /dev/sda : 119,2 GiB, 128035676160 octets, 250069680 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : gpt
Identifiant de disque : 7993B26C-020A-4153-9155-58CDA005DB03

Périphérique    Début       Fin  Secteurs Taille Type
/dev/sda1        2048    354303    352256   172M Système EFI
/dev/sda2      354304   4562943   4208640     2G Données de base Microsoft
/dev/sda3     4562944  84260863  79697920    38G Données de base Microsoft
/dev/sda4    84260864 250068991 165808128  79,1G Données de base Microsoft


Looks fine. Thanks for the confirming information.

Just a few remarks

Like @avidjaar already said. This is not an easy one. You should really be familiar with partitioning, file systems (sorry to say, but some people do not even know the difference) and what happens on a disk when you start typing commando’s.

And such a small root file system with btrfs is, as said also a problem. At least switch snapshotting off (and delete all existing snapshots before you start changing things). On ext4, 20GB is sufficient for the root file system, thus I assume that a btrfs without snapshots will be the same.

While you have no separate file system for /home here, I assume you have it either on another disk, or the contents is almost none.

A completely superfluous remark: make an extra backup of all in /data, all other user/application data in that resides in the root directory (/home ?) and of /etc (it is helpful when you can check old system config files when you have to reinstall).

Thanks for all your answers.
It’s a pity you cannot modify partitions when the system is alive.
I had to re-install everything.
That’s heavy.

That would be like removing all walls in a house and building new ones without making any furniture unusable and still living in it with the whole family.

Just accept that in software, like in hardware, you can not change some things while still using it.

The partitioning you need is really something you decide with insight in the future. And that is not always easy if practical at all.