LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is this a good partition set-up? (https://www.linuxquestions.org/questions/linux-general-1/is-this-a-good-partition-set-up-726655/)

Smokey_Mtn Ron 05-17-2009 08:34 PM

Is this a good partition set-up?
 
I will soon be installing Linux Mint as my only OS on a new 500gb hard drive. Is this a good partition scheme to use? Any suggestions would sure help as this is the first time I have done this!

5gb primary for "/" ext3
4gb logical for "swap"
7gb logical for "/usr" ext3
2gb logical for "/tmp" ext3
1gb logical for "/var" ext3
rest of space for "/home" ext3

snowtigger 05-17-2009 08:50 PM

Looks pretty good, although you could add....

A little one at the beginning for /boot, say 128mb

And another which i tend to add is /opt, of say 4gb or more if you like (things like openoffice normally end up in /opt)


Once you installed run df -h and you see who much space you actually use in each one.

:)

FragInHell 05-18-2009 12:25 AM

I would make var a little bigger, in case you wish to keep your logs for a bit longer, or you generate a lot of logging. The best approach would be to use logical volumes then you can grow them as you need.

Smokey_Mtn Ron 05-18-2009 01:33 AM

Ok, thanks!! Is /boot and /opt both logical partitions? Where should /boot be at? Before or after /swap? Also I'll increase /var to 3gb. Should that be enough?

saikee 05-18-2009 02:22 AM

I only do one partition per Linux. First one needs a swap. All others are just subdirectories of a single mounting point of /.

Then again I am the single user and see no real benefit of setting up a home desktop like a server for multi users. The sizes of various subdirectories can then expand and contract freely without any worry. Haven't met a Linux installer that doesn't play ball with a single partition yet.

snowtigger 05-18-2009 01:48 PM

Put /boot at the very beginning of the drive, before anything else. It is not really necessary these days but i consider it good practice. Once upon a time systems could only see the first 1024mb of a drive. But i think just about all modern systems have over come that limitation.

:)

SlowCoder 05-18-2009 02:07 PM

Quote:

Originally Posted by saikee (Post 3544280)
I only do one partition per Linux. First one needs a swap. All others are just subdirectories of a single mounting point of /.

Then again I am the single user and see no real benefit of setting up a home desktop like a server for multi users. The sizes of various subdirectories can then expand and contract freely without any worry. Haven't met a Linux installer that doesn't play ball with a single partition yet.

This is the simplest solution, obviously. But there are benefits to creating multiple partitions, especially if disk space is an issue. If, for instance, your logs get too big in a single partition, they could begin to fill your space, and affect all parts of your system. If /var is on its own partition, the logs will only be able to fill that partition.

On that same note, I only use swap, /, and /home partitions. That way, if I need to reinstall the OS, I can keep my /home data intact, and only reformat the / partition.

moxieman99 05-18-2009 02:32 PM

Quote:

Originally Posted by Smokey_Mtn Ron (Post 3544076)
I will soon be installing Linux Mint as my only OS on a new 500gb hard drive. Is this a good partition scheme to use? Any suggestions would sure help as this is the first time I have done this!

5gb primary for "/" ext3
4gb logical for "swap"
7gb logical for "/usr" ext3
2gb logical for "/tmp" ext3
1gb logical for "/var" ext3
rest of space for "/home" ext3

My preference is to have specialized partitions. That way if I have to rescue or back up, I know exactly where to go.

As others have said, it's nice to have /boot as the first primary partition. Fedora and similar distributions like 200mb for boot, so if you ever change out of linux mint, you might want to have a /boot partition around 200mb.

/ as the second primary partition. 5 gig will do, but you might want to jack that up to 15 gig if you ever change distros or install oodles of stuff into /.

Personally, I like /home as my third primary partition. That's just me.

Four gig of swap is huge. Will you be doing enough of a load to justify it? By the way, I like putting /tmp and /swap at the very end of my hard disk. That way I can tweak them without having to furtz around with other partitions, and there's rarely anything I need on /tmp.

/usr, /var, and /opt should be on most people's lists. As others have said, applications like OpenOffice default into /opt.

Personally, I like saving my data files and personal files somewhere other than /home. That way if I ever have to add another user there is space for them, and if I ever change my settings, I am less likely to destroy my data.

Don't be afraid to experiment, and good luck.

jschiwal 05-18-2009 02:48 PM

You aren't allowing much space for some of the partition such as /var, and /usr. Given that you have a 500GB drive, you can be more generous. Much depends on the usage. If you are going to burn CDs & DVDs then add 1 GB to /tmp for CDs or 5 GB for DVD's. Your users temp space will be symbolically linked to a directory in /tmp so normal user programs make use of /tmp. Servers will use space in /var or /srv. For a workstation, /usr will fill up quickly as you add software over time. My /usr directory uses 12 GB. However, I do have a habit of installing the *-doc version of packages when possible. Whenever you install packages from your distro's package manager, almost all of the files will be installed under /usr. Unless you are running a dedicated mysql or web server, the /usr partition will be the second largest.

Having /boot as the first partition on the disk would allow you to easily create an image backup -- just in case. It is small and easy to backup & restore using dd.

Smokey_Mtn Ron 05-18-2009 05:28 PM

Hey, you guys are really helping me!! Thanks!! How does this look?

/boot 500mb 1st primary
/ 15gb 2nd primary
/swap 4gb logical
/usr 20gb logical
/tmp 7gb logical
/var 7gb logical
/opt 7gb logical
/home rest of space logical

lumak 05-18-2009 09:47 PM

@ /opt partition

It takes a bit more set up, but to me /opt should really be /usr/opt. To avoid changing build scripts or mucking around with packages, you can put a bind mount in your /etc/fstab.

Code:

mkdir /usr/opt
vim /etc/fstab
  # Add in the following to /etc/fstab after /usr mount point
  /usr/opt  /opt  none  bind

I don't store enough in /opt to consider making it a partition but yet I don't want it on my root partition... BUT!!!!! if your Distro installs some packages to /opt wait till after the main install and this fix before installing the package. Or just move it afterward then set up the mount. At least with open office, I haven't seen issues with this setup. BTW I believe a package meant to install into /opt will overwrite a symbolic link called /opt and actually make it a directory. This is why I used a bind mount.


I believe you also use this trick for simplifying sharing files when hosting an ftp with your computer. Symbolic links generally arn't respected and hard links can't cross partitions. So you just bind mound a directory to another directory.

moxieman99 05-19-2009 06:57 AM

Quote:

Originally Posted by Smokey_Mtn Ron (Post 3545116)
Hey, you guys are really helping me!! Thanks!! How does this look?

/boot 500mb 1st primary
/ 15gb 2nd primary
/swap 4gb logical
/usr 20gb logical
/tmp 7gb logical
/var 7gb logical
/opt 7gb logical
/home rest of space logical

500mb for /boot is way too much in my opinion, and I would like to know how much RAM you have and why you think you need so much swap. Also, what about putting /tmp and swap at the end of the disc? (suggestion).

If you're happy with it, we're happy with it.

sycamorex 05-19-2009 07:06 AM

Quote:

Originally Posted by moxieman99 (Post 3545654)
500mb for /boot is way too much in my opinion, and I would like to know how much RAM you have and why you think you need so much swap. Also, what about putting /tmp and swap at the end of the disc? (suggestion).

If you're happy with it, we're happy with it.

Yeah, the swap partition seems slightly too big for me as well (I never exceed 2GB), however, with 500GB of drive space you can afford to be generous:)

Smokey_Mtn Ron 05-19-2009 06:14 PM

Ok, I think I'm starting to understand (I think). How does this look? This is only a home computer that I use to surf the web and do normal things like that. Also use it for storing some pictures and video's. Also storage for bank statments and other documents. Is there any thing I need to increase?

Primary /boot 200mb ext2
primary / 15gb ext3
logical /home 40gb ext3
logical /usr 20gb ext3
logical /var 7gb ext3
logical /opt 7gb ext3
logical /tmp 2gb ext3
logical /swap 2gb swap (I have 2gb of RAM)

FragInHell 05-19-2009 06:41 PM

The sizes look really good but I think you will end up with a lot of wasted space. Remember that it is very easy to grow a logical volume and file systems, but fairly hard to shrink it. So with that in mind I would start with slightly smaller logical volume sizes, then you can grow them as you need. That way your not wasting so much space. I very much doubt that you will ever use all the space you have allocated.

Primary /boot 200mb ext3
logical / 10gb ext3
logical /home 40gb ext3
logical /usr 5 gb ext3
logical /var 3 gb ext3
logical /opt 2 gb ext3
logical /tmp 2 gb ext3
logical /swap 2gb swap (I have 2gb of RAM)

This way you have plenty of space to grow into where you need it.
Being a home user, music, photos, etc etc most of the space is going to go into your /home
Even a standard installation, openoffice etc etc is not likly to use all this space.

/var is only going to fill up if you have a lot of logs, and package updates etc, so 3 GB should be enough, but of course if you find yourself running out of space you can grow it.
/tmp is always a good one to keep seperate, it stops processes running away and filling up / as causing system problems. 2GB is going to plenty.
If you going to be doing a lot of video editing etc then 2GB of swap is fine.
Also the best part of using logical volumes is flexability, if your example you are running an apache webserver and its taking alot of space, its not problem to drum up some more logical volumes for the websites and logs etc.
So if you have a 500G disk, I would create it with the /boot as the primary partition and then assign the rest of the disk to a logical volume. You use about 55Gb's of that to start with and that gives you over 450GB to grow as you need.
Thats more than enough :)

Smokey_Mtn Ron 05-19-2009 08:46 PM

Thanks a lot FragInHell!! This is the one I'll use. But all the ones that I've read about always has "/" as primary. Is making it logical not a problem

FragInHell 05-19-2009 10:18 PM

I guess like anything there are pro's and cons to this.
Generally /boot always needs to be a primary since this is where the first part if you like of the kernel gets loaded and there are no volume manager drivers yet at this stage.
Traditionally '/' was also a primary as this makes it easier for recover etc, but these days I dont think it matters any more. If you find yourself really in trouble then nearly ever rescue disk will be able to detect logical volumes.
It gets harder if you using special raid controllers etc etc but I don't think in your case you probably are. RAID controllers require additional kernel drivers and can make recovery alot harder.
Good luck, let us know how you get on.

Smokey_Mtn Ron 05-20-2009 04:53 PM

Thanks a lot to everyone!!!!! Hopefully my new hard drive will be here soon and I can get this done. I'll let you know how it turns out when I get it finished.

Quakeboy02 05-20-2009 06:06 PM

Quote:

Primary /boot 200mb ext2
primary / 15gb ext3
logical /home 40gb ext3
logical /usr 20gb ext3
logical /var 7gb ext3
logical /opt 7gb ext3
logical /tmp 2gb ext3
logical /swap 2gb swap (I have 2gb of RAM)
As at least one other poster has hinted at, this will work, up until it doesn't. It's really an awful lot of mess for a home system, and consumes a lot of empty hard drive space for no real return. It's your system, of course, but if it were me, I'd use 20GB for "/" (which implies /home, /usr, /var, /opt, and /tmp) and the rest of the drive for "/data". In my system, I actually use a complete 80GB drive for "/", and another larger drive for "/data". Almost all of my data is in "/data", so no matter how badly I bork "/home" or whatever, I've got almost all my data.

Good luck, and have fun, regardless of what you do.

lumak 05-20-2009 11:03 PM

Here is the output of my slackware 12.2 machine.

df -h
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/root            973M  264M  710M  28% /
/dev/sda1              95M  55M  40M  59% /boot
/dev/sda6            487M  74M  413M  16% /var
/dev/sda7            4.8G  345M  4.5G  8% /tmp
/dev/sda8              39G  12G  27G  30% /usr
/dev/sda9            4.8G  926M  3.9G  19% /home
/dev/sda10            648G  111G  538G  18% /library

I have been using this machine as storage and internet. Openoffice is installed to /opt which is bind mounted to /usr/opt. /opt generally doesn't get much attention. Here are the directory sizes for somethings that go there some times.

# contains only openoffice 3.0 on my machine.
du -hs /opt
379M /opt

# some other things
# this works on slackware
sed -n -e '/UNCOMPRESSED/p' /var/adm/packages/kde*
# Then you can add up the output sizes to find KDE in total is
# 436 MB
# Gnome would probably take up just as much.

du -hs /usr/lib/firefox-3.0.10/
25M /usr/lib/firefox-3.0.10/

du -hs /usr/lib/thunderbird-2.0.0.21/
31M /usr/lib/thunderbird-2.0.0.21/

du -hs /usr/lib/seamonkey-1.1.16/
40M /usr/lib/seamonkey-1.1.16/

So even in a worst case scenario, you are looking at 3 gigs for /opt with plenty of room to spare. Again, check with your distro, but I feel 7gigs on /opt is an extreme waste when it won't even be 50% used.


If you want to run an http or ftp server, just make sure you have things set up so that stored files are on your /home partition unless you don't plan on exceeding the size of /var which you have set at 7gigs. My /tmp is 5 gigs because of potential use and I build packages in /tmp and sometimes forget to delete them until reboot or it fills up.


All times are GMT -5. The time now is 02:54 PM.