Linux Partitioning Advice, Anyone?

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Edi
Dragonlord
Dragonlord
Posts: 12461
Joined: 2002-07-11 12:27am
Location: Helsinki, Finland

Linux Partitioning Advice, Anyone?

Post by Edi »

Any of the resident Linux experts want to give me a hand in figuring out the smartest way to partition my Linux setup? Mandrake 10.0 Powerpack edition, 10 GB of hard drive space available on my 40 GB hard drive, the rest of it is used by Windows XP. I suppose that of the 10 GB, around 500 MB would go to swap, between 500 and 800 to root, but I'm not sure about the rest. /usr is going to neeed to be large, probably several GB, maybe 5? /home needs a gig or two, but how much space should /var and /tmp get, assuming they need separate partitions in the first place? And should I have /opt as a separate partition?

I'm actually posting from the Linux setup I just installed, but even though it does work, it's in some respects fucked up in severn different ways and then some because I'm just learning to use it, and I thought I'd just wipe the current version and reinstall from scratch tomorrow. There is absolutely no data that I need to save on the Linux side, so backups are not a problem.

The bootloader also confused me a little bit, because it gave me something like five different options, and I'm not quite sure what all of them do. For example, I don't know what the difference between the "linux" and "linux - smp" entries are unless the smp version uses both of my processors (I thought that any installation would automatically use both of them).

I'll be able to figure things out on my own, but any advice would be appreciated, as I'm not a great believer in doing things the hard way if I canget advice. Thanks to any helpful soul in advance! :)

Edi
Warwolf Urban Combat Specialist

Why is it so goddamned hard to get little assholes like you to admit it when you fuck up? Is it pride? What gives you the right to have any pride?
–Darth Wong to vivftp

GOP message? Why don't they just come out of the closet: FASCISTS R' US –Patrick Degan

The GOP has a problem with anyone coming out of the closet. –18-till-I-die
User avatar
Spacebeard
Padawan Learner
Posts: 473
Joined: 2005-03-21 10:52pm
Location: MD, USA

Re: Linux Partitioning Advice, Anyone?

Post by Spacebeard »

Edi wrote:Any of the resident Linux experts want to give me a hand in figuring out the smartest way to partition my Linux setup? Mandrake 10.0 Powerpack edition, 10 GB of hard drive space available on my 40 GB hard drive, the rest of it is used by Windows XP. I suppose that of the 10 GB, around 500 MB would go to swap, between 500 and 800 to root, but I'm not sure about the rest. /usr is going to neeed to be large, probably several GB, maybe 5? /home needs a gig or two, but how much space should /var and /tmp get, assuming they need separate partitions in the first place? And should I have /opt as a separate partition?
This all depends on what the box is going to be doing. /tmp is used mostly for scratch storage during compilation and so forth, so you want it fairly large if you're going to be doing much of that. /var is also used for scratch storage, and in addition.

Swap is basically up to you, it depends on how much physical memory you've got and how much you think you'll need total. There used to be a rule of thumb about always making swap double your physical memory, but that hasn't been valid for a long time. I tend to try to make physical memory plus swap equal to a total of at least two gigabytes, myself, but again it depends on your needs.

Obviously, /usr and /opt will store the bulk of your software so keep them large. I don't know exactly what your Linux distro will keep where, so I would not make seperate partitions for /usr and /opt on Linux, myself. What I would do is make a seperate /usr/local partition, since Linux likes to keep user-installed software in there, in my experience. This way you can keep your stuff seperate from the system packages in case you need to upgrade, and also for security and integrity reasons (keeping /usr read-only most of the time).

Your root filesystem shouldn't be all that large, mine are usually in the area of 128 MB. The bulk of the system is under /usr.

Here's the filesystem layout from my workstation, which runs Solaris 10 and has a single 60 GB hard drive:

