• Post Reply Bookmark Topic Watch Topic
  • New Topic

Create directory under root (/)?  RSS feed

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it proper to create a new directory under root directory (/) and store all my juck stuff such as jdk, tomcat etc in it? Some how I don’t want to use /home/user.
In windows system we can freely create directories under C:.
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bruce - My $.02 - it depends on how you have designed the physical layout of your disk(s) and the mount points you assign. All usually done during install.
If you have one massive partition where / is mounted, then sure. But note that in this case, there is little diference between installing things under /, /home, /opt, .... whatever.
OTOH, if you have multiple partitions mapped to different mount points, e.g. /, /boot, /home, /opt, /usr, etc. each mounted on a different disk/partition - then it is somewhat of a 'disk space' decision - i.e. which of your partitions is less/more full than others.
I like to put miscellaneous stuff under /opt, but that is sure not a requirement. There are lots of other options, including new directories under / or even /misc.
There are some directories which *must* be mounted under /. /etc for sure, and maybe /lib (not sure about that).
If you show me the output of:
df -m
I might be able to give you some concrete advice for your situation.
Regards, Guy
 
Tim Holloway
Saloon Keeper
Posts: 18800
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's considered good practice to avoid excessive use of "/" as a home for things. For one thing, you directory structure should qualify things, and obviously if something has no parent, there's nothing to describe it.
For specifics, the "standard" places to put the jdk are in /usr/java/ and for tomcat /var/tomcatX (3 or 4). Commercial packages are encourages to use /opt, other apps often end up in /usr/local (my JDK did until I started using Sun RPMs).
There's a standard of sorts for this stuff that Linux vendors are moving towards. You might want to track it down.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Guy and Tim:
1.The reason I want to create a directory under “/” and store all my stuff (jdk, tomcat etc) under it is that I hope to back up everything in 1 tar file. In case of complete system fail, I can simply restore everything using this tar file. I do not know if this is a good plan. I do not know if jdk will work without going through the jdk installation process.
2.Partitions and mount points concepts are still new to me. I installed Mandrake by following default set ups. I just bought Vicki Stanfield’s book “Linux System Administration”. It seems to be a good book and I am trying to read it.
3.df –m output is:
Filesystem1M-blocksUsedAvailableuse%Mounted on
/dev/hda1 779 531 20872/
/dev/hda6 587 109 44820/home
[ March 06, 2002: Message edited by: Bruce Jin ]
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bruce - think of partitions/mount points as .... well in Win terms, you would have a C: drive, a D: drive , etc.
In your situation, you have 2 HD partitions, one mounted at / the other at /home.
You are installing 'stuff' under /. It is currently aboout 68% full (of 779MB).
Your /home parition is 18% full (of 587MB).
Where are you going to put 'stuff' when the / mount point is, say 95% full? (Well, one can always boot a PM rescue floppy and jerk the sizes around - I've done that!)

I agree that /usr or /usr/local or /opt are more usual places than /, ..... well, the bottom line is, you are the SA of your system. If it works for you then it is OK!
Maintaining a Linux system for you and you alone is very different than maintaining one for 20 or 30 users!!
Happy Linuxing, Guy
P.S. - I'd also add that your backup plan is reasonable at your stage of the game. You could dump the tar to another machine or to CD for insurance.
[ March 06, 2002: Message edited by: Guy Allard ]
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Guy for the explanation!
My Linux is a servlet server. I will connect it to the Web soon. I am the only one who is using it.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't forget that even with only two "partitions", you can still split different directories across different parts of the disk. you should check up on "symbolic links". For example One of my systems has most of the disk allocated to /home, but I have /opt as a symbolic link to /home/opt so it doesn't take up space in /.
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank is definitely right about symlinks. They are nice magic. Much more powerful than Windows shortcuts.
Just be a little careful until you are sure you understand them.
G.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!