Author Topic: Mount separate /home partition after fresh install  (Read 1542 times)

0 Members and 1 Guest are viewing this topic.

Offline Rich J

  • Sr. Member
  • ****
  • Posts: 438
  • Karma: 2
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Mount separate /home partition after fresh install
« on: April 10, 2018, 08:53:04 pm »
Hi - After the kernel panic problems I had with Mint 18.3, I've done a fresh OS install of Mint 18.1 in the hope it will be more stable. 

Originally (M18.3 install), I made a separate /home partition in order to protect my data and decided to keep the same configuration for the re-install.  M18.1 installed no problem to it's dedicated partition and my original /home partition remains intact and accessible.  However, the new install has it's own /home directory, which is of course, empty.  The original /home partition is now seen as a separate device and to work with it, I have to mount it manually.  I've searched the 'net and found several ways to auto mount a partition but the instructions aren't clear and are way above my skill-set!

There are 2 users on this machine - self and wife.  What I need is to be able to log in directly to 'my' part of 'original /home/username' and to replicate that on my wife's log in.

Is there a straightforward way to do this?  (Hand-holding a necessity, I'm afraid!)

This is the partition set up -

Code: [Select]
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0001ba51

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048   3905535   3903488   1.9G 83 Linux
/dev/sda2         3907582 312580095 308672514 147.2G  5 Extended
/dev/sda5         3907584  42966177  39058594  18.6G 83 Linux
/dev/sda6       304769024 312580095   7811072   3.7G 82 Linux swap / Solaris
/dev/sda7        42969088 304752639 261783552 124.8G 83 Linux

- where /dev/sda5 is the 18.1 system files
and       /devsda7 is the dedicated /home partition

thanks in advance

Rich


Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17680
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mount separate /home partition after fresh install
« Reply #1 on: April 10, 2018, 09:51:03 pm »
Sharing a home folder between 2 users is a really bad idea

a) when a user saves a file it'll have their permissions
and
b) when they change any config files, such as (but not limited to) setting bookmarks in the web browser, they'll change for both users.

It would be much better to mount the old home folder as a shared directory that's in both of your home folders .. but this is going to require the PC it's on to be permanently switched on or it'll not be available on the second PC and may (if not set up correctly) slow the boot of that second PC.

My advice would be to get a NAS
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Rich J

  • Sr. Member
  • ****
  • Posts: 438
  • Karma: 2
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Re: Mount separate /home partition after fresh install
« Reply #2 on: April 12, 2018, 09:08:13 am »
Sharing a home folder between 2 users is a really bad idea

a) when a user saves a file it'll have their permissions
and
b) when they change any config files, such as (but not limited to) setting bookmarks in the web browser, they'll change for both users.

It would be much better to mount the old home folder as a shared directory that's in both of your home folders .. but this is going to require the PC it's on to be permanently switched on or it'll not be available on the second PC and may (if not set up correctly) slow the boot of that second PC.

My advice would be to get a NAS

Sorry, I don't understand this - perhaps I didn't explain very well?

When I first set up (the problematical) Mint 18.3, I partitioned the drive to have a boot, / and /home partition.  This had 2 users on one machine - self and wife.  Whichever user logged in went directly to their set up and had no direct access to the other's.  When I removed M18.3 and installed M18.1 (to the / partition) the original /home partition was left alone and survived intact.  The fresh install boots and works.  All as it should be so far....