Code: Select all

Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0      180M   101M    61M    63%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   2.1G   408K   2.1G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
/dev/dsk/c0t0d0s3      3.9G   2.5G   1.4G    64%    /usr
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c0t0d0s5      994M   154M   780M    17%    /var
swap                   2.1G    56K   2.1G     1%    /var/run
swap                   2.1G   552K   2.1G     1%    /tmp
/dev/dsk/c0t0d0s4       15G   605M    14G     5%    /opt
/dev/dsk/c0t0d0s7       33G   7.2G    25G    22%    /export
/dev/dsk/c0t0d0s6      240M    11M   205M     5%    /var/log
The first bunch are all pseudo filesystems, like /proc on Linux, and can be ignored. /export would be the equivalent of /home on Linux; notice that I put over half of my space there, since obviously all my work and anything I download goes in there. /opt is a seperate filesystem because it's traditional to keep optional third-party software in there on Solaris; on Linux it would be /usr/local.
The bootloader also confused me a little bit, because it gave me something like five different options, and I'm not quite sure what all of them do. For example, I don't know what the difference between the "linux" and "linux - smp" entries are unless the smp version uses both of my processors (I thought that any installation would automatically use both of them).
I don't use Linux much, but I know multiprocessing is optional in the kernel and should only be used if you actually have a multi-processor machine. The SMP entry, then, is a kernel with SMP enabled. Use it if you're got a dual processor system like you implied.

EDIT:

Addendum:

When you're still first learning the ropes, and just want a usable system, you may want to stick to three filesystems: a root filesystem of around 256-512 MB (however much it needs), a swap partition of however much you want, and a /usr filesystem consuming the rest of the disk. The reason for a seperate root is that the bootloader and kernel often must be in the beginning few gigabytes of the disk.

There are many security and stability reasons to keep many different filesystems, but before you have a good grasp of how much space you need, you'll end up creating a lot of headaches for yourself.
"This war, all around us, is being fought over the very meanings of words." - Chad, Deus Ex
User avatar
Stark
Emperor's Hand
Posts: 36169
Joined: 2002-07-03 09:56pm
Location: Brisbane, Australia

Post by Stark »

I've got a linux part question!

I've got a 120 and a 160 in my linux box, used exclusively for storage. Having them in two bits is a right pain in the ass. Without RAIDing, can I span a volume over two disks? I was thinking bout buying a 300 and RAIDing it, but a span would do for now.
User avatar
Spacebeard
Padawan Learner
Posts: 473
Joined: 2005-03-21 10:52pm
Location: MD, USA

Post by Spacebeard »

Stark wrote:I've got a linux part question!

I've got a 120 and a 160 in my linux box, used exclusively for storage. Having them in two bits is a right pain in the ass. Without RAIDing, can I span a volume over two disks? I was thinking bout buying a 300 and RAIDing it, but a span would do for now.
A simple software RAID setup of the sort you're describing is fairly easily accomplished in most UNIX systems I've used. In general, it involves creating a virtual disk device which is a concatenation of your two physical disks, then creating your filesystem on the virtual device. Every vendor tends to have a different LVM system, though, and I've only done this on OpenBSD, FreeBSD, Solaris, and HP-UX, so I have no idea what's available on Linux.

Googling turns up a "Linux Software RAID HOW-TO" here, but I don't know if that's current for whatever version you're using.
"This war, all around us, is being fought over the very meanings of words." - Chad, Deus Ex
User avatar
Jew
Jedi Knight
Posts: 666
Joined: 2005-01-17 10:29pm

Re: Linux Partitioning Advice, Anyone?

Post by Jew »

Edi wrote:Any of the resident Linux experts want to give me a hand in figuring out the smartest way to partition my Linux setup?
If Mandrake can automatically partition it for you, choose whatever it gives you. If it won't, I would set aside a swap partition equal to the amount of RAM you have (if you have less than 512MB of memory, make the swap partition bigger than your RAM) and split the rest of the disk space: 1/3 to for a root partition (/) and 2/3 for a home partition (/home). I've been using Mandrake for three years but I'm not an expert on partitioning so I could be entirely wrong.

Example:
1 GB - swap
3 GB - root (/)
6 GB - home (/home)
She did not answer, which is the damnedest way of winning an argument I know of.
User avatar
Pu-239
Sith Marauder
Posts: 4727
Joined: 2002-10-21 08:44am
Location: Fake Virginia

