[Solved] 2 /homes

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
oldcharlie
Level 2
Level 2
Posts: 85
Joined: Mon Oct 13, 2014 7:14 am
Location: Florida

[Solved] 2 /homes

Post by oldcharlie » Fri Jan 27, 2017 12:55 pm

Last January I built a new machine and loaded Linux Mint 17.3 Cinnamon and partitioned the SSD drive and the Hard drive like this:

sda1 as: Fat32 Boot /efi
sda2 as: ext4 /

sdb1 as: Swap
sdb2 as: ext4 /home
sdb3 as: ext4 /Backup
sdb4 as: media
Linux used my home partition on sdb2 as I had anticipated. Very happy the way it worked.

Although I have been using Linux for 3.5 years I still consider myself a beginner and at 74 not as bright or quick as I once was, if ever. Recently I was trying some new terminal commands which I normally do on an old PC. However, I was in a hurry (Get ready to laugh) and too lazy to roll my chair to the end of my desk and the old machine and opened the terminal on my main machine. After all it was going to be pretty simple and quick. End result I trashed my Linux operating system.

Not to worry. My home partition was a separate partition plus I had two back ups, one on sdb3 and one on my laptop via the network. As it was necessary to reload Linux Mint I decided to go with Mint 18.1 and it installed very quick from the usb stick and worked great right out of the box.

When I did the installation I selected something else and set up the SSD partitions as before:
sda1 as: Fat32 Boot /efi
sda2 as: ext4 /
My home partition was still on sdb2 and unharmed by my carelessness. BUT, when I opened Nemo I noticed that I had two home partitions. Linux had installed a new home on the SSD even though one already existed on sdb2. I’m curious why this happened.

I’m thinking that I need to load Gparted and repartition both drives just like I did last year and then reload 18.1, then copy all my home directory from a just created current backup on a usb stick and I should be back with one home in it’s own partition separate from the operating system. “Think” is the operating word here that tends to get me into trouble.

Comments, feedback, advice appreciated
Last edited by oldcharlie on Fri Jan 27, 2017 5:55 pm, edited 1 time in total.
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; AMD FX-6300, 16GB, GeForce GTX 950
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; Core i5-6260U, 16GB, Intel Iris Graphics 540

grumpy_geek
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 3:50 am
Contact:

Re: 2 /homes

Post by grumpy_geek » Fri Jan 27, 2017 2:25 pm

I'd rather not mix the old system's / user's home (containing i.a. LM 17.3 configuration files) with the new one (containing i.a. LM 18.1 configuration files). Rather, I'd mount the old home partition e.g. as "old_home" (read: user data partition) and copy or move what is needed, when it is needed, where it is needed...

Code: Select all

root:> mkdir /home/old_home/
root:> mount /dev/sdb2 /home/old_home/
root:> chown -R [name of LM 18.1 user]: /home/old_home/
If this works (read: as LM 18.1 user, you're able to read from / write to the LM 17.3's old home partition), you may want to update /etc/fstab accordingly to keep the "old_home" accessible on a permanent basis.

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: 2 /homes

Post by austin.texas » Fri Jan 27, 2017 2:30 pm

When you did the new installation, did you use the same user name as before?

Please post the result of

Code: Select all

lsblk  -f
and

Code: Select all

cat /etc/fstab
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

oldcharlie
Level 2
Level 2
Posts: 85
Joined: Mon Oct 13, 2014 7:14 am
Location: Florida

Re: 2 /homes

Post by oldcharlie » Fri Jan 27, 2017 3:15 pm

Re: grumpy_geek
Thanks but want to wait a bit before doing something like that. I was wondering if there might not be a command (s) to fix my oops.

austin_texas

Here is the output from lsblk -f

Code: Select all

charlie@atlas ~ $ lsblk -f
NAME   FSTYPE LABEL     UUID                                 MOUNTPOINT
sda                                                          
├─sda1 vfat   BOOT      102E-DD13                            /boot/efi
├─sda2 ext4             8f0e95a9-3b83-4f2e-abc1-b673f1cb5a22 /
└─sda3 ext4   image     12c07f1f-add1-44ab-ae2e-b1cab1538e6b /media/charlie/imag
sdb                                                          
├─sdb1 swap             b62692f8-5175-4971-a08c-600934a114f3 [SWAP]
├─sdb2 ext4   home      66c6bc70-66b7-4563-9866-063b53d28fd1 /media/charlie/home
├─sdb3 ext4   backup    e39184a9-4967-48ef-a287-ddd427fb87e7 /media/charlie/back
└─sdb4 ntfs   Data      7B3C35767F8D0A58                     /media/charlie/Data  
and cat /etc/fstab

Code: Select all

charlie@atlas ~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

Note: I didn't include sda3 labeled as image because I originally set it up to copy an image of Mint 17.3 but forgot and so it was moot.

# / was on /dev/sda2 during installation
UUID=8f0e95a9-3b83-4f2e-abc1-b673f1cb5a22 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=102E-DD13  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sdb1 during installation
UUID=b62692f8-5175-4971-a08c-600934a114f3 none            swap    sw              0       0
charlie@atlas ~ $ 
 