Now, however the original /home partition (containing both users files under separate names) is 'seen' by the OS - in 'Computer' - as a separate device, (just the same as if I'd plugged in a usb drive) and those containers can be opened by either user on either login.

Is there a way to modify this so that each user just gets access to their own files and settings on log in?

If the answer is no, could I make the 'new' /home directory (currently empty and on /) move to it's own partition on the drive and simply transfer each user's files over to that? Then it would be back as it was before on the original set up.

It seems like a right rigmarole but I specifically set things up this way so my data would remain intact on fresh install and to save the constant shifting of files off and on to the HDD.  The method works great in that regard - I just expected that Mint would continue to use the original /home partition as it did before.

Hope this clarifies things.

Rich

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17680
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mount separate /home partition after fresh install
« Reply #3 on: April 12, 2018, 09:01:47 pm »
Oh right...

Wouldn't it just be easier to copy the user files to your new home folders .. then delete the old partition (or its contents)

But sure, we can mount each users old home folder somewhere in their new one if you'd like .. but it doesn't **really** stop them accessing your ohter home folders.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline userxbw

  • Jr. Member
  • **
  • Posts: 2
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Mount separate /home partition after fresh install
« Reply #4 on: May 29, 2018, 01:11:07 am »
Hi - After the kernel panic problems I had with Mint 18.3, I've done a fresh OS install of Mint 18.1 in the hope it will be more stable. 

Originally (M18.3 install), I made a separate /home partition in order to protect my data and decided to keep the same configuration for the re-install.  M18.1 installed no problem to it's dedicated partition and my original /home partition remains intact and accessible.  However, the new install has it's own /home directory, which is of course, empty.  The original /home partition is now seen as a separate device and to work with it, I have to mount it manually.  I've searched the 'net and found several ways to auto mount a partition but the instructions aren't clear and are way above my skill-set!

There are 2 users on this machine - self and wife.  What I need is to be able to log in directly to 'my' part of 'original /home/username' and to replicate that on my wife's log in.

Is there a straightforward way to do this?  (Hand-holding a necessity, I'm afraid!)

This is the partition set up -

Code: [Select]
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0001ba51

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048   3905535   3903488   1.9G 83 Linux
/dev/sda2         3907582 312580095 308672514 147.2G  5 Extended
/dev/sda5         3907584  42966177  39058594  18.6G 83 Linux
/dev/sda6       304769024 312580095   7811072   3.7G 82 Linux swap / Solaris
/dev/sda7        42969088 304752639 261783552 124.8G 83 Linux

- where /dev/sda5 is the 18.1 system files
and       /devsda7 is the dedicated /home partition

thanks in advance

Rich

if the old
home/you
/home/wife
if you're not going to move it. then you can use it as a mount point into our new home, or make it a mount into your /media /NewYourData where only you have permissions on the dir and its contents. of your old home. Then you can do the same for your wife and mount hers in /media/Wifes/OldHome

Because  you have your swap in the middle which is in the way, so  you cannot with the install you have now,  is copy over the contents into your new home and your wife's new home, then merge the access into your home partition.  I am assuming that you have two users on your old home as well, you and your wife's.

you can either keep the names attached or rename them, then have them mount in fstab so they will be there when you log in. the only one then to have access to everything is root, of course.
Code: [Select]
mkdir -p /holdingOldStuff
mkdir -p /media/YourOldHome
mkdir -p /media/WifesOldHome
#fstab
#   on root to keep it separate and not accessible to the common user, root only access
/dev/sda? (old home partiton) /holdingOldStuff ext4 defaults 0 0
/holdingOldStuff/home/yourOldHome / /media/yourData  none bind
/holdingOldStuff/home/WIfesOldHome /media/WifesOldHome none bind

of course the directories names  are only to try and show clarification.  You can name the new directories whatever you wish.  putting them in /media is so they should just show up in your file manager.


then you can user your file manager, having it set to show hidden files, then copy / move over all of your config's dir and files, and everything in your home, and use that for extra data storage. that will over write whatever is in your new homes, and set it to where it was in your old settings.

or if you got root user, log in as root to get on the root side in the roots account, then bind mount your old homes to your new homes in the same manner. then issue
Code: [Select]
mount -a
then check your results to insure that they took in the proper directories. you should end up with your stuff in your home and hers in her home. limitations, your are now limited to that old home size on that partition, and your partition your are currently on is being wasted.

what you could have done is. Installed mint (or any linux) on a separate root then assigned your home to the new install home, NO FORMAT, then installed it then as root , just adduser old users name so they match up to the home/user already there. then you;d just go back into your old home like you just came back from holiday.

mint and alike install programs, you have to pick the "do something else" selection to get into "expert" mode. Where you can tell it specify what you want it to do with your partitions. where and what to format and mount as.

it was hard to tell what you're actually working with without a post of your fstab also. I am assuming that /dev/sda1 was/is your old stuff. But, I hope that helped nonetheless.
« Last Edit: May 29, 2018, 01:43:38 am by userxbw »

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal