Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Subdirectory of /home on separate volume?



Tenga Wataru writes:

 > On one volume, I have my /, /home, /usr and /swap directories taking up
 > the entire disk. I would like to create another Linux partition on a
 > separate disk, for music files.

 > Can I designate that partition as a subdirectory of my /home,
 > e.g., /home/music?

Yes.

 > If so, when setting up that partition, should I name
 > its directory as /home/music, or should it be simply /music, and
 > defined as a /home subdirectory in some other way??

No.  You don't do anything special at all about naming its
directories.  Instead of that, you simply "attach" the partition to
the global file system at /home/music, and ordinary copy, move, etc
operations "just work".  The Linux kernel does the work of "hiding"
all this complexity, and just presents a single file system starting
at "/".

 > Or is there a better way to tackle this issue?

Each partition contains its own directory hierarchy, which can be
"attached" to the file system anywhere there is a directory.  The
process of binding a name in the Unix directory hierarchy to the root
of the directory hierarchy in the partition's filesystem is called
"mounting" the partition.

So what you would do is 

1. su
2. telinit s
   (optional but safer) Don't do this in an X session, you'll kill it
   out from under you!
3. fdisk /dev/hdX
   for whatever X is for the hard disk you're partitioning
   fdisk is dangerous; explaining it is beyond the scope of this post
4. mke3fs /dev/hdXN
   or whatever kind of filesystem you're creating)
5. mkdir /home/music
   this is the "mount point"
6. mount -t ext2 /dev/hdXN /home/music

At this point, as far as any user utility or application is concerned,
/home/music is just part of the global filesystem.  You can chown it,
chmod it, etc as usual.

You will then want to edit /etc/fstab so that the partition will be
automatically mounted on a normal boot.

 > If I decide to create a partition for music files that any user can
 > access, what directory name should I use?

If you are going to create a user account named "music" to own the
music files, then /home/music may be good.  Other possibilities would
include /usr/local/share/music or /var/db/music.

The /home/music option may be best if users are going to be managing
the files with generic tools like nautilus or cp.  The latter, less
user-friendly, options are more appropriate if you want to have the
users use some particular application to access the music, and that
application can be configured to look there without the user knowing
or caring what the actual filesystem structure it.

HTH


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links