Change BTRFS partiton sizes

I installed leap 15.3 on a 1 terabyte hard-disk. This gave me a home of about 600 gig ext4, and a root of over 300 gig for root BTRFS.

This was almost what I wanted.

I would like to change that to about 60 - 200 gig for root, looking for advice on the size, and add a ext 4 partition for a virtual machine, and also increase the size of home.

Question 1: Can I do this with tumbleweed also present on this pc? (different hard disk)

I already started yast on tumbleweed and had a look, but I can’t find the shrink option ? Do I need to check format that partition for that option to appear ?

Question 2. How big does a folder for a virtual machine need to be ? is 30 gig enough ?

(Just for info pc is now triple boot, Leap, Tumbleweed and windows10, all have their own hard disk)

Because I can’t edit my last post, I will do it this way.

I am gonna have a look at the BTRFS tools and do some more reading.

Keep seeing on the net when I google BTRFS, it should even be possible to do it live. ( but not how to do it)

Might just try some more with the yast partitioner. There is not realy something to loose if I mess up, besides a leap install. :slight_smile:

I think I found it:

btrfs filesystem resize -500m to shrink orbtrfs filesystem resize +500m to expand

That changes the file system NOT the partition.

Thank you, but I am now even more lost then before. :slight_smile:

In english, I just want my home partiton (ext4) bigger and the btrfs partition ? smaller.

Out of my 1 terrabyte disk space, now the btrfs part is about 350 gig (root) . I would like to take of at least 100gig.

I am starting to get a btrfs headache.

It is not possible to resize a btrfs file system but it is possible to resize each of the devices it uses. If there is only one device in use then this works the same as resizing the file system. If there are multiple devices in use then they must be manually resized to achieve the desired result.

I got into trouble because my home was xfs, now I have the same problem with btrfs ? :frowning:

I am tempted to reinstall leap and just use ext4. Then i atleast can change stuff when I want too.

I will give this a second try.

As long as you evidently do not understand the difference between a partitions and a file syetm, it will be very difficult to communicate with you. Please read and understand:,_filesystems,_mount_points

Note what you ask is to resize the partitions. In order to do so the file system in the partition must also be resized. The XFS file system can not be reduced in size thus a partition containing the XFS file system can not be reduced. Other file systems do not have this limitation. Also note you can only add and remove space to a partition at the ends. thus once you reduce the size of root you yo will have to move home to the end of root before adding space to homes end. This of corse all depends on the current geometry of the disk you can see this via fdisk -l and note the sectors used for each partition.

I assume you wanted to say “Also note you can only add and remove space to a file system at the ends”

Partitions are just numbers in the partition table. Every time you change those numbers, there are partitions that may or may not be on the same place (or on the same starting point and/or same endpoint) as they were in the table before the change. Thus it is easy enough to alter the starting point of a partition end keeping the same end (and it still having the same partition number). How useful such an action is depends very much on the goal. But when the goal is to follow the decrease or to precede the increase of the file system inside, then moving a starting point is a nono…

Thank you guys.

I am getting totally frustrated and annoyed, because I can’t find an answer. The link from hcvv might answer why though.
I am probably not asking the right question. :slight_smile:

I am also gonna download gparted, that fixed for me some issue with the installer of opensuse before.
Me not being able to explain the installer how I want the harddisk formatted.

I just installed leap again, and again ended up with a way to big root partition, although this time ext4.
I will have to dive deeper into the expert settings of the installer or use gparted and then install leap.

That is completely you. Why did you not adapt the size when the proposal that is shown you does not fit you.

What is the use in re-installing when you do not do it correct then? Makes it really difficult to help you.

So I read most of that link, not much new for me there, but worse at the end:

Bootable GUI tools like Gparted are a step further. They know a lot about the internals of filesystems and can thus change their size, but this is far beyond the scope of this document.

Maybe this is my answer though, I need gparted for what I am attempting to do.

You do not need it at all. A new install should have that waht you want. No need to meddle with those toold.
IMHO when you are not able to create the partitions you need at installation, you will certainly not be able to wrk with gparted (or other such tools).

And, as I understand your several stories here, you have two or three openSUSE systems on that computer. Thus you can always boot one of the others and then use YaST > partitioner, or even gparted from there. Why searching for yet another mini-system with gparted?

True for partitions also you can only add/remove space from the ends… partitions must be counties blocks of sectors

I agree but, after trying it multiple times, through the partitioner in yast of my tumbleweed install, I gave up and downloaded gparted.

After gparted to my surprise leap still starts. With a almost 50 gig root, 850 gig home , a 2 gig swap and another almost 30 gig partition. All I ever wanted. ( all ext 4 )

In gparted (hello debian with gnome)
I started by shrinking the root partition from 360 to 50. (and moved it to the left)
Then added a partition of about 30 gig
Then extended home to max and moved it to the left.

Now back to installing a VM on tumbleweed and pointing it to that 30 gig partition.

After reading your post, I realize, I could have installed gparted on tumbleweed. Because I was not changing the disk were tumbleweed is installed, it should have been easy.

One mistake I made was thinking, installing leap and then afterwards changing the partitioning of the hard disk, would be easy.

The other might be me giving up to soon through the installer.
Maybe I should have gone expert mode, although this topic proofs I am not an expert. :slight_smile:

I do know that btrfs which is totally new to me confused me a lot.

Maybe I need to install opensuse more often, until I have that installer eat out of my hand. :wink:

Is that why Gparted has this move to the left part ?

Years ago the first time I used gparted, I did totally not under stand that part. Now I understand enough, to know its important.

Yes it is me. Maybe I need to study the installer more. I could not find anything, were it would let me type (change) the size of the partition.

In yast partitioner, I clicked root partition, then that I wanted to format it, expecting it then would ask me the size, but it did not.

It also could be the problem was, me not refusing the proposal of the installer, and go expert.

Maybe something to try, I can do it without installing leap but just booting the installation usb.

To some extent it irritates me, I can do it with Gparted but not through yast. Knowing it is possible through yast and the installer. :slight_smile:

Host erlangen uses the following partitioning (ignore #2):

**erlangen:~ #** fdisk -l /dev/nvme0n1 
**Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors**
Disk model: Samsung SSD 950 PRO 512GB                
Units: sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes / 512 bytes 
Disklabel type: gpt 
Disk identifier: A84F222E-0177-499B-A7EA-BDA6F31E2196 

**Device****    Start****       End****  Sectors****  Size****Type**
/dev/nvme0n1p1      2048     206847    204800   100M EFI System 
/dev/nvme0n1p2    206848   25806847  25600000  12.2G Linux filesystem 
/dev/nvme0n1p3  25806848  134207487 108400640  51.7G Linux filesystem 
/dev/nvme0n1p4 134207488 1000214527 866007040 412.9G Linux filesystem 
**erlangen:~ #**
[FONT=monospace]**erlangen:~ #** lsblk -f /dev/nvme0n1 
NAME        FSTYPE FSVER LABEL                UUID                                 FSAVAIL FSUSE% MOUNTPOINT 
├─nvme0n1p1 vfat   FAT16                      6DEC-64F9                              91.5M     8% /boot/efi 
├─nvme0n1p2 xfs                               f62b0c85-6bd1-48d6-a04a-b148d3892a3d                 
├─nvme0n1p3 btrfs        tumbleweed-nvme0n1p3 e7ad401f-4f60-42ff-a07e-f54372bc1dbc   26.6G    45% / 
└─nvme0n1p4 ext4   1.0   home                 704621ef-9b45-4e96-ba7f-1becd3924f08  113.9G    72% /home 
**erlangen:~ #**[/FONT] 

I created the GUID Partition Table with expert partitioner in 2016:

**erlangen:~ #** stat /home 
  File: /home 
  Size: 4096            Blocks: 8          IO Block: 4096   directory 
Device: 10304h/66308d   Inode: 2           Links: 11 
Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root) 
Access: 2021-10-13 06:30:27.612169048 +0200 
Modify: 2021-06-09 22:05:24.000000000 +0200 
Change: 2021-10-11 21:27:25.833096134 +0200 
 **Birth: 2016-08-16 20:33:05.000000000 +0200 **
**erlangen:~ #**

I made the final switch of the system partition from ext4 to btrfs in May 2020:

**erlangen:~ #** stat / 
  File: / 
  Size: 326             Blocks: 0          IO Block: 4096   directory 
Device: 23h/35d Inode: 256         Links: 1 
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root) 
Access: 2021-10-12 20:10:15.546394286 +0200 
Modify: 2021-06-02 06:42:03.767566549 +0200 
Change: 2021-06-02 06:42:03.767566549 +0200 
 **Birth: 2020-05-17 12:35:27.248734566 +0200 **
**erlangen:~ #**

I recommend sitting back, getting familiar with expert partitioner and eventually installing the system using the installer only.

Thank you :slight_smile: