Separate Home Partition - Alternative Approach

Chat about anything related to Linux Mint
Post Reply
User avatar
arvy
Level 6
Level 6
Posts: 1069
Joined: Sat Mar 26, 2016 11:22 am

Separate Home Partition - Alternative Approach

Post by arvy »

The question raised by dnl in another thread about the advantages of a separate /home partition is, I think, a very interesting one. I'm sure that it has been quite thoroughly discussed in general, but having reached some conclusions and decisions of my own on the subject, I'd be very much interested in other views, both pro and con, on the approach that I've adopted.

I suppose I should admit up front my own "belt and suspenders" attitude toward relying on a separate partition on the same physical drive as any kind of dependable "insurance" against anything at all. To me, that approach is tantamount to an open invitation to disaster. I also question at least some of the arguments that are usually put forward in favour of a separate /home partition as a means to facilitate OS version upgrades inasmuch as it contains both more and less than what might best serve that purpose as I see it.

My own solution is to let the installer create the /home folder as it does by default under the installation's root. However, I then create a synchronized backup "shadow" of its critical user sub-folders (Documents, Pictures, etc.) on another physical drive where I also keep backup copies of "customized" system files such as /etc/grub.d/40_custom together with a detailed log of installation steps taken. To me, this appears to serve a dual purpose without double effort. As well as facilitating OS version updates it also acts as a "real time" catastrophic failure backup that I'd be doing anyway.

Good, bad, or indifferent, all comments and "better way" suggestions will be gratefully received and considered with as much equanimity as persistent human preconceptions will allow. :)
Last edited by JeremyB on Sun Apr 28, 2019 8:04 am, edited 1 time in total.
Reason: Moved to Chat about Linux Mint, not a support question
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot

dnl
Level 2
Level 2
Posts: 53
Joined: Mon Dec 26, 2016 3:21 am

Re: Separate Home Partition - Alternative Approach

Post by dnl »

Hi arvy. You invited me to comment so here it is.

If I understand correctly what you wrote, I share your view that /home and its various subdirectories are tied more or less to the rest of the system. It is not an independent, user-document-only area. Various applications store configurations, which are personal or unique to a particular user, but the mere existence of that configuration data depends on the fact that an application was installed elsewhere. If the /home directory is placed in another partition and the remaining system is replaced (such as an OS upgrade), I do not understand how the separate /home partition can remain unaffected and perfectly in sync with the rest of the system unless great care is given to installing exactly the same applications, electing exactly the same installation options AND those applications treat the /home area in exactly the same way -- OR -- prior to the upgrade, removing and purging things that will not be carried over into the new system. Neither of those scenarios seem likely or practical.

I am new to Linux (just a few years experience) but in that short time I have come to learn one cannot rely on newer versions of software installing and configuring exactly the same way older versions did.

But I don't want my documents and data intermingled with the rest of the system because upgrades would be a nightmare -- well, a bigger nightmare -- having to worry about preserving user documents and data.

My approach has been to create symbolic links to directories in another partition (indeed, on a different physical drive) and to set up profiles for Firefox and Thunderbird on that drive. The ~/Documents directory has a link to /media/data/myDocs, etc. If the links break, no big deal. I can still access my documents and data directly through the /media/data mount point. This approach has also allowed me to share documents, data, browser profiles and email with other OS on the same machine. (I multi-boot Linux, Win7 and WinXP but am just about to switch over to virtualbox.)

This has allowed me to revise, maintain and upgrade the Linux system at will without fear of losing anything major. Yes, I do have a few files like .lirc configuration files that I need to be mindful of, and I really like the way my desktop is laid out, but they don't change very often and I have them safely backed up if I ever lose them in an upgrade.

The foregoing is my conclusion based on what I admit is a very limited understanding of the way Linux works. I am open to better ways that may have been developed by more experienced and more enlightened people.

User avatar
Flemur
Level 18
Level 18
Posts: 8467
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Separate Home Partition - Alternative Approach

Post by Flemur »

dnl wrote:
Sun Apr 28, 2019 4:41 pm
I share your view that /home and its various subdirectories are tied more or less to the rest of the system.
Some of them are OS dependent, and some of them aren't.
That's why I separate them: OS program config files are in $HOME on the same partition as the OS they depend on.
Non-OS files, like mp3s, etc, are on a separate partition, suitable for any OS.
My approach has been to create symbolic links to directories in another partition (indeed, on a different physical drive) and to set up profiles for Firefox and Thunderbird on that drive. The ~/Documents directory has a link to /media/data/myDocs, etc. If the links break, no big deal. I can still access my documents and data directly through the /media/data mount point.
That works. Another thing that also works is to delete ~/Documents, etc, and just use the directories on the other partition; make bookmarks for them for your file browser. I made a couple of very simple scripts to navigate there:

Code: Select all

$ pwd
/home/user
$ data
$ pwd
/mnt/DATA
$ down
$ pwd
/mnt/DATA/download
$ data pix
$ pwd
/mnt/DATA/pix
I open thunar with a key press like this:

Code: Select all

Exec thunar   /mnt/DATA/download
Anyway, opinions about DATA and /home are like unicorns: everybody has one.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
arvy
Level 6
Level 6
Posts: 1069
Joined: Sat Mar 26, 2016 11:22 am

Re: Separate Home Partition - Alternative Approach

Post by arvy »

Okay, thanks dnl and Flemur for your responses. I understand that there are many other possibilities for /home sub-folder links, etc., but I guess I was hoping that someone might have some comments about the dual purpose alternative approach that I've adopted.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot

dnl
Level 2
Level 2
Posts: 53
Joined: Mon Dec 26, 2016 3:21 am

Re: Separate Home Partition - Alternative Approach

Post by dnl »

arvy wrote:
Mon Apr 29, 2019 8:16 am
Okay, thanks dnl and Flemur for your responses. I understand that there are many other possibilities for /home sub-folder links, etc., but I guess I was hoping that someone might have some comments about the dual purpose alternative approach that I've adopted.
I think your idea is clever. It provides for an up-to-date backup should it ever be needed, which could also be used to restore your data after doing a new install exactly as you mentioned.

The only additional thought I have is that the shadow copy should not be regarded as a replacement for a periodic backup because the shadow copy does not protect you against mistakes and failures that result in an unintended/undesired deletion or corruption. You probably know this but I mention it anyway.

mediclaser
Level 4
Level 4
Posts: 392
Joined: Tue Mar 20, 2018 2:28 pm

Re: Separate Home Partition - Alternative Approach

Post by mediclaser »

I used to make a separate /home partition, because I first thought it saves time re-configuring my stuffs when I reinstall or upgrade to a newer version. But later, I learned I could mess up the re-installs if I make mistakes (like not doing things in the correct order). Also, one of the apps I use would fail to install. And this was not even an upgrade...just a re-install of the same version of Mint.

The best approach that works best for me is not having a separate /home partition, but rather a separate data partition mounted as /media/data or /mnt/data. There I create my own folders for Documents, Downloads, Pictures, etc. and "symlink" to them (see dnl's post above).
If you're looking for a greener Linux pasture, you won't find any that is greener than Linux Mint. ;)

User avatar
AZgl1500
Level 13
Level 13
Posts: 4837
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Separate Home Partition - Alternative Approach

Post by AZgl1500 »

the above comments to not specify the type of hardware.

I, and a lot of folks are using laptops which ONLY have one SSD/HDD.
therefore, we must use separate partitions.

I have not had a HDD failure in years, more than 15 now IIRC....
and those were the little 2.5" HDDs of less than 250mB capacity.

the HDD in my desktop has been spinning since the day I bought it circa 2006 as best I can remember. maybe later than that, it is a 1TB Western Digital in a Gateway PC.
Don't recall when 1TB HDDs became available. It was one very expensive piece of hardware at the time.

But, back to laptops.....
we only have 1 HDD/SSD....
so we partition them..... I personally don't feel like it will fail within my lifetime.
I do back up to an extUSB HDD on occasion.

after a LOT of discussions with other members here on this forum, I became convinced that /home should not be inside the same partition as the OS. My /swap is very tiny, as the laptop has 12gB RAM.

Gparted.png
Linux Mint 19.3 Cinnamon

User avatar
arvy
Level 6
Level 6
Posts: 1069
Joined: Sat Mar 26, 2016 11:22 am

Re: Separate Home Partition - Alternative Approach

Post by arvy »