Post by Pu-239 »

I just use a single partition for everything, since the usage of disk space in /var, /usr/, /home, etc will fluctuate on a desktop system (I install/remove lots of software on a regular basis). Although you can start with small partitions and use LVM to grow them later (not sure if it's supported by Mandrake).

My fstab:

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>		<type>  	<options>       <dump>  <pass>
proc		/proc			proc		defaults	0	0
/dev/hde1	/			reiserfs	notail		0	1
/dev/hde2	none			swap    	sw		0	0
#/dev/hde3	/mnt/hde3		reiserfs	noauto,users	0	0
/dev/scd0	/media/cdrom0		iso9660		ro,user,noauto  0	0
/dev/scd1	/media/cdrom1		iso9660		ro,user,noauto  0	0
/dev/scd2	/media/cdrom2		iso9660		ro,user,noauto  0	0
/dev/scd3	/media/cdrom3		iso9660		ro,user,noauto  0	0
/dev/sda1	/media/usb		vfat		rw,user,noauto  0	0
/dev/fd0	/media/floppy		auto		rw,user,noauto  0	0


#//server/john	/home/john/server 	smbfs		rw,uid=john,gid=john,dmask=770,fmask=660,credentials=/home/john/.credentials	0	0
#server:/home	/net		 	nfs		_netdev,rw,hard,sync,intr,rsize=8192,wsize=16384				0	0
server:/home	/net		 	nfs		_netdev,rw,hard,async,intr	0	0
server:/var/www	/var/www	 	nfs		_netdev,rw,hard,async,intr	0	0
Yes, I really have 4 CDROM drives.

ah.....the path to happiness is revision of dreams and not fulfillment... -SWPIGWANG
Sufficient Googling is indistinguishable from knowledge -somebody
Anything worth the cost of a missile, which can be located on the battlefield, will be shot at with missiles. If the US military is involved, then things, which are not worth the cost if a missile will also be shot at with missiles. -Sea Skimmer


George Bush makes freedom sound like a giant robot that breaks down a lot. -Darth Raptor
User avatar
Edi
Dragonlord
Dragonlord
Posts: 12461
Joined: 2002-07-11 12:27am
Location: Helsinki, Finland

Re: Linux Partitioning Advice, Anyone?

Post by Edi »

Spacebeard wrote:This all depends on what the box is going to be doing. /tmp is used mostly for scratch storage during compilation and so forth, so you want it fairly large if you're going to be doing much of that. /var is also used for scratch storage, and in addition.
Not very much building and compiling at all, so that is not a concern. I'm basically setting the Linux system up so I can learn to use it comfortably. Nothing fancy, main tasks will be writing stuff, playing Dominions 2 (should run much faster under a double processor Linux system than on WinXP), learning how the Linux system in general works and lastly (and not least), my gf is going to like quite a few of the games that come free with the package.
Spacebeard wrote:Swap is basically up to you, it depends on how much physical memory you've got and how much you think you'll need total. There used to be a rule of thumb about always making swap double your physical memory, but that hasn't been valid for a long time. I tend to try to make physical memory plus swap equal to a total of at least two gigabytes, myself, but again it depends on your needs.
I've got an old system, five years or so, with only the hard drive and SDRAM upgraded (256 MB), so about 520 - 750 swap is probably about right for my setup.
Spacebeard wrote:Obviously, /usr and /opt will store the bulk of your software so keep them large. I don't know exactly what your Linux distro will keep where, so I would not make seperate partitions for /usr and /opt on Linux, myself. What I would do is make a seperate /usr/local partition, since Linux likes to keep user-installed software in there, in my experience. This way you can keep your stuff seperate from the system packages in case you need to upgrade, and also for security and integrity reasons (keeping /usr read-only most of the time).
Thank you, this is what I was looking for. :D

I noticed about /usr needing a lot of space, the auto-suggestion that the Mandrake partitioning gave me for it was WAY too low.
Spacebeard wrote:Your root filesystem shouldn't be all that large, mine are usually in the area of 128 MB. The bulk of the system is under /usr.
Thanks. I think I'll be needing somewhat more than that, as that is what my manuals are telling me, but I guess 500 MB should be enough.

Here's the filesystem layout from my workstation, which runs Solaris 10 and has a single 60 GB hard drive:
Spacebeard wrote:
Edi wrote: The bootloader also confused me a little bit, because it gave me something like five different options, and I'm not quite sure what all of them do. For example, I don't know what the difference between the "linux" and "linux - smp" entries are unless the smp version uses both of my processors (I thought that any installation would automatically use both of them).
I don't use Linux much, but I know multiprocessing is optional in the kernel and should only be used if you actually have a multi-processor machine. The SMP entry, then, is a kernel with SMP enabled. Use it if you're got a dual processor system like you implied.
Ah, didn't know that. Yes, I do have a dual setup, two 500 MHz Celeron processors. First time I booted up Linux (and posted the OP) I did it in single processor mode. I rebooted to the smp version and things sped up to literally twice as fast. Learn something new every day. :)

Spacebeard wrote:When you're still first learning the ropes, and just want a usable system, you may want to stick to three filesystems: a root filesystem of around 256-512 MB (however much it needs), a swap partition of however much you want, and a /usr filesystem consuming the rest of the disk. The reason for a seperate root is that the bootloader and kernel often must be in the beginning few gigabytes of the disk.
Thanks. I knew about the root partition and why it is supposed to be that way, but didn't have a clear idea on how much I should assign to the other partitions (excluding swap) given the limited space I had. I'll probably make a /home partition of around 1 GB and the rest will be /usr and /usr/local.. There's not going to be that much personal data on the Linux side until I get a new Windows machine, at which point this box becomes Linux only.

Spacebeard wrote:There are many security and stability reasons to keep many different filesystems, but before you have a good grasp of how much space you need, you'll end up creating a lot of headaches for yourself.
Believe me, I noticed! Well, learn the hard way, learn it well. Not something I'll forget in a hurry. Your advice has been invaluable, though.

Jew wrote:If Mandrake can automatically partition it for you, choose whatever it gives you. If it won't, I would set aside a swap partition equal to the amount of RAM you have (if you have less than 512MB of memory, make the swap partition bigger than your RAM) and split the rest of the disk space: 1/3 to for a root partition (/) and 2/3 for a home partition (/home). I've been using Mandrake for three years but I'm not an expert on partitioning so I could be entirely wrong.

Example:
1 GB - swap
3 GB - root (/)
6 GB - home (/home)
The problem with the Mandrake suggestions for the different partitions is that with 10GB space, it suggests too little for some partitions and entirely too much for others. Swap was about the only thing it got right, and root was within tolerance limits, but /usr, /home and /var were all pretty fucked up. It'd have worked beautifully if I'd had the whole hard disk instead of just 25%.

Edi
Warwolf Urban Combat Specialist

Why is it so goddamned hard to get little assholes like you to admit it when you fuck up? Is it pride? What gives you the right to have any pride?
–Darth Wong to vivftp

GOP message? Why don't they just come out of the closet: FASCISTS R' US –Patrick Degan

The GOP has a problem with anyone coming out of the closet. –18-till-I-die
User avatar
Terr Fangbite
Padawan Learner
Posts: 363
Joined: 2004-07-08 12:21am

Post by Terr Fangbite »

Put 500mb-1gb for swap and everything else for root. Its what I do and thus far nothing has gone wrong.
Beware Windows. Linux Comes.
http://ammtb.keenspace.com
User avatar
Edi
Dragonlord
Dragonlord
Posts: 12461
Joined: 2002-07-11 12:27am
Location: Helsinki, Finland

Post by Edi »

I did the install with a lot of stuff in various partitions, and now everything works fine. The first time when I did it wrong I had too little space in /usr and too much everywhere else.

Edi
Warwolf Urban Combat Specialist

Why is it so goddamned hard to get little assholes like you to admit it when you fuck up? Is it pride? What gives you the right to have any pride?
–Darth Wong to vivftp

GOP message? Why don't they just come out of the closet: FASCISTS R' US –Patrick Degan

The GOP has a problem with anyone coming out of the closet. –18-till-I-die
Post Reply