LinuxQuestions.org
Visit Jeremy's Blog.
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 05-18-2011, 12:18 PM   #1
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Rep: Reputation: 146Reputation: 146
Home partition as storage area


I have a fairly large home partition,and several directories with content in, that currently reside in my home account.
I now have two slackware installs and would like the content to be available to both installs.
Is it OK/advisable to make a directory in /home that has the content in, that both user accounts are mapped to for the content (music and video mainly)?
I was thinking of setting the folder as readable/writable by all. This bit makes me wonder if I might encounter problems.

There is no spare partition or alternative drive that I could use for this purpose and there is too much data for me to duplicate it in both user accounts.
 
Old 05-18-2011, 12:37 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,172

Rep: Reputation: Disabled
I don't see any problem here, if you are not scared of some other people accessing your files.

Or, you cans make your two users belong to a specific group, to which you would grant read and write access on the directories in concern and their content.

Last edited by Didier Spaier; 05-18-2011 at 12:38 PM.
 
Old 05-18-2011, 12:44 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
If you want to keep those directories in /home/yourusername, then recursively change the permissions to whatever you need. For example, possibly 775. You then could add other user accounts to your normal username group account. If there are a limited number of users and you trust them, you could assign full world permissions to those directories. Such as 777.

I have several such top level directories that I wanted usable to other accounts. I created /home/Files and placed my data files there. I assign ownership to those files with root:users.

I created /home/Media and created Music and Photos directories there. I created a new group called media and assigned ownership of root:media to those files.

Then I add user accounts to those groups.

I have a "public" directory too: /home/public.

This approach helps keep each user account directory slim as there are no data files there.

On traditional enterprise systems users typically are limited to where they can store files, which is why dumping everything in /home/yourusername is normal. That typically is not the case with home systems and files can be stored and shared almost anywhere. Yet even with home systems some security is needed such as from caffeine-deprived mental conditions, innocent but curious children, and stray cats that walk on keyboards.

If you are concerned about XDG, edit /home/yourusername/.config/user-dirs.dirs to the new locations.

Lots of ways to do what you seek. Make some backups and then try different options until you are satisfied.

Last edited by Woodsman; 05-18-2011 at 12:47 PM.
 
Old 05-18-2011, 02:37 PM   #4
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Original Poster
Rep: Reputation: 146Reputation: 146
I should have added that I'm the only person that uses this machine.

In the short term I've created /home/Media and /home/Data and put the appropriate folders in them, though I obviously had to chown them to my home account to be able to write to them.

But, I notice that from Gnome on Slackware13.1 I can access every directory in /home/, including the user account folder from 13.37 and vice versa although I didn't have to chown anything from 13.1 and that /home/Media and /home/Data are writable from 13.1 without having done any group creation.

As for the group thing, this is the first time I've ever really had to look at this. Making world writable folders, even on a machine that only I use, is not good practice, so I do need to get my head round this aspect of administration.
Time to hit the books.

Thanks for the replies.
 
Old 05-18-2011, 06:09 PM   #5
xflow7
Member
 
Registered: May 2004
Distribution: Slackware
Posts: 215

Rep: Reputation: 45
This thread is timely as I have been contemplating a similar (but not identical) scenario. I have Slack 13.1 and 13.37 both installed for the time being. I have separate home partitions for each. I don't want to use the same home directory for both because I want my .* config files separate. But I do have various files I'd like to be able to access from both for an indeterminate period.

My thought was to have a third partition (I'll call it DRW_Docs) which would have these portable files and mount this on a directory in /home/drw1 on whichever Slack I happened to be running, thereby making the files inside accessible from either.

I'd like the file ownership/permissions on that directory to be, say, drw1:users 755.

So I have a directory called /home/drw1/Documents with those permissions.

Now, as far as I can tell, if DRW_Docs is formatted ext2/3 I can't set the uid/gid in fstab regardless of user/owner/groups options - it will always get mounted as root:root. Is there a way around this so that once mounted /home/drw1/Documents has the ownership/permissions I want? Or is there a better approach?

Second question. I know I can change the permissions *after* it's mounted. And through some wizardry, once I do that, it will always mount the way I want it (which meets my basic requirement). But the problem is, *I don't know how it does that*! And that drives me crazy! The permissions of the special file in /dev are unchanged, so that's not it. And once unmounted, /etc/mtab doesn't show anything. So, can someone explain where Slack is storing the info that I changed those permissions so that the next time I mount it they are persistent?

Thanks,

Dave
 
Old 05-18-2011, 10:38 PM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Change the permissions of the mount point and not fstab.

I'll share how I do things. YMMV.

Since my MS-DOS days in the 1980s I have used multiple partitions. In those days I installed the operating system in C:. apps in D: and I saved my data files in E:. I use the same approach with my systems today.

I have two internal SATA II drives in my office system. Here is a partial snapshot:

Code:
/dev/sda1             494M  136M  333M  29% /boot
/dev/sda3              60G   12G   45G  21% /home
/dev/sda5             2.0G  102M  1.8G   6% /usr/local
/dev/sda6             2.0G   36M  1.9G   2% /tmp
/dev/sda7             5.0G  241M  4.5G   6% (Slackware 12.2 /var)
/dev/sda8              14G  6.5G  6.7G  50% (Slackware 12.2 /)
/dev/sda12            5.0G  243M  4.5G   6% (Slackware 13.1 /var)
/dev/sda13             14G  5.9G  7.3G  45% (Slackware 13.1 /)
/dev/sdb1             145G   96G   47G  68% /home/public
/dev/sdb2             150G   94G   56G  63% /home/public/archives
tmpfs                 1.9G   60K  1.9G   1% /dev/shm
That many partitions might seem like too much overhead to some people. Yet my partition scheme provides a lot of flexibility. When installing or updating my operating systems I never have to worry about my user directories or my collection of scripts, fonts, local configuration, and sound files in /usr/local. Nor do I worry about files in /home.

The partition scheme helps me because I need to maintain both 12.2 and 13.1 systems. When I boot into one system or the other, I have the same mount points. For example, all of my /usr/local and /home files are located in the same place for both systems. A common /boot partition allows me to support multiple operating systems on one machine. In my early days of using Linux based systems I multi booted among four or five different systems, which is why I decided to use common partitions. These days I still tinker with other distros but only occasionally --- I use Slackware full time. Yet with multiple versions of Slackware I still find the common partition approach helpful.

In my /home partition I have the following directories:

Files (all kinds of data files: letters, documents, spreadsheets, PDFs, etc.) (771, root:users, set GID)
Media (music and photos) (775, root:media, set GID)
public (a mount point)
users (all of my user account directories)

/home/public is a mount point for /dev/sdb1. Under that mount point I have the following directories:

archives (another mount point: all kinds of long-term storage, DVD/CD images, and short-term backup files) (root:root)
builds (where I build my kernels and Slackware packages)
downloads (a common dumping ground for downloads) (root:users)
firefox_shared (at one time I used a common directory for Firefox when I was dual booting with Windows. I still use that location despite no longer dual booting with Windows.)
slackware (local mirrors of Slackware 12.2, 13.1, 13.37, Current) (root:root)
slackware64 (local mirrors of Slackware 13.1, 13.37, Current) (root:root)
tmp (root:users)
vm-images (all of my virtual machines) (root:vboxusers, set GID)

All of this is shared between 12.2 and 13.1.

A caveat: Typically copying a file means ownership of user:user. So for some directories, such as /home/Files or /home/Media, I assign the parent level set GID. Any file copied or created there gets group ownership of the respective group.

I use group ownerships in my HTPC too. The directory where TV recordings are stored are assigned group ownership of htpc. Any user account in that group can add or delete those recordings. Yet all of my DVD images that I copied to the HTPC are all assigned ownership of root:root, just like the remainder of the system. That way I don't have to worry about fat finger issues.

The whole point is don't be afraid to experiment. I have changed partition schemes and file locations a few times over the years and likely will again someday.

I hope this helps.

Last edited by Woodsman; 05-18-2011 at 10:40 PM.
 
Old 05-18-2011, 10:45 PM   #7
ChickTower
LQ Newbie
 
Registered: May 2011
Location: Michigan
Distribution: Slackware
Posts: 18

Rep: Reputation: 11
Post Home partition as storage area

Quote:
Originally Posted by salparadise View Post
I should have added that I'm the only person that uses this machine.

But, I notice that from Gnome on Slackware13.1 I can access every directory in /home/, including the user account folder from 13.37 and vice versa although I didn't have to chown anything from 13.1 and that /home/Media and /home/Data are writable from 13.1 without having done any group creation.
Since your's is the only user account (other than root), your user ID is probably the same in both installations of Slackware. Permissions are assigned by user IDs, not usernames, so both installations see your user as the same user, and you don't need to worry about assigning permissions by group until you have a second user you wish to have access to your "shared" directories. Whether using useradd or adduser, you can specify the user ID assigned, if it's not already in use. (I don't know what happens if the user ID is already taken.) I believe Slackware usually starts assigning user IDs with 100; other distros might use some other value.

Last edited by ChickTower; 05-18-2011 at 10:48 PM.
 
Old 05-19-2011, 09:26 AM   #8
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 715

Rep: Reputation: 112Reputation: 112
if you are the sole user (and hence the administrator) of these machines; why not make sure the usernames on both sides are the same as well as their uid? (or make them member of a similar group with the same GID on both machines... and make the dir 770 - 775 whatever is most approriate to you.
 
Old 05-19-2011, 10:02 AM   #9
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Original Poster
Rep: Reputation: 146Reputation: 146
From previous experience, using the same User name on two installs leads to "issues".

At the end of the day, having two distros installed on one machine, I now find, leads to unnecessary stress. Gnome is faster on 13.1 than KDE is on either 13.1 or 13.37.
Compiz is hard to find for Gnome on 13.1.
Compositing works perfectly on KDE without anything other than the NVIDIA driver needing to be installed.I have become well and truly used to wobbly windows and the general slickness of compositing.
Then there's email accounts - same account - 2 clients, "where is that email from the other day?"
Both rhythmbox and amarok can't do proper gapless playback.
Round and round the roundabout goes.

I've discovered I prefer KDE, or rather, that KDE is easier to get setup the way I have become used to.It's easier and a great deal less stressful (for me) to make a choice and stick with it.
So, KDE on 13.37 it is.

Good experience though. Lessons learned etc.

Thanks for all replies and help offered.
 
  


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
[SOLVED] Good book/training on NAS(Network Area Storage) not just theory. peterson.julia Linux - Networking 2 04-08-2011 04:35 PM
Mount storage partition folders to home folders skykooler Linux - Newbie 4 10-07-2010 10:56 PM
Host Protected Area (HPA) Partition rockarolla Linux - Newbie 2 08-25-2008 12:34 AM
Possible to get Home Area Directory path only knowing the username helptonewbie Linux - General 4 06-04-2007 03:39 PM
trying to access Network Shares on a Windows 2000 Storage area panito Linux - Networking 0 09-03-2004 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:25 PM.

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