LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-28-2005, 05:39 AM   #1
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Can I mount, say, /usr/src , /apps , and /home on one hda1???


Can I mount, say, /usr/src , /apps , and /home on one hda1???
I just want to reduce my win partitions, but I know I will reinstall Linux many times. So I want to make 1 partition for system use (3-4 Gb) so that I'm able to reinstall (erase) it anytime I want with no necessary data loss. And another partition for data storing (>=15 Gb) so that I don't need to erase it when reinstalling system.
 
Old 01-28-2005, 05:45 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm not sure what you're asking - you mount hda1 to a mountpoint - such as / - not vice versa. So if the question is 'Can I have everything except my data (and swap) in one partition on one mount point, then sure. And 'Can I wipe that partition without screwing up my data partition?', then sure.
 
Old 01-28-2005, 08:07 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Look at my article about partitionning:
http://yves.gablin.club.fr/linux/ind...fig/partitions

Yves
 
Old 01-28-2005, 10:27 AM   #4
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
I know my q is not clear enough
I want to have /apps, /usr/src, /home on another partition than the system. i.e. I want '/' dir and all dirs it contains (except the above ones) to be one partition, and /apps, /usr/src, /home to be on another partition. Of course, I can mount /home on another partition, and make ~/apps, ~/src dirs there. But is it possible to place some system's dirs on main partition and some on another partition?
 
Old 01-28-2005, 10:47 AM   #5
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
With most distros, a re-install will force a reformating of the /usr directory/partition. It makes more sense to keep /, /usr, et al. on one partition, and /home on another. That way you only need to re-install the kernel and apps and not user settings or data. To preserve the other partitions (or directories), I would simply back them up to a spare HD or onto a DVD-RW disk.

In my experience, it always makes sense to have /home on its own partition.
 
Old 01-28-2005, 11:02 AM   #6
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
So u mean that even if it is possible, it is useless. But I like to "work" under root account. I guess, /root is to be erased too whenever I reinstall the system? Am I right? Or I can place /root on one partition and the rest on another, and don't worry about my datas in /root when reinstalling?
 
Old 01-28-2005, 11:37 AM   #7
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
WHY on EARTH would you EVER,... "WORK" as root!?!?!?!?

Do you realize how dangerous that is??? You can seriously nerf your system without trying...

You really should only su to root from a user account, or switch users from within the GUI in extreme situations, unless you can't help it.

But you can create seperate mount points for everything... the default, if you don't make it seperate, is for it to mount under /.

For instance:

hda1 = / (which could include /usr, /opt, /etc,... etc)
hda2 = /root
hda3 = swap
hda4 = /home

That's just an example. I'd suggest that /root, if you do it, should be very small,... like a few hundred megs. I'd suggest that its better to leave it on / , and simply back it up regularly to another device... like a USB key drive or another HD...
 
Old 01-28-2005, 06:45 PM   #8
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally posted by kornerr
I know my q is not clear enough
I want to have /apps, /usr/src, /home on another partition than the system. i.e. I want '/' dir and all dirs it contains (except the above ones) to be one partition, and /apps, /usr/src, /home to be on another partition. Of course, I can mount /home on another partition, and make ~/apps, ~/src dirs there. But is it possible to place some system's dirs on main partition and some on another partition?
Well, there are two places an installer should never touch - /home and /usr/local. /apps isn't even a standard directory - there's also /opt on most systems if you want. And /usr/local/src is standard and I suppose there could be an /opt/src. And any distro worth a flip will listen to you if you don't do an automatic install. So let's say you had a bunch of stuff in /opt and the distro would normally format that partition. It's easy enough to just not mention that partition during the install, let it create another /opt in the root partition, and then delete that directory after the install, modify /etc/fstab, and mount your real /opt.

For instance.

And, yeah, running as root is a bad idea and /root is designed to be part of the root partition. I believe you *can* mount anything anywhere but it's asking for trouble. Then again, so's running as root. Then again again, a home user cares a hell of a lot less about an easily reinstallable system than about his personal data.

Anyway - me, I usually have /, /tmp, /var, /home, and sometimes /usr/local and /boot as separate partitions. (I like the stuff that can fluctuate and my personal stuff, and the distro to each be separate.)
 
Old 01-29-2005, 10:50 AM   #9
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
U didn't induced me, guys, that I should use an avarage account I tried, I tried to 'reboot'. I cannot reboot as an avarage user. And su everytime... it really botheres me. But I've already repartitioned my HDD. I gave 17 GB to 2 windows (2k - for Delphi and AntiVirus, xp - for few games), and 20 GB for /, /home (17 GB) and a small swap. Yes, I decided to create apps, src, docs in /home and don't touch it when reinstalling. So thanks for telling me "crazy"
 
Old 01-31-2005, 03:19 AM   #10
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
I don't want to appear to insist, but my article is exactly what you want, with adaptations for your particular situation and folders! Or else I really don't understand your question.
To make it short, here's what you could do:
Code:
hda1: swap
hda2: /
hda3: /local

mv /home /local/
ln -s /local/home /home
mv /root /local/home/
ln -s /local/home/root /root
mkdir /local/.sys
mv /opt /local/.sys/
ln -s /local/.sys/opt /opt
...
Do I need to go on?
Some links can be avoided. For example, /home is useless, as long as your user configuration tool knows that users are inside /local/home. Same goes in theory for /opt, but I would keep this link because some strange RPM may want to install files there.
As for /root... I think /root should be kept inside / because in case of a problem, it is important to be able to boot with only /, and still have root's home dir available.

Yves.
 
Old 01-31-2005, 03:34 AM   #11
tormented_one
Member
 
Registered: Oct 2004
Location: Small Town USA
Distribution: slamd64 2.6.12 Slackware 2.4.32 Windows XP x64 pro
Posts: 383

Rep: Reputation: 30
I believe /opt is used by KDE, atleast on my slackboxes it is. So I'd leave it on / as well.
 
Old 01-31-2005, 04:20 AM   #12
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Quote:
Originally posted by kornerr
U didn't induced me, guys, that I should use an avarage account I tried, I tried to 'reboot'. I cannot reboot as an avarage user. And su everytime... it really botheres me. But I've already repartitioned my HDD. I gave 17 GB to 2 windows (2k - for Delphi and AntiVirus, xp - for few games), and 20 GB for /, /home (17 GB) and a small swap. Yes, I decided to create apps, src, docs in /home and don't touch it when reinstalling. So thanks for telling me "crazy"
To persist on the root issue:

"And su everytime, it really bothers me"

What do you have to su every time to do? Generally, this ought to be a good step that is necessary to take before performing a task requiring it. It makes you take that 2 second (and as it becomes easier, that 1/2 second) pause to think about it. For such things as shutting down the system, sudo exists. To make things easier, you can even create alias commands to make sudo seem non-existent (for things like shutting down the system).

One of the blankets of security linux provides is created by using your system correctly.

Cool
 
Old 01-31-2005, 11:00 AM   #13
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
theYinYeti, as I understood you suggest to link everything I need. That's one of the ways. May be I follow this when I'll be partitioning my HDD next time Thanks to all.
 
Old 02-01-2005, 03:43 AM   #14
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Basically, yes. Though as I said, the /home link can be avoided (much better to avoid it, IMO) and I explain how on my web site.
 
  


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
/usr/src SeattleSux Linux - Newbie 3 12-23-2004 11:29 PM
/usr/src/??? iain.ross Linux - Software 5 08-24-2004 03:18 PM
mount / , /home , /home/usr on different partitions alekoos Slackware 14 05-03-2004 12:39 PM
/usr/src ??? gibbylinks Red Hat 1 10-24-2003 04:05 AM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 04:24 PM


All times are GMT -5. The time now is 08:05 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration