r/linuxquestions • u/NomadJago • 4d ago
Support How can i make my home folder a dedicated partition?
I have Linux Mint on a 1000GB internal ssd. I want to somehow make my home folder a dedicated partition. The problem is I have 150GB of free space remaining on the disk and my home folder is 350GB.
7
Upvotes
6
u/Weary-Bowl-3739 4d ago
You must have a backup for this, but if you have only space for one data backup, you can do this:
Create the partition.
Move as much data there as possible.
Decrease the size of the main partition.
Increase the home partition
Repeat until finished
The dotfolders go last and are not moved but copied. (at least if not too big)
Change the fstab to mount the home
If this is successful, comment out the line from fstab, restart, clean up the rest from the home, comment in the line restart.
11
u/Slackeee_ 4d ago
If your journey through this ends at 1 because you don't have the possibility to make backup copies then stop fiddling with your system until you have that possibility.
1
u/EverOrny 4d ago
it depends on filesystem, it has to allow resize both up and down:
1/create target partition in the free space
2/move data to the target partition
3/the source partition has now some free space
4/prepare source partition for shrinking
5/shrink the source partition
6/expand the target partition
7/repeat steps 2 to 7 until you reach you goal
1
u/rarsamx 4d ago edited 4d ago
It's important to backup before you do ANITHING. (Well, in fact, it's important to backup)
Also, yes, it's better to separate it but, if it's not causing you any issues, wait until you have more experience to do it. Separating /home always has a risk.
With that out of the way. In this case I have at least three options for you.
Listed from easiest for a noob to better but that need more experience.
A) Do the backup of home. Boot with a live inage. Delete the contents of home. Use gparted to resize the main partition. Create a new partition. Copy the backup of home there. Edit /etc/fstab to mount that partition at /home.
B) Boot with a live image. Using Gparted shrink the main partition as much as you can. Create a new partition in the now unallocated space. Move as much as you can from the home partition to the new partition. Now the main partition will have space again. Shrink the main partition. Extend the new partition. Move and repeat until you moved it all. Edit /etc/fstab to mount the new partition under /home
C) (My favourite) Boot with a live image Convert your main partition to Btrfs. Create a subvolume for the root partition /@. Create a subvolume for home /@home. Move the contents of /home to the /@home subvolume. Move the contents of the main partition to /@. Edit /etc/fstab to mount /@ at / and /@home at /home.
The advantage of subvolumes is that they have all the advantages of partitions but share the same space. In top of that, with Btrfs you can do snapshots which simplify rolling back and backups.
1
u/p186 4d ago
I’d like to suggest something (optional). In addition to the good advice already given, I find that using LVM helps when needing to adjust in the future particularly if you need to add another physical disk.
1
u/oshunluvr 4d ago
Without any actual info, it's hard to offer advice. Assuming your disk has enough unused space to hold the contents of /home, you could just boot to GParted Live on a USB and from the live session:
Alternately, you could convert to BTRFS and have no need to partition, but at this point that might be more work than the above.
1
u/TomDuhamel 4d ago
Make the partition. Copy all your files to it (don't forget dot files). Add it as a mount in your fstab.
-2
u/Pterodactyl_Time 4d ago
Im not sure if this is possible. Your home folder is already a subsection of your primary partition. And I don't think you can then create another partition within that.
Can I ask why you want to do this? What are you hoping to achieve?