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