You are not logged in.

#1 2018-04-27 06:20:08

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

How to get /home on second drive?

Hey, guys. I have just recently gotten an SSD, it has only 80GB on it -- and I have decided to put it into my desktop (instead of replacing my laptop drive). So, here is the question -- how would I mount my home on my HDD (which also has my W10 information)

I know that you add this:

 # mount /dev/sda1 /mnt 

- in order to mnt root

then

 # mkdir /mnt/boot 

 # mount /dev/sda2 /mnt/boot 

But would I do this in order to mount the /home?

 # mount /dev/hda1 /mnt 

 # mkdir /mnt/home 

 # mount /dev/hda1 /mnt/home 

or would it be?

 # mkdir /home 

 # mount dev/hda1 /home 

Btw I am guessing the second drive will be called "hda1" - I do not know what it is called yet.

Also, to create a new partition -- all I need to do is press "n" and continue as usual right? It will not magically delete my Windows install? (I need it for school). Thanks in advance guys, I looked through the Arch wiki, but it does not list how to make a separate /home partition on another drive - I know I am probably just missing it though.

EDIT: Or actually, do I have to list the drive BEFORE I list the drive for both the mount and mkdir?

EDIT 2: Correction from "second drive" to "HDD".

Last edited by JustAcouch (2018-04-27 07:04:49)

Offline

#2 2018-04-27 06:32:20

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: How to get /home on second drive?

Have you tried replacing the $HOME folder with a symlink. I use this for things like Pictures, Documents ... etc. which are variously stored in either separate partitions or external drives.

Also, rather than referring to HDA1, you should use the UUID of the device. Further, have you thought about the consequences should the new hard disk be lost or be otherwise unavailable. Like I implied above, you don't actually need to move the entire $HOME folder, just the bits that hold non-critical files and folders.

Irvine

Edit:

By the way, if I understand you properly, I think most of what you are trying to do should be done in fstab. Here is a copy of mine for comparison:

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>

# It's a modern ssd and, during testing, didn't see any problems with discard, so, since it improves performance....
# Tried mounting the USBs Backup1/2, but had intermittent mount problems at boot these were solved after removing 
# them from fstab and letting Gvfs do the work, (see below)

#### Edited orginal Arch mount to changed to noatime and discard
# see https://www.kernel.org/doc/Documentation/filesystems/ext4.txt for data=ordered
UUID=7504bbf8-3e9a-4107-b6e6-35e1f88a6170	/                   ext4     rw,noatime,discard,data=ordered   0  1

#### Swapfile (see https://wiki.archlinux.org/index.php/Swap#Swap_file_creation
# The 'defaults' mount option, refers to those set by the kernel, 
# (see http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT%20OPTIONS)
/swapfile none swap defaults 0 0

#### Mount Efi boot, Basicaly copied from Ubuntu, (changed fsk order to 2, cf https://bbs.archlinux.org/viewtopic.php?id=144624,)
UUID=0180-0C11  /boot/efi       vfat    umask=0077      0  2

#### Edited to mount Shared partition as part of file system using nofail option
UUID=aa187036-c60c-4140-8b89-2a0e6a88b662 /home/stupidme/Shared      ext4    rw,noatime,discard,data=ordered,nofail,x-systemd.device-timeout=1   0  2

#### Edited to mount ArchOB partition as part of file system using nofail option
#removed since partition no longer exists 
#UUID=a4686797-15e5-418c-81b7-4e8240083e1e /home/stupidme/ArchOB      ext4    rw,noatime,discard,data=ordered,nofail,x-systemd.device-timeout=1   0  2

#### Edit to mount Ubuntu partition as part of file system using nofail option.
### Removed since no longer have this partition and use USB for xubuntu
###UUID=5b8a2244-6254-40ab-9d6e-a7751854063a /home/memyself/Ubuntu      ext4	 rw,noatime,discard,data=ordered,nofail,x-systemd.device-timeout=1   0	2

Additionally, although in theory you can use fstab's nofail option to mount the external drive, due to intermittent mount problems,  when I switched to Openbox, I found it more reliable to mount the external external drive from the autostart file.

.....
# Mount Docs
bash -c "gvfs-mount -d `readlink -f /dev/disk/by-uuid/5b93be13-f5a9-467b-bc47-5c56062c5516`"
.....

Last edited by IrvineHimself (2018-04-27 06:54:42)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#3 2018-04-27 06:52:21

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

IrvineHimself wrote:

Have you tried replacing the $HOME folder with a symlink. I use this for things like Pictures, Documents ... etc. which are variously stored in either separate partitions or external drives.

Also, rather than referring to HDA1, you should use the UUID of the device. Further, have you thought about the consequences should the new hard disk be lost or be otherwise unavailable. Like I implied above, you don't actually need to move the entire $HOME folder, just the bits that hold non-critical files and folders.

Irvine

No, I have not tried yet. I assume I should do that immediately when I get to the CLI after install? Also, sorry - this may have gone over my head - but I have not installed the SSD yet either, I will be doing that tomorrow, but why should I refer to the UUID instead (sorry, I am only one month into Linux).

Also, is there no other way besides a symlink? Will there be any major difference between just using a symlink and installing all of home on another drive?

EDIT: sorry about the picky questioning -- I am just trying to figure out all this Linux stuff -- and I have not heard of symlink yet.

EDIT 2: Thanks for the reply, I will be looking more into fstab tomorrow morning - also thanks so much for the reference - it sets me on the right track!

Last edited by JustAcouch (2018-04-27 07:06:53)

Offline

#4 2018-04-27 07:16:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,541

Re: How to get /home on second drive?

No reason for a symlink, unless you want them more fine grained than simply on a separate partition. just create a designated partition on the HDD. And then mount it to /mnt/home so that genfstab generates the correct entries: https://wiki.archlinux.org/index.php/In … le_systems

Last edited by V1del (2018-04-27 07:19:41)

Offline

#5 2018-04-27 07:45:56

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: How to get /home on second drive?

1), I edited my original post while you were posting your reply. The edit may help clarify things.

2) Symlinks:, (with a nod to @V1del's comment)
Search Google for "bash symlinks" "linux symlinks", or just plain "symlinks". Wikipedia has in depth explanation of their use. Briefly, unlike the "shortcut link" you should be familiar with from Windows, to all practical purpose a symlink acts as if it is the linked folder. Symlinks are amazing things, very powerful, easily implemented and a "must master skill" for any Linux newbie.

3) UUID: "Universally Unique Identifier" The human name assigned to peripheral devices can change for a variety of reasons, particularly the order or port they are connected to. This means that, at some point, any reference to the "human name" is likely to fail. The UUID of a device is more or less constant. I say more or less, since skilled users, along with certain specific operations like "wiping" can change a devices UUID. The main point to note though is that once the UUID is set, unlike a "human name" it takes a concious act to change it.

To find a devices UUID, Google "bash find uuid of device"

4) Part of the beauty of Arch is that it is a rolling release. This means you can continuously tinker and tweak till you hearts content without ever having to re-install. When I first installed Arch I kept a detailed record of everything I did. Even though I have never  re-installed the Arch base, my current Arch box is far removed from those original first tentative explorations. Succinctly, you can set up the external drive, with or without your $HOME folder, using your current desktop environment of choice whenever you like.


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#6 2018-04-27 22:35:04

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

IrvineHimself wrote:

1), I edited my original post while you were posting your reply. The edit may help clarify things.

2) Symlinks:, (with a nod to @V1del's comment)
Search Google for "bash symlinks" "linux symlinks", or just plain "symlinks". Wikipedia has in depth explanation of their use. Briefly, unlike the "shortcut link" you should be familiar with from Windows, to all practical purpose a symlink acts as if it is the linked folder. Symlinks are amazing things, very powerful, easily implemented and a "must master skill" for any Linux newbie.

3) UUID: "Universally Unique Identifier" The human name assigned to peripheral devices can change for a variety of reasons, particularly the order or port they are connected to. This means that, at some point, any reference to the "human name" is likely to fail. The UUID of a device is more or less constant. I say more or less, since skilled users, along with certain specific operations like "wiping" can change a devices UUID. The main point to note though is that once the UUID is set, unlike a "human name" it takes a concious act to change it.

To find a devices UUID, Google "bash find uuid of device"

4) Part of the beauty of Arch is that it is a rolling release. This means you can continuously tinker and tweak till you hearts content without ever having to re-install. When I first installed Arch I kept a detailed record of everything I did. Even though I have never  re-installed the Arch base, my current Arch box is far removed from those original first tentative explorations. Succinctly, you can set up the external drive, with or without your $HOME folder, using your current desktop environment of choice whenever you like.

Uh, alright! Thanks very much. So as a confirmation, just install everything on the SSD? Then perform a symlink?

That, actually does seem very practical -- I can quickly read about symlinks in one of my Linux books (I actually have 3 -- a general Admin book, a Bash Shell book, and a portable Shell book). Yep -- found an entire explanation on it!! Thanks for the lead man, I was quite a while from the page introducing it, and I definitely understand what you are saying now.

Offline

#7 2018-04-27 23:08:36

SealsRock12
Member
Registered: 2018-04-03
Posts: 83

Re: How to get /home on second drive?

You can resize the parition of the Window 10 install to make your home partition and to mount your root partition ("X" in this case):

# mount /dev/sdaX /mnt

To mount the home (assuming HDD is /dev/sdb and your number for the home is "X"):

# mkdir /mnt/home
# mount /dev/sdbX /mnt/home

Then mount your other partitons.

Last edited by SealsRock12 (2018-04-29 19:55:53)


-- SealsRock12

Offline

#8 2018-04-27 23:51:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,384
Website

Re: How to get /home on second drive?

I'd advise against a symlink.  It just seems like needless complexity for no reason other than "symlinks are cool".  Symlinks may be cool (I'd agree they are, and I'd agree you should learn how to use them) but this doesn't mean they should be used just because they could be.  It is typical for /home/ to be it's own partition - most of the installation documentation assumes it is - so just follow the installation guide as is with no symlinking.  The fact that the home partition is on a separate device that the root partition is really irrelevant: you still mount it exactly the same way.

Last edited by Trilby (2018-04-27 23:51:32)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2018-04-28 00:32:24

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

SealsRock12 wrote:

You can resize the parition of the Window 10 install to make your home partition and to mount your root partition ("X" in this case):

# mount /dev/sdaX /mnt

To mount the home (HDD is /dev/sdb and your number for the home is "X"):

# mkdir /mnt/home
# mount /dev/sdbX /mnt/home

Then mount your other partitons.

Oh. Wow. So you do not need to specify the drive when creating the directory, only when mounting?  Also to "resize", all you need to do is add another partition and specify the size?

Here's another question. If I were to create a new partition on my SSD what directory would I have to add in in order to symlink from the /home on my HDD (Could I simply just add in something like

 mkdir /mnt/homelink 

, mount it to my SSD and then place the files I require "speed" on to there? Also does 40G for root, then 16G for swap (2x8) sound good? I really do not know how much space is recommended for /boot, should I add in 10G? I have heard of some people using less than a G, so would a 1G be enough (suggested size off Arch WIki is only 550mb) and then I could use remaining space for /homelink? Or is /boot already in the root directory, so would it be unnecessary to add another partition - or would it be required since I am dual-booting?

Offline

#10 2018-04-28 00:35:47

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

Trilby wrote:

I'd advise against a symlink.  It just seems like needless complexity for no reason other than "symlinks are cool".  Symlinks may be cool (I'd agree they are, and I'd agree you should learn how to use them) but this doesn't mean they should be used just because they could be.  It is typical for /home/ to be it's own partition - most of the installation documentation assumes it is - so just follow the installation guide as is with no symlinking.  The fact that the home partition is on a separate device that the root partition is really irrelevant: you still mount it exactly the same way.

Yeah, I have not gotten to that in either of my books yet, so I will wait until I get to that part and read up on it. However, would I need to create another partition for a symlink (say if I were to symlink between my Home of my HDD to a dir called "homelink" on my SSD), or could I just make a new directory later and save that part for when I am more advanced with partitioning and the filesystem?

Offline

#11 2018-04-28 01:20:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,384
Website

Re: How to get /home on second drive?

Yes, you would need to mount the partition from the HDD somewhere, then you'd have to symlink that "somwhere" to /home/ - so why bother, just mount it on /home/ as save the extra unnecessary and potentially problematic step.

There's really nothing out of the ordinary here.  Just follow the installation guide and don't try to do anything "creative" as there is nothing unique about your goals.

Last edited by Trilby (2018-04-28 01:20:41)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2018-04-28 01:27:01

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,871

Re: How to get /home on second drive?

All this talk of symlinks, they WILL NOT WORK in this case. The /home dir is managed by pacman, if you replace that with a symlink, updates of the filesystem package will fail. Do not even consider it.

Offline

#13 2018-04-28 03:21:02

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: How to get /home on second drive?

Scimmia wrote:

All this talk of symlinks, they WILL NOT WORK in this case. The /home dir is managed by pacman, if you replace that with a symlink, updates of the filesystem package will fail. Do not even consider it.

Very interesting, and good to know. Like I said, I only use symlinks to move big bulky folders like Documents, Pictures and Videos... However, just out of idle curiosity, would that apply to a hardlink?

Note: My question is just idle curiosity, and I am in no way suggesting the OP should create a hardlink.

EDIT:
Ignore this, I found an answer that shows how stupid this question is

Hard Links

For files only & you cannot create on different partition ( it should be on same partition ) & got same inode number as original

If the real copy is deleted the link will work ( because it act as original file )

Last edited by IrvineHimself (2018-04-28 03:32:32)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#14 2018-04-28 03:26:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,871

Re: How to get /home on second drive?

Hard links only work within the same filesystem and don't work for directories, so it makes no sense in this context anyway.

Last edited by Scimmia (2018-04-28 03:27:57)

Offline

#15 2018-04-28 12:13:23

sincomil
Member
Registered: 2018-02-13
Posts: 118

Re: How to get /home on second drive?

It is not clear what you want to do with new SSD. Did you want to install Arch on that drive and mount your /home dirctory from old HDD or just want to put you /home directory on that new SSD?

Offline

#16 2018-04-29 02:36:05

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

sincomil wrote:

It is not clear what you want to do with new SSD. Did you want to install Arch on that drive and mount your /home dirctory from old HDD or just want to put you /home directory on that new SSD?

I will install everything but /home on the SSD, my HDD will have my /home and Windows files on it (Games, documents, apps, just not Windows -- I have that on another SSD).

I am having an issue resizing my HDD right now though. I first tried resizing through the Windows Disc mananger when I realized it would not work with Linux -- so I have moved on to Gparted (which was linked to me from Arch Wiki -- and useful since I do not have much experience with partitoning and resizing). However, at the moment I am unable to resize and create more partitions because the filesystem is listed under "unknown" for my "storage pool" (which is the second partition on my HDD). I have to change the filesystem to FAT32, right?

I might try to install Arch Linux on two USBs first instead (one with /boot, swap, and root - and another with only /home), so I can get some practice with this partitioning and resizing stuff before I mess with my important data on my HDD....

EDIT: Actually hold up, I think I realize how to do it now.

Last edited by JustAcouch (2018-04-29 02:58:05)

Offline

#17 2018-04-29 03:02:49

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: How to get /home on second drive?

FAT32 is only needed for the EFI partition.  Windows file systems can remain ntfs (make sure you install ntfs-3g to be able to write to them, as the default kernel only has read access to ntfs filesystems).  Linux filesystems can be any number of types, but ext4 is probably the most common.  Btrfs is another choice, but not necessarily as stable and reliable as ext4.  If you aren't sure what any of those are, check https://wiki.archlinux.org/index.php/File_systems wiki page.

Offline

#18 2018-04-29 06:01:56

JustAcouch
Member
Registered: 2018-03-30
Posts: 13

Re: How to get /home on second drive?

circleface wrote:

FAT32 is only needed for the EFI partition.  Windows file systems can remain ntfs (make sure you install ntfs-3g to be able to write to them, as the default kernel only has read access to ntfs filesystems).  Linux filesystems can be any number of types, but ext4 is probably the most common.  Btrfs is another choice, but not necessarily as stable and reliable as ext4.  If you aren't sure what any of those are, check https://wiki.archlinux.org/index.php/File_systems wiki page.

Uh alright. I am pretty sure I have UEFI -- however my bios is pretty wierd (it says UEFI + Legacy), when looking in Windows -- Windows displays Legacy and I am able to boot devices instantly from my bios -- so I am assuming I have legacy -- however my Arch Linux install states "UEFI" and if I enter

 ls /sys/firmware/efi/ 

(from the installer), I get a response......

EDIT: I will just move forward with the UEFI settings -- I guess I eally do not care about Windows -- I can always reinstall if I fuck something up (I only need it for school after all and to play games with my friends). I guess since it states UEFI first in "UEFI + Legacy" I just botched up my Windows install with Legacy rather than UEFI mode.

Last edited by JustAcouch (2018-04-29 06:21:25)

Offline

Board footer

Powered by FluxBB