Adjusting VAR and OPT Partitions without Affecting System Stability

Hey Manjaritos,

I am currently facing an issue where my VAR partition is too small (10gigs), and my OPT partition is too large (100gigs). I would like to resize or merge these partitions without affecting the stability of the rest of the system.

The System is more the less freshly installed. So nothing on opt and a few programs on snap and so on. I just thought primarily snap, flatpak, yay and so on install their programs in opt and not in var. What a FAIL from my side LOL … Can I change that maybe? that snap and so on writes on opt to prevent the whole repartitioning?

System Details:

Device: Inspiron 2-in-1 laptop with 15 GB RAM
Operating System: Manjaro with the latest LTS kernel
The system is fully encrypted

Additional Information:

Filesystem types of VAR and OPT partitions: [ext4]
Logical Volume Manager (LVM) in use: [No]
Current sizes of VAR and OPT partitions: [e.g., VAR: 10GB, OPT: 100GB]
Backup status: [No backup

Questions:

How can I increase the VAR partition and decrease the OPT partition without damaging the system?

Is it possible to merge the two partitions? If so, what are the recommended steps?

Are there specific tools or methods particularly suited for this task?

What precautions should I take to ensure system stability and avoid data loss during this process?

I would appreciate detailed instructions or advice to ensure my system remains stable after the adjustments.

Thank you in advance for your assistance.

Best regards,
F418

Hi @Frater_418,

This might help:

2 Likes

Hi Miradarthos,

Primarily, thanks a lot for your quick response. But as far as I understand this is, that he will expand the root partition with tha additional space. But my problem is, that the var is too small and I need to pull space from opt to var…

In that sense, can I follow the same steps, just also for var and root the same way as in this tut?

cheers

System flatpaks go to var, user mode ones and data goes to home/.var. Very relevant if you install wine or bottles for example - it almost all goes to home.

This would have been easier if you were using LVM, but such is life…

I assume you have no un-allocated disc space? It would be easier if you did have.

The way I would approach this (not necessarily the best way, but it would work) is as follows. It avoids the risks involved in resizing partitions with live data on them.

  1. Make sure nothing auto-starts using anything in /opt at boot time. If anything does, disable it.
  2. Copy the files off /opt to somewhere safe then remove them from /opt.
  3. Copy all the files from /var to /opt.
  4. Edit /etc/fstab and swap the partitions for /var and /opt.
  5. Reboot. You should now have a 100G /var partition with all the necessary files.
  6. Remove all the files from what’s now your /opt partition.
  7. Copy your saved files over to the new /opt partition.

You should now have a 100G /var partition and a 10G /opt partition.

1 Like

Yes, you can; particularly if /opt and /var are side by side - just resize (shrink) /opt and then resize /var to fill that space. I’d recommend this be done using GParted app from a Manjaro Live environment (ISO).

GParted might not be on the ISO by default, but you can install it in memory (in the Live environment), as easily as if it were your normal user account.

I hope this helps. Cheers.

2 Likes

I think gparted was only removed in the latest kde 6 iso. (I have it on my last year xfce iso). But as said it can be easily fixed.

I believe @philm is looking into it, anyway, resulting from another recent thread.

1 Like

/off i miss the emojis…i could just have :+1:…now it is a :heart: for every possible feedback emotion :man_shrugging:

4 Likes

I just thought you were having a 1970’s hippy revival. :wink:

Thanks to all of ya. Worked out well for me :slight_smile:

Sounds also like a good solution, yet did not try it. First worket totally fine for me :slight_smile:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.