dnl wrote:
Mon Apr 29, 2019 7:35 pm
The only additional thought I have is that the shadow copy should not be regarded as a replacement for a periodic backup ...
I would most emphatically agree with that. I use Terabyte's Image for Linux for overnight scheduling of full system backups.
mediclaser wrote:
Mon Apr 29, 2019 8:42 pm
The best approach that works best for me is not having a separate /home partition, but rather a separate data partition mounted as /media/data or /mnt/data.
Yes, that would certainly be an option for isolating some user data files. From my perspective, however, a selective "shadow" copy serves the same purpose with the added advantage of providing backup protection for the user's most critical data.
AZgl1500 wrote:
Mon Apr 29, 2019 10:33 pm
I, and a lot of folks are using laptops which ONLY have one SSD/HDD.
Understood. Of course anyone can only uses the resources that are available and backing up to another partition on the same drive is unquestionably better than no backup at all.
AZgl1500 wrote:
Mon Apr 29, 2019 10:33 pm
after a LOT of discussions with other members here on this forum, I became convinced that /home should not be inside the same partition as the OS.
I can understand doing that to facilitate OS version upgrades, but I would contend that an available backup of all critical user data files along with certain "customized" system files and info does that job at least as well, if not better. What other advantage do you see in separating /home from the OS root? I could see doing putting /home on another physical drive in a situation where there isn't room for everything on one, but Its contents certainly won't be affected in any way merely because of residency in a different partition.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot

MateoEstradaR
Level 1
Level 1
Posts: 21
Joined: Mon Oct 15, 2018 6:03 pm

Re: Separate Home Partition - Alternative Approach

Post by MateoEstradaR »

arvy wrote:
Sun Apr 28, 2019 7:19 am
The question raised by dnl in another thread about the advantages of a separate /home partition is, I think, a very interesting one. I'm sure that it has been quite thoroughly discussed in general, but having reached some conclusions and decisions of my own on the subject, I'd be very much interested in other views, both pro and con, on the approach that I've adopted.

I suppose I should admit up front my own "belt and suspenders" attitude toward relying on a separate partition on the same physical drive as any kind of dependable "insurance" against anything at all. To me, that approach is tantamount to an open invitation to disaster. I also question at least some of the arguments that are usually put forward in favour of a separate /home partition as a means to facilitate OS version upgrades inasmuch as it contains both more and less than what might best serve that purpose as I see it.

My own solution is to let the installer create the /home folder as it does by default under the installation's root. However, I then create a synchronized backup "shadow" of its critical user sub-folders (Documents, Pictures, etc.) on another physical drive where I also keep backup copies of "customized" system files such as /etc/grub.d/40_custom together with a detailed log of installation steps taken. To me, this appears to serve a dual purpose without double effort. As well as facilitating OS version updates it also acts as a "real time" catastrophic failure backup that I'd be doing anyway.

Good, bad, or indifferent, all comments and "better way" suggestions will be gratefully received and considered with as much equanimity as persistent human preconceptions will allow. :)
I did that to my installation, i followed some tutorials on internet and the result was not good at all, the process was basically copying your entire home folder to another partition, then with rsync you had to copy your actual home to the new one but the results were both home locations locked on read only filesystems, then i restarted the machine and i got surprised by iniframs saying that / needed a manual fsck. I managed to repair the system but no i have a defective disk and some SMART warnings now and then...

User avatar
arvy
Level 6
Level 6
Posts: 1069
Joined: Sat Mar 26, 2016 11:22 am

Re: Separate Home Partition - Alternative Approach

Post by arvy »

Well, problems with either the source disk or the destination disk will certainly cause errors and trigger erratic results with any attempt to create a backup. If you're seeing SMART warnings, you should definitely check and fix or replace if necessary, but it has little to do with the particular suggestion offered here. Disk errors would have adverse consequences for any backup copy or image process regardless of methodology.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot

jglen490
Level 5
Level 5
Posts: 999
Joined: Sat Jul 15, 2017 9:57 pm

Re: Separate Home Partition - Alternative Approach

Post by jglen490 »

I absolutely, and only install with /home on a separate partition, whether I'm on a machine with one hard drive, or multiples. It's so easy to do clean installs of the OS, as well as recoveries. As far as backups, I only backup data which is located in /home, and I use rsync to back up to a rotating set of three external drives. With the "-auv" option in rsync, it only takes a few minutes to run, unless I clean out one of the backup drives first (which I do on occasion). My /home is split between two drives with /home/<my user name> on one and /home/multimedia on the other. So one command and one run of rsync takes care of it all.

I never do any OS backups, it's just as easy to reinstall. In reality, since / is relatively small, I could it backup also, but I don't.

I also realize that not everybody's installations are the same, and my choices are not your choices. Just understand that there are as many options available as there are people running some version of Linux - and none of them are wrong, if they work.
I feel more like I do than I did when I got here.
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB

Post Reply

Return to “Chat about Linux Mint”