Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user?

E.g.

/home
  |-/james (my home folder)
  |-/shared (folder I want to share)
share|improve this question
    
Keep in mind that it is probably the default place for your homedirs, so when you would want to create a new account called 'shared', it's default homedir-location would be taken allready. This is not a problem per se, but true nonetheless. –  Nanne May 27 at 10:22

4 Answers 4

up vote 13 down vote accepted

I assume you're using a Linux system, but it shouldn't make any difference anyway. You can have anything you like in /home, there is no restriction. It is simply the standard place where user home directories are kept but many systems have them in different locations. OSX, for example, uses /Users instead.

In any case, even within the Linux world, /home is optional. As explained in the filesystem hierarchy standard there is basically no restriction and not even a requirement for /home to exist:

3.8. /home : User home directories (optional)

3.8.1. Purpose

/home is a fairly standard concept, but it is clearly a site-specific filesystem. The setup will differ from host to host. Therefore, no program should rely on this location.

3.8.2. Requirements

User specific configuration files for applications are stored in the user's home directory in a file that starts with the '.' character (a "dot file"). If an application needs to create more than one dot file then they should be placed in a subdirectory with a name starting with a '.' character, (a "dot directory"). In this case the configuration files should not start with the '.' character.

3.8.3. References

A number of efforts have been made to standardize the layout of home directories, including the XDG Base Directories specification and the GLib conventions on user directory contents. To accommodate software which makes use of these conventions, distributions may create directory hierarchies underneath home directories which conform to them.

In summary, /home is just a convention and no system that follows the FHS requires it or has any expectations of it. There is no problem including directories in /home that are not user $HOME dirs. For example, on many systems, /home is a separate partition and, therefore, running fsck on it will create the /home/lost+found directory which is not connected to any user.

share|improve this answer
    
Thanks for the info - yes it is Linux. I ask this because I wanted to mount my second HDD as /home, and it contains folders other than my W7 user folder. –  James N May 26 at 17:21
3  
@JamesN: If the other HD is formatted for use by windows, the problem is not going to be what it contains, but the fact that it's unsuitable for many uses that applications might expect to work. For instance, lacking symlink and hardlink support, case-sensitive filenames, fifos, unix sockets, ... –  R.. May 26 at 19:35
1  
+1 for mentioning lost+found –  Dubu May 27 at 5:38
    
@R It's formatted in ntfs, and the symlinks set up seem to be functioning - have I missed something? –  James N May 27 at 11:36

If you're going to have shared non-user content, use /srv/.

This separates user settings from files. It makes backing up and recovery less confusing.

share|improve this answer

On my box I redirected /usr/local to /home/local via a symlink. / isn't backed up, /home is.

There's no specific reason why mkdir wouldn't simply work in /home as root so the question is an obvious yes. The only thing to think about is why?

share|improve this answer

For years on Windows I used a directory called "data" to put all my docs/music/photos and everything else that I created into. I am so glad I did because as I moved from one machine to the next I simply moved that single directory and reinstalled whatever I needed. A few years ago I moved to Linux and lamented the loss of this single data directory, though my user directory in home was close. Then because I program for Windows quite a lot and really wanted to have that directory structure again I mapped a separate partition that is NTFS to /home/data and have been glad ever since. I have moved house to a new PC several times and have that same great experience of it all just being right there and have very few repercussions for it. The main thing I lack is that there is no "executable" bit in files presented in Linux so programs/scripts that I save when booted to windows sometimes have to be moved to another location when I want to run them in Linux because NTFS lacks that bit. Which has been fine for me since I never wanted "programs" there anyway.

share|improve this answer
    
There's no reason /home/data would have to be NTFS, you can just make it. And it could even be in your home directory, e.g. /home/dan/data. –  Kevin May 28 at 1:42
    
it is NTFS so it can be shared easily in the Windows OS run time. –  Danny May 28 at 2:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.