Linux Partitions

Corey0808

Senior member
Sep 26, 2003
463
0
0
I'm going to be transferring to linux soon. I have about 40-50 gigs of space that I'm going to be using on this linux OS. How should I partition it? Thanks!


Also... I have a Raptor. Will I have any problems?
 

TGS

Golden Member
May 3, 2005
1,849
0
0
/boot 100 MB
swap 2GB


If you ever do heavy config changes later on:

/home 10-20GB
/ the rest

I would recommend /home as it's own partition that way if you change distros or blow away / for some odd reason (Accident ;) ) your user settings or files (I typically save out and install games, etc to /home. If it's not right, Meh) will be saved.



Forgot, assigning the partitions via block numbers or through a GUI. I believe that the first blocks are at the outer edge of the disk, and for performance reasons you want to assign: /boot, /, /home,swap. From the lowest blocks to the highest.

Though one of the Linux experts should be able to tell you disk I/O tips.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
These should all be different partitions:
/
/usr
/usr/local (if it is used)
/var
/tmp
/var/tmp (if you can)
/home
swap

That just having / and swap crap is ciky.
 

Corey0808

Senior member
Sep 26, 2003
463
0
0
If you were to assign percentages of space to those partitions what would they be? That is also part of my problem too :)
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
For a home PC or server?

For a server, you should really put at least
/boot
/
/var
on their own partitions

for a home pc, and with only 50 gigs of space I just go
/
swap (512meg)

Its really up to you, the reason you partition things out is to protect your data at the cost of wasted space. Basically, if you put / and /home on their own partitions, you could reinstall the OS and not loose any personal settings, or if /usr/local was on its own partition you could reintsall the whole OS and keep any programs you installed. On servers people put /var or /var/spool or /var/log on their own partition because this protects you from having a log file, or a user's email box (if you were running a mail server) from growing too large and filling up your entire drive.

Personally, at home I just do a 512meg swap (your swap will never need to be larger if you have one gig of ram), a 20meg /boot (which is mounted read only to protect me from any stupidity) and the rest of my drive in /. This is with a 300 gig drive.

If I was to setup a server, I would put at a minimum /boot, swap, /tmp, /var, /usr, /home and / all on their own partitions.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Corey0808
If you were to assign percentages of space to those partitions what would they be? That is also part of my problem too :)

I could list my partition sizes, but they may not be applicable to your setup. Small /, large /usr, large /usr/local, /var depends on your uses, //tmp depends on your uses, /home gets the most.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
I could agree with the need to seperate out the various mount points, if he had more than one disk. With a single disk partition just saves you if you really blow up your OS files. I mean REALLY blow them up. On a single disk, you really should just have the aforementioned /boot, /, /home, and swap. Sectioning more than that if you have a multi disk setup that requires certain programs to write to certain physical disks. Or you have IO contraints on certain applications. IE Databases and the such.

For the home user, I believe that anymore than "/boot(definately Read Only), /, /home, and swap" is more of less a waste of time. Especially on a single drive.

For a simple percentage determination on a single disk. Make 20-100MB for /boot, 1-2GB swap and split the rest 50-50 between / and /home. You figure most programs will log and be installed under / directories. While all the stuff you download (at least for me) should get plugged into /home. If you download a lot of stuff or archive, give /home a larger percentage.

Keep in mind you can always mount another disk under /home if you require the extra space.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: TGS
I could agree with the need to seperate out the various mount points, if he had more than one disk. With a single disk partition just saves you if you really blow up your OS files. I mean REALLY blow them up. On a single disk, you really should just have the aforementioned /boot, /, /home, and swap. Sectioning more than that if you have a multi disk setup that requires certain programs to write to certain physical disks. Or you have IO contraints on certain applications. IE Databases and the such.

For the home user, I believe that anymore than "/boot(definately Read Only), /, /home, and swap" is more of less a waste of time. Especially on a single drive.

For a simple percentage determination on a single disk. Make 20-100MB for /boot, 1-2GB swap and split the rest 50-50 between / and /home. You figure most programs will log and be installed under / directories. While all the stuff you download (at least for me) should get plugged into /home. If you download a lot of stuff or archive, give /home a larger percentage.

Keep in mind you can always mount another disk under /home if you require the extra space.

With the availbility of various mount options like nosuid, I think partitioning out the disk is necessary and this only root and swap idea is ridiculous.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I generally just use / /boot and /home. Usually I make / and/ home XFS and /boot ext2. If it's a workstation with more drives I usually have other mount points like /mnt/data.

With the availbility of various mount options like nosuid, I think partitioning out the disk is necessary and this only root and swap idea is ridiculous.

nosuid is pointless for anything but removable devices since you can't set the suid bit unless you're already root and if they've gotten root it's not too difficult to do 'mount -o remount,rw /usr' and do whatever.
 

Corey0808

Senior member
Sep 26, 2003
463
0
0
I really appreciate all the comments. I'm trying to take them all into consideration. I really don't know what each of the individual partitions do because I'm VERY new to linux.

This PC is mainly for home use. I will be browsing the web, writing documents, playing games like UT2k4, WoW, HL2, and CS:Source. There may be a possibility in my future of a web server but I'm not sure.

Please keep the comments coming! :) Thanks!
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Originally posted by: n0cmonkey


With the availbility of various mount options like nosuid, I think partitioning out the disk is necessary and this only root and swap idea is ridiculous.

Before it gets out of hand he's just asking for a starting point to basic partioning to get started on linux. Before we send him into manual mounts or editing fstab, vfstabs, or sd.conf on boxes he just needs a point to get started at.

I'm also not telling him just / and swap. I'm telling him /boot / /home and swap for basic partitioning. Just trying to make it easy for the guy to start with a nice easy layout. :)

 

TGS

Golden Member
May 3, 2005
1,849
0
0
Originally posted by: Corey0808
I really appreciate all the comments. I'm trying to take them all into consideration. I really don't know what each of the individual partitions do because I'm VERY new to linux.

This PC is mainly for home use. I will be browsing the web, writing documents, playing games like UT2k4, WoW, HL2, and CS:Source. There may be a possibility in my future of a web server but I'm not sure.

Please keep the comments coming! :) Thanks!


/boot is where the files you boot with should be located. Kernel, bootloader config files, etc... Make this Read Only as advised above. This will help you avoid Bad Things?

/home is where your home directory should be under. IE /home/User1. So you can download or save stuff to a common area. This typically is a seperate device, so you aren't tying up space for the OS to use.

/ Is the end all be all encapsulating directory. Everything that doesn't have it's own dsicrete partition will be found under here. Most notable of which /opt /usr /var /mnt /sbin /bin /etc /dev that I use more frequently than anything else.

swap is more or less like the swap file(virtual memory) for windows. Though in linux it requires it's own partition rather than riding on an already established partition as in Windows.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Here's a few links that will help.

http://www.linuxnovice.org/main_focus.php3?VIEW=VIEW&t_id=126

http://pw1.netcom.com/~kmself/Linux/FAQs/partition.html

http://www.pathname.com/fhs/

in a nut shell most of your programs are going to take up space in /usr, /usr/local, or /opt. Think of these directorys similar to C:\Program Files.

/home (Think c:\documents and settings\) is used for storing individual user files, settings and programs (also /root is the home folder for the root user, I usually mount /home/root to /root for easy backup purposes of /home).

/etc is used to store global system settings and start up scripts.

/boot contains your boot loader and kernel (very small about 20-30 megs).

/var contains logs, email, and some servers use it for storage. This can grow quite large if you are doing a lot of logging or running a server. Most of the time this is put on a separate physical drive rather then a partition to help speed up read/write speeds.

/sbin contains all the executable files (and simlinks to executable files) need to have a complete OS. After install this directory rarely grows as most user installed apps put the bins in /usr/bin, /usr/local/bin or /opt/bin.

/lib stores system librarys that executable files link too (think windows dll files).

/mnt (or in some systems /media) is a place to mount CDs, floppys, usb drives, etc.

/tmp used by programs as temp space (also /var/tmp)

Those are the majors, most of the others do not really concern you when looking at physical space requirements.


My suggestion still stands though. Until you know how you are going to use the system and what space needs your setup requires. Just go with a 512meg swap, and the rest in / and maybe split off /boot.

Once you know how your using your system, you will get a general feel on what you want to move to separate hard drives or partitions either due to security, backup, or system performance concerns.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
/sbin contains all the executable files (and simlinks to executable files) need to have a complete OS

Actually they're right off of root because /usr might be on a different device or on the network and /bin and /sbin contain the necessary parts to bring up the rest of the drives, network, etc. I believe the s in /sbin used to mean static and the binaries in there were statically compiled, but now a days they're dynamic just like all other binaries on your system.

/mnt (or in some systems /media) is a place to mount CDs, floppys, usb drives, etc.

Sadly /media is the new LFS standard directory for removable media mount points. /mnt is supposed to be a temporary mount point.

 

xcript

Diamond Member
Apr 3, 2003
8,258
1
81
Originally posted by: Nothinman
I generally just use / /boot and /home. Usually I make / and/ home XFS and /boot ext2. If it's a workstation with more drives I usually have other mount points like /mnt/data.
Ditto.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: TGS
Originally posted by: n0cmonkey


With the availbility of various mount options like nosuid, I think partitioning out the disk is necessary and this only root and swap idea is ridiculous.

Before it gets out of hand he's just asking for a starting point to basic partioning to get started on linux. Before we send him into manual mounts or editing fstab, vfstabs, or sd.conf on boxes he just needs a point to get started at.

I'm also not telling him just / and swap. I'm telling him /boot / /home and swap for basic partitioning. Just trying to make it easy for the guy to start with a nice easy layout. :)

I ignore /boot, it's another ridiculous linuxism.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I ignore /boot, it's another ridiculous linuxism.

It was required back when BIOSes and bootloaders couldn't read past the 1024 cylinder mark, now people just keep doing it because they're used to having it.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Nothinman
I ignore /boot, it's another ridiculous linuxism.

It was required back when BIOSes and bootloaders couldn't read past the 1024 cylinder mark, now people just keep doing it because they're used to having it.

It wasn't required back then. I had a Linux system without a /boot.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You either got lucky and never had part of the kernel be moved past the 1024th cylinder mark or you had a really small drive. Hell FreeBSD has /boot too, it's just not normally it's own partition AFAIK. Personally I'd rather have the kernel in /boot, I like to keep my / clean.

And you want to talk about ridiculous? wtf is that /usr/home crap in FreeBSD? Who wants their home directories off of /usr?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Nothinman
You either got lucky and never had part of the kernel be moved past the 1024th cylinder mark or you had a really small drive. Hell FreeBSD has /boot too, it's just not normally it's own partition AFAIK. Personally I'd rather have the kernel in /boot, I like to keep my / clean.

And you want to talk about ridiculous? wtf is that /usr/home crap in FreeBSD? Who wants their home directories off of /usr?

I don't know why FreeBSD development went downhill. I stopped using it a long time ago.

I never made my / partition big enough to go past the 1024 cylinder mark. Not lucky, just careful. :)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Not really, that limitation was fixed a long time ago. And, at least in this machine, my boot disks are SCSI anyway so that limitation never applied to this machine. I see absolutely no good reason to break off /usr.