LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2020, 04:39 PM   #1
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
how to properly add a drive as /home to Ubuntu fork?


I just installed Pop!_OS (Ubuntu Fork) on to my SSD, during install I just unplugged my HDD (SATA) drive. Now I want to add that drive to /etc/fstab.

It has been many years since I did this, what is the correct way to add that drive using UUID (I think that is the correct name)?

Code:
 df -Th
Filesystem            Type      Size  Used Avail Use% Mounted on
udev                  devtmpfs   16G     0   16G   0% /dev
tmpfs                 tmpfs     3.2G  2.4M  3.2G   1% /run
/dev/mapper/data-root ext4      220G  7.0G  202G   4% /
tmpfs                 tmpfs      16G  175M   16G   2% /dev/shm
tmpfs                 tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs                 tmpfs      16G     0   16G   0% /sys/fs/cgroup
/dev/sda1             vfat      498M  208M  290M  42% /boot/efi
/dev/sda2             vfat      4.0G  2.4G  1.7G  60% /recovery
tmpfs                 tmpfs     3.2G   76K  3.2G   1% /run/user/1000
Code:
# fdisk -l
Disk /dev/sda: 232.91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 850 
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: gpt
Disk identifier: 0C1CC56F-4C18-4B42-8A51-EB2C29190F45

Device         Start       End   Sectors   Size Type
/dev/sda1       4096   1023998   1019903   498M EFI System
/dev/sda2    1024000   9412606   8388607     4G Microsoft basic data
/dev/sda3    9412608 480004462 470591855 224.4G Linux filesystem
/dev/sda4  480004464 488393070   8388607     4G Linux swap


Disk /dev/sdb: 4.56 TiB, 5000981078016 bytes, 9767541168 sectors
Disk model: TOSHIBA HDWE150 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F087E637-C873-47D8-874C-6059EE7EA127

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 9767540735 9767538688  4.6T Linux filesystem




Disk /dev/mapper/cryptdata: 224.39 GiB, 240926252544 bytes, 470559087 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


Disk /dev/mapper/data-root: 224.39 GiB, 240925016064 bytes, 470556672 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


Disk /dev/mapper/cryptswap: 3.102 GiB, 4294442496 bytes, 8387583 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
/dev/sdb is my /home from my old Fedora 27 install.

Thank you in advance.
 
Old 05-04-2020, 05:31 PM   #2
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
Code:
 UUID=<partition's uuid>    <mount point>    <filesystem type>    <options>    0 0
Assuming the most probable values from what you describe:
Code:
  UUID=<whatever>  /home/<username>  ext4  defaults  0 0
 
1 members found this post helpful.
Old 05-04-2020, 07:57 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
thank you that is what I was looking for.

will there be an issue with the fact the OS already had a /home on the root directory located on the SSD?
 
Old 05-04-2020, 09:40 PM   #4
sxy
Member
 
Registered: Aug 2019
Posts: 43

Rep: Reputation: Disabled
Quote:
will there be an issue with the fact the OS already had a /home on the root directory located on the SSD?
In fact you cannot mount your device at /home if there's no /home directory at all. What matters is that data stored under /home become inaccessible when a new device has been mounted at /home. I think you can do like this:
Code:
# mv /home /home.bak
# mkdir /home
# mount <new device> /home
 
Old 05-04-2020, 10:07 PM   #5
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
No, there won't be an issue as far as your system is concerned. What will happen is the new mount will mask the existing data and it will be unavailable as long as the new partition is mounted. The existing data will again be available as soon as the new is unmounted.
 
Old 05-04-2020, 10:55 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,708

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
The differences between the two operating systems could result in applications failing because user default configurations in your home directory are different.

To be on the conservative side I would not mount the drive as /home.
 
Old 05-06-2020, 07:54 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
how is it related to this: https://www.linuxquestions.org/quest...1-4175674514/?
 
Old 07-22-2020, 05:24 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by charlly View Post
[link also removed]
WTH? Reported.

Last edited by rtmistler; 07-22-2020 at 07:36 AM.
 
Old 07-22-2020, 07:39 AM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
User charlly,

Welcome to LQ.

When posting in technical threads, please avoid possible off-topic, or unclear information and also recommend against posting links to a search engine with no apparent purpose.

User ondoho,

Please avoid using textspeak because it can be unclear and misunderstood by others, and also please avoid quoting links from other users in situations where you are reporting those.

@All: Please keep the thread on topic.
 
Old 07-22-2020, 11:31 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ The link was "https://google.com".
 
Old 07-22-2020, 12:19 PM   #11
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Quote:
The differences between the two operating systems could result in applications failing because user default configurations in your home directory are different.
I can't recall who I learned this from but this is a prime example of why a shared /home is a bad idea for multiple os types. Better to mount this new disk at /data or /mnt/data or something. Move your data directories in /home/"$USER" to a folder on that drive, then symlink them to your /home/"$USER"/

This keeps all .* files unique to each os installed, and avoids any potential crossover or corruption issues when there are minor differences to the same file in different OS's. And you maintain full access to your data.
 
Old 07-22-2020, 01:07 PM   #12
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by ondoho View Post
^ The link was
Can I ask the continued purpose of your posting here where it appears to be off topic? Such as clarification that it is instead relevant to this thread?

It was clear from reports that people felt it was potential spam, and the link was removed. Meanwhile it is only a link to a very well known search engine.

I also requested people to remain on topic in this thread.

This has been a continued behavior of yours, which is to continue posting in spite of a request on my part to keep threads on topic. Please refrain from being unclear, and also giving an impression that you wish to continue off-topic discussion when it is inappropriate, and requested to be discontinued in threads.
 
Old 07-22-2020, 06:45 PM   #13
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
You will have user(s) and groups currently defined in /etc/passwd & /etc/group together with corresponding UID/GID's in the Pop!_OS install.

There is no particular reason to suppose they will definitely align with your /home [except for root which always has UID=0]
If there is a disparity, you may get some strange file permission issues.
 
Old 07-23-2020, 02:16 AM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by rtmistler View Post
Can I ask the continued purpose of your posting here where it appears to be off topic? Such as clarification that it is instead relevant to this thread?

It was clear from reports that people felt it was potential spam, and the link was removed. Meanwhile it is only a link to a very well known search engine.

I also requested people to remain on topic in this thread.

This has been a continued behavior of yours, which is to continue posting in spite of a request on my part to keep threads on topic. Please refrain from being unclear, and also giving an impression that you wish to continue off-topic discussion when it is inappropriate, and requested to be discontinued in threads.
rtmistler, I simply clarified why it was OK to not edit the link out in this particular case.
How is that a problem for you?
I would have left it at my previous post but now you asked me a question I feel the need to answer.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Unity8.org To Fork Unity8 Asking What Name Should Unity8 Fork Have LXer Syndicated Linux News 0 04-08-2017 05:33 PM
fork(fork()) is it possible...!!! Sibasish Linux - Kernel 3 02-14-2016 11:09 AM
LXer: HTML5: To Fork or Not to Fork LXer Syndicated Linux News 1 07-25-2012 07:58 PM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 03:35 PM
Suse 9, RH9 wont install properly. Mandrake 9 wont boot properly? Help. l2ich84 Linux - Newbie 1 01-31-2004 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration