LinuxQuestions.org
Visit Jeremy's Blog.
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 03-09-2013, 10:01 AM   #1
hilltownboy
Member
 
Registered: Jan 2008
Location: Ashfield, MA
Distribution: Debian 8 "Jessie", Arch, PCLinux
Posts: 104

Rep: Reputation: 15
common home partition: where mount?


I have set up a common home partition (labelled "data") accessable from two separate linux distributions. It is mounted on startup and the mount point is "/home/hilltownboy/data". In other words, it is mounted in my home partition.

Question: is there some other place that would be better? I am afraid of inadvertent confusion between the contents of "data" and "home". I have already succeeded in unintendedly wiping out a directory of important files from "data" so that they are lost to both distributions. (Fortunately I had backed them up beforehand.)
 
Old 03-09-2013, 10:25 AM   #2
mennohellinga
Member
 
Registered: Jun 2012
Location: AccountKiller
Distribution: AccountKiller
Posts: 72

Rep: Reputation: 38
I used to have the same kind of setup: Arch Linux and OpenSuse lived together on my machine, like this:
Code:
/dev/sda1        /boot for both OS'es
/dev/sda2        swap space
/dev/sda4        common data directory, contains all my personal stuff
/dev/sda5        root for Arch
/dev/sda6        root for SUSE
Both my Arch and my SUSE fstab files contained the line
Code:
/dev/sda4	/home/mh/doc	ext4      	rw,relatime,data=ordered	0 2
Thus, in both OS'es /dev/sda4 is mounted as /home/mh/doc. The only hard part here was making sure I had the same UUID on Arch and SUSE, so that the same file perms would apply. All my files stuff are on /dev/sda4, and all my local config files (.bashrc, .vimrc, .xinitrc) reside on the root partitions of their own OS'es, in /home/mh.

Another user asked a similar question over here.

Last edited by mennohellinga; 03-09-2013 at 10:28 AM. Reason: spelling
 
1 members found this post helpful.
Old 03-09-2013, 10:29 AM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,194
Blog Entries: 1

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Hi

I use a partition like that as well and it works very well I cant think of a better place to put it.
 
Old 03-09-2013, 11:46 AM   #4
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware{,-current}, OpenBSD
Posts: 377

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi,

giving a meaningful name to the mount point, like shared_data, might help preventing what you described (but this is only psychological). The fact that those data are on a different partition makes no difference, as long as you have write access to them. On my machine I have a different setup which works very well: I created the mount point in /home, then symbolic links in user directories pointing to it.

Create the mount point:
Code:
# mkdir /home/shared_data
Edit /etc/fstab and mount:
Code:
/dev/sdxx /home/shared_data ext3 defaults 1 2
Change owner group and permissions:
Code:
# chown :user /home/shared_data
# chmod 770 /home/shared_data
Code:
# ls -ld /home/shared_data
drwxrwx---  2 root   user  4096 Mar  9 17:39 /home/shared_data
Create link:
Code:
# ln -s -T /home/shared_data /home/user/shared_data
Code:
# ls -l /home/user/shared_data
lrwxrwxrwx 1 user user 14 Jan 19 17:56 /home/user/shared_data -> /home/shared_data
Deleting the user-created link would not delete anything on the partition. But this doesn't fully prevent what you described: even if you accessed the partition from the link, deleting a file or a directory there would mean losing it!

Kind regards,

Philip

Last edited by Philip Lacroix; 03-09-2013 at 02:57 PM.
 
1 members found this post helpful.
Old 03-09-2013, 01:57 PM   #5
hilltownboy
Member
 
Registered: Jan 2008
Location: Ashfield, MA
Distribution: Debian 8 "Jessie", Arch, PCLinux
Posts: 104

Original Poster
Rep: Reputation: 15
Many thanks to all. Your input is reassuring.
 
Old 03-10-2013, 06:57 AM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
I have a directory /usr/local/public where I put data which should be accessible from all distributions. I have also a directory "markus" there which is owned by the owner markus on every distribution my directories "Downloads", "Documents" and so on are simlinks to this folders in the /usr/local/public/markus/ directory.

I have created this data-partition outside of /home because every distribution has it's own /home partition and I want to use the same username for me with any distribution. The advantage of this setup is that one can use relatively small partitions for /home because they are only used for the personal configfiles, not the data.

It looks like this
Code:
markus@samsung:~$ df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
/dev/sda5        25G     19G  4,4G   82% /
/dev/sda6        20G     16G  3,1G   84% /home
/dev/sda10       11G    8,2G  2,2G   80% /usr/local
/dev/sda7        60G     55G  1,6G   98% /usr/local/public
/dev/sda8        60G     37G   20G   65% /usr/local/vm
tmpfs           2,0G    1,7M  2,0G    1% /dev/shm
/dev/sda3        98G     49G   50G   50% /usr/local/win7
markus@samsung:~$ ls -lh /usr/local/public/
insgesamt 107M
drwxr-xr-x  9 root   root  4,0K Okt 19 14:55 ExtPlatte/
drwxr-xr-x  7 root   root  4,0K Okt 12 16:21 bkp/
-rw-r--r--  1 root   root  107M Mär 29  2012 geocaching_mrz_12.tgz
drwx------  2 root   root   16K Nov  3  2011 lost+found/
drwxr-xr-x 11 markus users  12K Okt  7 21:21 markus/
markus@samsung:~$ ls /usr/local/public/markus/
Doc/  Dokumente/  Downloads/  Geocaching/  MeineBilder/  Musik/  Podcasts/  Programmierung/  Videos/
Markus

Last edited by markush; 03-10-2013 at 07:00 AM.
 
Old 03-10-2013, 08:57 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You could have it mounted on /home/data, and symlink to it from your different HOME directories. Another option is to -bind mount the partition at a second directory.

Imagine that you have to users sharing the directory. Putting it on /home/data will allow both users access without needing to grant read/execute access to your home directory for the other user(s). They need to reach it to be able to access it.
 
Old 03-10-2013, 03:33 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,090

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
I have been using /opt/DATA for years to share a drive between OS's
the user id is the fun part

some distros start at 500 others at 1000

there is nothing wrong with the home folder
common everyday mount places are
/mnt
/opt
 
  


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
mount /home, /var and /tmp to the same partition Kwahab Linux - Software 7 10-14-2009 01:14 AM
Mount the /home on a different partition hansalfredche DamnSmallLinux 9 02-25-2007 12:12 PM
/home is in extended partition. how to mount manually? damienduff Debian 4 01-31-2006 12:37 AM
BOGUS.common.04y -> /home/common/Mailbox jayakrishnan Linux - Networking 0 11-19-2005 04:48 AM
how to mount an old /home partition? snakeo2 Mandriva 6 12-20-2004 09:15 PM


All times are GMT -5. The time now is 09:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration