Page 1 of 1

Linux partitioning

Posted: Fri Oct 28, 2005 2:50 pm
by Anonymous
I'm just curious to know how others have partitioned their drives in preparation for linux. I have heard Dann mention something about partitioning a certain way but don't recall how it was or the reasons for, although I have an idea. I have always gone with one for the linux swap and used the rest for everything else. Just looking for some feed back from others on how they have partitioned and the reasons for.

Posted: Fri Oct 28, 2005 3:30 pm
by dann
I always have a mininum of three partitions:

/
/home
swap

I like to keep user data seperate from everything else in case I ever wipe the system or something crazy like that. If it a server without quotas having /home seperate will reduce any problems should someone fill up the partition.

On a server system I may break /var off to it's own partition. Again, this can fill up pretty fast depending on the type of server you are running. I may also break /usr off on it's own. /usr will tend to house the most files with more frequent additions than the other directories off of /.

Posted: Fri Oct 28, 2005 4:42 pm
by Judland
I agree... the minimum you should have is a / (for all system and app files) and a /home for all of your personal files and desktop settings.

I've heard that some modern system don't even require a /swap partition.

Swap Partition

Posted: Fri Oct 28, 2005 6:19 pm
by Mortuis
Somehow I got it in my head that the best swap partition you could do would be on it's own disk, maybe because it could spin independantly of the OS disk, I don't know. But this would seem rather difficult to find a disk of the right size for that these days.

Anyway, I have two questions if anyone is bored enough to answer:

The Swap partition is supposed to be 2x or 3x your RAM?

What do you do if you upgrade the RAM later?

Posted: Sat Oct 29, 2005 2:29 am
by Wally Balljacker
The Debian installer has a nice option for desktop systems, where it will create a swap partition, a small partition for my system files, and a large partition for my home directory. :)

Posted: Sat Oct 29, 2005 11:29 am
by snarkout
The swap=ram thing is left over from days of expensive ram when swap was a cheap replacement (remember "virtual memory" -- that was swap). These days, I use a gig for swap, just in case something has a really bad memory leak, but that's probably a waste of disk space. Most people I know use 512 mb no matter how much RAM they're sticking into their machines. I tend to err on the side of lots o' ram :)

Edit:

Oh, and for important machines, I have:

/
/boot
/home
swap

This way, my home stuff is cool, even if my OS gets fUx0r3d, and I can do the following trick after upgrading kernels (or whatever):

cp -rp /boot /root/boot2
umount /boot
cp -rp /root/boot2/* /boot
mount /boot

Now you have a backup of boot that's fairly well protected, so even if your /boot partition eats hot death, you'll be able to boot. I use this trick on servers, and it's saved my ass a few times :) -- I used to do the same with /bin and /sbin, but got lazy.

Posted: Sat Oct 29, 2005 12:25 pm
by Judland
Hmm.. I like that idea. Will have to remember that.

Partitioning

Posted: Mon Oct 31, 2005 3:46 pm
by Jza
More than partitioning, I am more keen into talking about filesystems. For a while I have avoid installig ext2/3, instead I have used ReiserFS in root and XFS on home partitioning.

Now my partition set is
/
swap
/home

However for a while I have been thinking about chaning my mountpoints specially because I usually use web apps as desktop apps, since they save also my personal data I am thinking of making a 3rd partition on a /var/www/html

Anyone doing this?

Re: Swap Partition

Posted: Mon Oct 31, 2005 5:14 pm
by treehead
Mortuis wrote:Somehow I got it in my head that the best swap partition you could do would be on it's own disk, maybe because it could spin independantly of the OS disk, I don't know. But this would seem rather difficult to find a disk of the right size for that these days.
<snip>
;actually mortuis, according to the swap placement section of the linux partitioning howto, placing your swap space on a separate disk is better because linux can move the heads of each disk independently of each other, lowering the access time for paged data. if you're in a demanding situation, such as setting up a server or a graphics workstation, putting partitions on a seperate disk is a good idea for the same reason. in a server situation, partitioning can also keep certain processes or daemons from "stealing" too much disk space--as i once witnesses cyrus imap rack up a 4 GB log file.

;if you have gobs of RAM, you can get away without any swap at all. i wouldn't advise it. i ran a 2.4 GHz system with 1 GB of RAM and no swap, and during a particularly busy session, i watched it do a hard, hard crash. not good.

;personally, i like to keep the number of partitions on my systems below five, so i don't have to contend with extended partitions. following suite with dann, i like to keep /home on its own in case i want to clean install a system, and i don't want to have to mess with logical drives in a recovery situation.

Code: Select all

/dev/hda1     /boot
/dev/hda2      swap
/dev/hda3      /
/dev/hda4      /home
;i thought about putting /usr/local in there on its own, but i can't see arbitrarily trying to determine what size it should be. i use ext3, again because of recovery. as i understand it, there are more options for recovery of ext2 and ext3 because there are more tools. is this correct?

;treehead

Posted: Mon Oct 31, 2005 10:38 pm
by snarkout
Image

Comedy Gold!


I use ext3 as well. I used reiser with SuSE several years ago, and never had any problems with it. I used it later on with debian, and one day lost an entire partition in a puff of logic. The drive itself was fine, but the filesystem was hosed. That was enough for me. I've never had a single problem with ext3 other than it being dogass slow sometimes.

Posted: Tue Nov 01, 2005 4:53 am
by mrben
Minimum, as previously stated, would be:
/
/home
swap

/boot is also quite useful. Having /var on it's own partition can keep those raging log files under control. I personally have /usr on it's own partition, and a partition called /ogg for all my media files.

Posted: Tue Nov 01, 2005 9:29 am
by Mortuis
That's what I was thinking about making the swap partition it's own drive, it's why I currently place my OS on it's own drive. However, I also understood that there was some kind of RAM:Swap ratio one had to keep in mind to prevent their computer from paging excessively. Have a gig of memory and a ten gig hard drive seemed to break this ratio. But now that I know such a ratio no longer needs to be respected, I have a happy use for my older hard drives.


So here's a noob question, I understand that /home is where programs live, and /boot is where the OS lives, and /usr is where user data folders live, but what is the / partition?

Posted: Tue Nov 01, 2005 9:31 am
by Mortuis
Never mind then, I followed your link and scrolling up answered my questions.

Posted: Tue Nov 01, 2005 11:24 am
by Gomer_X
I generally use :

/
/boot
/home
swap

A /boot partition is nice for having one GRUB setup for multiple distros.
I've been quite happy since I've been using a separate /home on my main machine. I run Fedora and will wipe my root partition and reinstall roughly every 6 months. Being able to use an old /home and preserve all my data is great.

At the moment I also have /home/jeff/audio as a separate partition to give me another 10 gigs of space for podcasts. :D I tend to leave big chunks of the HD unformatted so I can create partitions later as needed. I've tried LVM so I could resize partitions on the fly, but wasn't happy with it.

As far as filesystems, I use ext2 for /boot (it's too small to need a journal) and ext3 for everything else (except swap of course). Ext3 has been around long enough to just work, and I really don't have anything that needs more performance.