Just saw that the 18.1 install also created another swap on the SSD. So 18.1 didn't look at the HDD partitions at all it appears.
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; AMD FX-6300, 16GB, GeForce GTX 950
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; Core i5-6260U, 16GB, Intel Iris Graphics 540

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: 2 /homes

Post by austin.texas » Fri Jan 27, 2017 3:22 pm

oldcharlie wrote:Re: grumpy_geek
Thanks but want to wait a bit before doing something like that. I was wondering if there might not be a command (s) to fix my oops.
Really, grumpy_geeks suggestion is a good one. But maybe there is a different plan that you would prefer.
I will be right back...
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: 2 /homes

Post by austin.texas » Fri Jan 27, 2017 3:46 pm

There is no evidence of 2 swap partitions.

Your terminal results show that no /home partition was created at all.
So that means that all the folders you see in /home are actually on the root partition, sda2. (The SSD, as you said in your first post.)
You have another /home on sdb2, which is your /home that you were using with Mint 17.3 - where you did set up a separate /home during installation.
What happened is that you forgot to tell the installation program to mount sdb2 as /home when you installed Mint 18.1

One possibility is to create symlinks from the new /home to the old one. In other words, the folders like Music, Documents, etc. on the SSD would be replaced with symlinks to the corresponding folders on sdb2
HOWTO: Create & Use a Separate DATA Partition - by gold_finger
Create a /data partition with symlinks - by xenopeek

Or you can use binding.
HowTo: Using Bind to Remount Part of a Partition - by altair4

Or you can edit fstab to mount sda2 as /home (that option is possibly questionable - I don't know if I would try that.)
HOWTO: Create a separate /home partition after installation - Community Ubuntu Documentation
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

oldcharlie
Level 2
Level 2
Posts: 85
Joined: Mon Oct 13, 2014 7:14 am
Location: Florida

Re: 2 /homes

Post by oldcharlie » Fri Jan 27, 2017 4:55 pm

austin_texas

Only reason that I was hesitant about grumpy_geek's suggestion is that I tend to really mess up in the command line. I could write a book on big errors that I have made doing that. Mostly because I charge in without double checking myself and also because I have struggled with the Linux file system.

You just proved my statements above.
What happened is that you forgot to tell the installation program to mount sdb2 as /home when you installed Mint 18.1

and I thought I was being careful. :oops:

I need to read about all the options you have listed below and look over grumpy_geeks solution and think about it. I'm going to reboot myself and study overnight and will post tomorrow what I decided to do and the results.

Many thanks to both of you.
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; AMD FX-6300, 16GB, GeForce GTX 950
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; Core i5-6260U, 16GB, Intel Iris Graphics 540

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: 2 /homes

Post by austin.texas » Fri Jan 27, 2017 5:03 pm

I would just create symlinks, personally.
In your file manager, you can click on the Music folder, for example, and re-name it MusicMint18.1
Or, if it is empty, you can delete it.
Then you go to the old Music folder on sdb2, right-click > Make Link
Click on the new link > Cut
Paste the link in the /home on the SSD. Then rename it Music. It takes the place of the old Music.

Repeat for each folder - Documents, Downloads, etc.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: 2 /homes

Post by austin.texas » Fri Jan 27, 2017 5:21 pm

But before you do that... There is a useful step missing. You should create a mount point for sdb2 and mount it in fstab. That way it is always available in exactly the same way every time.
Right now you are mounting it by clicking on it in the file manager. Right?
You would make a mount point (a folder) in your /home. You could call it old_home, as grumpy_geek suggested, or HOME (all caps). You can do that in your file manager. Just open it to the /home on the SSD and make a new folder. Let's say your new folder is called HOME.

Now you (finally) get to enter commands in a terminal. Open /etc/fstab in your text editor with this command:

Code: Select all

gksu xed /etc/fstab
Add these lines after the existing content of that file:

Code: Select all

# mount sdb2 on /home/charlie/HOME
UUID=66c6bc70-66b7-4563-9866-063b53d28fd1  /home/charlie/HOME  ext4   defaults,noatime   0   2
Save the file and exit the text editor.
Reboot.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

oldcharlie
Level 2
Level 2
Posts: 85
Joined: Mon Oct 13, 2014 7:14 am
Location: Florida

[Solved] Re: 2 /homes

Post by oldcharlie » Fri Jan 27, 2017 5:54 pm

austin_texas
Your last suggestion, creating links seemed so simple that I decided to try that and everything worked great. This is about the third time at least over the last year or so that you have given me good advice or help and I thank you. Everything seems to work fine and all files are where they should be.

Somehow back when I was first starting with Mint 13 I believe I edited fstab and broke everything. Don't ask how but I did and have been afraid of it ever since.

grumpy_geek I am still looking at your advice to hopefully better understand the Linux file system and Linux. I thank you for your time and consideration.
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; AMD FX-6300, 16GB, GeForce GTX 950
Linux Mint 19.1 Cinnamon 64 bit; 4.15.0-45 Kernel; Core i5-6260U, 16GB, Intel Iris Graphics 540

Post Reply

Return to “Installation & Boot”