Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Several /home volumes on different disks.

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
lwinch2006
Posts: 6
Joined: 2014-07-19 11:36

Several /home volumes on different disks.

#1 Post by lwinch2006 »

Hello.

Sorry for the noob question, but googling has not given clear answer for this question.
If I have 2 HDDs so during installation of Debian can I create several /home volumes: one on each HDD (I mean without creating RAID volume) and how will it be shown in Debian: several /home partitions mounted like HOME1, HOME2, etc or something else?

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Several /home volumes on different disks.

#2 Post by dasein »

Either your question isn't entirely clear, or I've not yet consumed sufficient coffee, so I'm going to answer the question I think you've asked, and hope for the best.

Yes, you can have different users' /home directories on separate physical volumes, but you cannot have multiple /home directories for a single user.

The trick behind having /home directories on different volumes involves some magic called a symbolic link (symlink for short). A symlink merely creates an association that allows one thing to be referenced by different names, sort of like when someone says, "Hi, My name is Zezazuzahbel, but you can call me Skip"

Let's work through a quick example where we symlink up a couple of /home directories for two users, Alice and Bob. I want to stress this is only an example, intended to teach you just enough for you to be able to understand what you're reading when I point you to Google/Startpage/DuckDuckGo/Bing/whatever. It is not a "step-by-step, do it exactly this way."

For this example, imagine that we have two disks, sda and sdb. For simplicity's sake, we'll imagine that each disk is formatted into a single volume, so our two physical volumes will be sda1 and sdb1. We will arbitrarily choose to have sda1 as the mount point for our root filesystem. Since the actual directory called /home has to live somewhere, so we'll also arbitrarily put it on sda1, as well.

For simplicity's sake, we'll imagine making a directory called Alice on sda1, and a directory called Bob on sdb2.

Having /Alice and /Bob appear as /home/Alice and /home/Bob is a matter of symlinking the actual location (say, /Alice) with the symbolic location (/home/Alice).

It's no harder than that.

As I hinted above, there's tons of reading material on symlinks on the InterWebz, and now that you know what to search for, go forth and learn. Post back if you have specific questions.

User avatar
buzzin
Posts: 121
Joined: 2013-12-31 09:42

Re: Several /home volumes on different disks.

#3 Post by buzzin »

If you want to have the space of both disks available in your home partition without symlinks this is possible with LVM.
But not in the way you image (you are thinking too much along the lines of windows drive letters)

With LVM (Logical Volume Manager) the physical disks no longer matter after configuration.
The steps are easy, the commands slightly harder, but you can use a graphical partitioning program.
- Create the physical volumes on the disk and tag them as being lvm (fdisk or gparted and set type to 8e/LVM) (in this example /dev/sda6 and /dev/sdb1)
- Now tell LVM to configure these created volumes as PV's (pvcreate /dev/sdb1; /pvcreate/sda6)
- Create a Volume group (vgcreate VGSYSTEM)
- Create a logical volume (lvcreate -n lvHOME VGSYSTEM)
- Create a filesystem on this LV (mkfs.ext4 /dev/mapper/VGSYSTEM-lvHOME)
- Mount the LV in /home (mount /dev/mapper/VGSYSTEM-lvHOME /home)
- add the LV to /etc/fstab

Of course, it would be much easier to set up LVM at the moment you install Debian :)
Sysadmin/KDE user

Post Reply