LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-29-2014, 11:42 AM   #1
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Rep: Reputation: 77
Can you mount two partitions on the same mount point?


I have two different partitions on two different hard disks. Is it posible to mount both as /home at the same time?
 
Old 01-29-2014, 11:48 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
The short answer, yes and no.


In a mount scenario only one partition can use a mount point. However, there are things in the Linux world that allow us to setup multiple partitions as a logical volume and then mount that logical volume to a mount point.


NOTE: This requires a re-partition to mark the partitions as an LVM.

http://www.howtoforge.com/linux_lvm


Let us know if you have any questions.
 
1 members found this post helpful.
Old 01-29-2014, 01:57 PM   #3
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Yes. No idea if Slackware includes it (it ought to, considering it's included with all reasonably-modern kernels).
 
Old 01-29-2014, 02:59 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Quote:
Originally Posted by YellowApple View Post
Yes. No idea if Slackware includes it (it ought to, considering it's included with all reasonably-modern kernels).
You should really explain this, this is a special type of filesystem that is not commonly used. LVM + ext3 filesystems are much more standardized.

I personally would never use unionfs but there are people out there who do. I highly encourage you to search around on this topic before you implement to make sure you know what you are getting into.
 
Old 01-29-2014, 05:44 PM   #5
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Quote:
Originally Posted by Kustom42 View Post
You should really explain this, this is a special type of filesystem that is not commonly used. LVM + ext3 filesystems are much more standardized.
I'd argue that the concept of union mounts is very much standardized, and both UnionFS (which I linked) and aufs are already in very common use (particularly in live-CD environments).
 
Old 01-29-2014, 05:56 PM   #6
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 226

Rep: Reputation: 37
Ok - I know where you are heading - but ... traditionally the answer is a resounding 'yes'! However, you will only be able to see the last one :-(
 
Old 01-29-2014, 08:23 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 11,116

Rep: Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362
Not to get into a debate here.

Kustom42's first answer is really the correct answer to the question based on the word "mount" and no other inference. One might read the question as possible to exclude the "at the same time" assumption. One could mount two partitions to the same mount point at different times.

We can all agree that lvm, btrfs, zfs and other schemes like unionfs and aufs is a way to do what the OP may have had in mind.
 
Old 01-29-2014, 09:02 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,370

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
Quote:
Originally Posted by perbh View Post
Ok - I know where you are heading - but ... traditionally the answer is a resounding 'yes'! However, you will only be able to see the last one :-(
To be totally pedantic about it, they aren't actually mounted to the same point. You can mount the first one to, for example, /mnt/tmp (presumably part of the root filesystem). When you do the second mount, /mnt/tmp is now referring to the root inode of that first-mounted filesystem, and not to a directory on the root filesystem. You can see the effect of that if you try to umount that first filesystem by specifying the device:
Code:
# mount -r /dev/sdd1 /mnt/tmp
# mount -r /dev/sdd2 /mnt/tmp
# umount /dev/sdd1
umount: cannot umount /dev/sdd1 -- /dev/sdd2 is mounted over it on the same point.
 
Old 01-29-2014, 09:19 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,439

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
Originally Posted by YellowApple View Post
I'd argue that the concept of union mounts is very much standardized, and both UnionFS (which I linked) and aufs are already in very common use (particularly in live-CD environments).
I'd argue that you should ask the OP's intent for mounting the two partitions on the same mount point prior to offering advice on how to do it.
 
Old 01-30-2014, 12:09 PM   #10
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Quote:
Originally Posted by Richard Cranium View Post
I'd argue that you should ask the OP's intent for mounting the two partitions on the same mount point prior to offering advice on how to do it.
OP asked for a way to mount two partitions to the same mount point at the same time. I provided links to documentation of the kernel's ability to do precisely that without needing to take "intent" into account, given that the provided use case - having one mountpoint point to multiple locations simultaneously - is precisely what said kernel functionality was designed to handle.

Quote:
Originally Posted by jefro View Post
Not to get into a debate here.

Kustom42's first answer is really the correct answer to the question based on the word "mount" and no other inference. One might read the question as possible to exclude the "at the same time" assumption. One could mount two partitions to the same mount point at different times.

We can all agree that lvm, btrfs, zfs and other schemes like unionfs and aufs is a way to do what the OP may have had in mind.
I didn't mean to start a debate; apparently the concept of union mounts, despite having been around for at least two decades, is taboo around these parts...
 
Old 01-30-2014, 12:58 PM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,439

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
Originally Posted by YellowApple View Post
OP asked for a way to mount two partitions to the same mount point at the same time. I provided links to documentation of the kernel's ability to do precisely that without needing to take "intent" into account, given that the provided use case - having one mountpoint point to multiple locations simultaneously - is precisely what said kernel functionality was designed to handle.



I didn't mean to start a debate; apparently the concept of union mounts, despite having been around for at least two decades, is taboo around these parts...
There are use cases where LVM is superior to union mounts. Since I can't read minds as well you think you can, I would have had to ask the OP to determine what solution would best support his intent.
 
Old 01-30-2014, 01:04 PM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,439

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
Originally Posted by moisespedro View Post
I have two different partitions on two different hard disks. Is it posible to mount both as /home at the same time?
Since everyone else is busy showing how smart they are, I guess that I'll ask.

Why do you want to do this? Is there content on both partitions that you want to merge? Do you want to use both drives to store your stuff?
 
1 members found this post helpful.
Old 01-30-2014, 02:40 PM   #13
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Quote:
Originally Posted by Richard Cranium View Post
There are use cases where LVM is superior to union mounts. Since I can't read minds as well you think you can, I would have had to ask the OP to determine what solution would best support his intent.
I'm not denying that LVM has its merits, nor am I claiming to be a psychic. I merely put forward the tool specifically designed to do what OP asked for: the ability to have one mountpoint for multiple partitions.

If you're going to nag me for providing a quick and immediate answer instead of seeking additional clarification from OP, at least be consistent and do the same to Kustom42, who is equally guilty of making assumptions by your rationale.
 
Old 02-05-2014, 05:05 PM   #14
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Talking

Quote:
Originally Posted by YellowApple View Post
I'm not denying that LVM has its merits, nor am I claiming to be a psychic. I merely put forward the tool specifically designed to do what OP asked for: the ability to have one mountpoint for multiple partitions.

If you're going to nag me for providing a quick and immediate answer instead of seeking additional clarification from OP, at least be consistent and do the same to Kustom42, who is equally guilty of making assumptions by your rationale.
I am not guilty of making assumptions, I provided an option and told you to elaborate more on what is being asked. I actually talked about what LVM was in my post and this continuance of flaming each other on the boards needs to cease right now. Everyone here is trying to show how big their e-peen is and its ricidulous we are here to help the OP focus on that.


And yes you do need to provide details in your response not just I'm smart and know what I'm doing and use this. I explained possible impilications and provided a link to a tutorial with examples.

You posted a link to a FOSS project that is used on less distros than I can count on both hands out of the box. Explain this to the OP and say here is an option, its used on these and heres its benefits. Let them figure out if its right for them or not.


Feel free to disagree with any of the above with exception of ceasing the flaming, we are violating the forum rules here and need to focus on working together to build a strong community and keep people coming back. Remember we are all here because we <3 Linux
 
Old 02-05-2014, 07:49 PM   #15
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Quote:
Originally Posted by Kustom42 View Post
I am not guilty of making assumptions, I provided an option and told you to elaborate more on what is being asked. I actually talked about what LVM was in my post and this continuance of flaming each other on the boards needs to cease right now. Everyone here is trying to show how big their e-peen is and its ricidulous we are here to help the OP focus on that.
Pardon me? I'm not flaming, and I'm not waving an e-peen. I merely put forward a suggestion; OP can take it or leave it.

Quote:
Originally Posted by Kustom42 View Post
And yes you do need to provide details in your response not just I'm smart and know what I'm doing and use this.
Again: pardon? I never stated anything along those lines, nor intended to imply it.

Quote:
Originally Posted by Kustom42 View Post
I explained possible impilications and provided a link to a tutorial with examples.

You posted a link to a FOSS project that is used on less distros than I can count on both hands out of the box.
Union mounts are very common in LiveCD/DVD/USB environments, and UnionFS and aufs are the two most prevalent in-kernel implementations of the concept for Linux.

Quote:
Originally Posted by Kustom42 View Post
Explain this to the OP and say here is an option, its used on these and heres its benefits. Let them figure out if its right for them or not.
Very well.

A union mount allows multiple filesystems to be mounted simultaneously; the end result looks like a single filesystem, with a single mountpoint. This concept is commonly used in Unix-like operating systems; Plan 9 - Bell Labs' successor to Unix - makes extensive use of such filesystem combination, and is an awesome example of union mounts done right. There are multiple methods of implementing union mounts in Linux, two of them being UnionFS and aufs.

In the case of UnionFS, then - so long as your kernel supports it - you can easily make two filesystems accessible with one mountpoint:

Code:
mount -t unionfs -o dirs=/mnt/user-partition-1:/mnt/user-partition-2 none /home
For aufs:

Code:
mount -t aufs -o br=/mnt/user-partition-1:/mnt/user-partition-2 none /home
Both of the above assume that you've already established mountpoints for your two partitions that need to be mounted as /home.

There's also unionfs-fuse if your kernel doesn't include UnionFS or aufs and you don't feel like compiling kernel modules. That tool is also quite simple:

Code:
unionfs-fuse /mnt/user-partition-1:/mnt/user-partition-2 /home
I'm not sure about the availability of any of these in Slackware, though I do know that Slax (which is based on Slackware) previously used UnionFS and now uses aufs as of version 6. Debian has both unionfs-fuse and aufs.

Quote:
Originally Posted by Kustom42 View Post
Feel free to disagree with any of the above with exception of ceasing the flaming, we are violating the forum rules here and need to focus on working together to build a strong community and keep people coming back. Remember we are all here because we <3 Linux
Eeyup.

Last edited by YellowApple; 02-05-2014 at 07:51 PM.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding new partitions to existing mount point sanei05 Linux - Server 7 01-22-2014 05:59 AM
Two partitions one mount point? 1337 Linux - Newbie 8 04-30-2009 10:58 PM
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-10-2009 11:23 AM
setting mount point on partitions v1nc3nt Linux - Newbie 4 03-07-2006 07:46 AM


All times are GMT -5. The time now is 10:45 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration