[NTLUG:Discuss] Re: Creating a shared folder

Bryan J. Smith b.j.smith at ieee.org
Mon Sep 27 00:01:06 CDT 2004


On Sun, 2004-09-26 at 20:31, David Ross wrote:
> This may seem trivial,but I'm having a mental block
> $cat /etc/fstab
> /dev/hda2               /                       ext3    defaults        1 1
> /dev/hda1               /boot                   ext3    defaults        1 2
> /dev/hdb1               /games                  ext3    defaults   2 1
> I created a user "shared" and it appears in /home/users/
> I would like "shared"'s directory on hdb
> I'm guessing I need to shrink the hdb1 partition down to create hdb2 and name 
> it /shared in fstab? I honestly don't remember how I created /games on hdb1 
> it's been so long ago.

Growing/shrinking partitions/filesystems isn't something you do on a
whim in any OS -- unless you use logical volume management (LVM).  Given
your system layout, I wouldn't touch a thing.  I'd create symlinks:

Step 1:  Replicate /home/users to /games/users
  # mkdir /games/users
  # cd /home/users
  # find . -mount | cpio -pmdv /games/users

Step 2:  Create symlinks to /games/users
  # cd ../
  # mv users old.users
  # ln -s ../games/users ./
  # cd /
  # ln -s games/users ./

Symlinks are typically all you need.  Normally you wouldn't do it this
way, but given that you didn't lay out any special filesystems in the
first place, it will do.

-- Bryan

P.S.  Typically you should _avoid_ creating new TLDs (top level
directories).  They are wholly unnecessary under UNIX/Linux, and go
against the Linux Filesystem Hierarchy Standard (FHS).

Games and other, localized software should be under /usr/local[/games]
or /opt[/games].  Symlink so the binaries are in the PATH.

E.g., game binaries will be symlinked as:
  /usr/local/(gamebin) -> /usr/local/games/(game)/(gamebin)
                    or -> /opt/games/(game)/(gamebin)

User accounts should go somewhere under /home
Use ~username to access home directories and _never_ by direct path.

Also considering creating a group instead of a user for "shared" access.
I typically create user accounts under a group subdirectory of /home.
E.g.,

  drwxr-xr-w  pfchang  acct  /home/acct/pfchang
  drwxr-xr-w  tbhoser  acct  /home/acct/tbhoser
  drwxrwsr-t  root     acct  /home/acct/shared

  drwxr-xr-x  bjsmith  engr  /home/engr/bjsmith
  drwxr-wr-x  cmsmith  engr  /home/engr/cmsmith
  drwxrwsr-t  root     engr  /home/engr/shared

It also makes life easy if and when I need to segment servers by
department.  Then I can mount /home/engr, /home/acct, etc... from
different servers.

But how you organize user accounts is up to you.  But you _should_ try
to mount them under /home -- or at least symlink to home.  That's up to
you.


-- 
Bryan J. Smith                                  b.j.smith at ieee.org 
------------------------------------------------------------------ 
"Communities don't have rights. Only individuals in the community
 have rights. ... That idea of community rights is firmly rooted
 in the 'Communist Manifesto.'" -- Michael Badnarik





More information about the Discuss mailing list