Linux partitioning

Hey drop us a line about the show. Feel free to ask questions, provide feedback and criticism, or just ramble on about anything your little heart desires.

Moderators: snarkout, Patrick, dann

Post Reply
Anonymous

Linux partitioning

Post by Anonymous » Fri Oct 28, 2005 2:50 pm

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.

User avatar
dann
Site Admin
Posts: 1132
Joined: Mon Apr 26, 2004 10:55 pm
Location: Hampton, Va, USA
Contact:

Post by dann » Fri Oct 28, 2005 3:30 pm

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 /.

Judland
Posts: 1030
Joined: Tue Apr 27, 2004 12:55 pm

Post by Judland » Fri Oct 28, 2005 4:42 pm

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.

User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

Swap Partition

Post by Mortuis » Fri Oct 28, 2005 6:19 pm

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?

User avatar
Wally Balljacker
Posts: 1227
Joined: Fri Jul 29, 2005 3:32 am
Location: University of Massachusetts - Lowell
Contact:

Post by Wally Balljacker » Sat Oct 29, 2005 2:29 am

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. :)

User avatar
snarkout
Site Admin
Posts: 1342
Joined: Tue Aug 16, 2005 9:35 pm

Post by snarkout » Sat Oct 29, 2005 11:29 am

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.
Shared pain is lessened, shared joy is increased; thus do we refute entropy.
--Spider Robinson

Judland
Posts: 1030
Joined: Tue Apr 27, 2004 12:55 pm

Post by Judland » Sat Oct 29, 2005 12:25 pm

Hmm.. I like that idea. Will have to remember that.

User avatar
Jza
Posts: 466
Joined: Sun Oct 30, 2005 7:01 pm
Location: Mexico
Contact:

Partitioning

Post by Jza » Mon Oct 31, 2005 3:46 pm

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?
Alexandro COLORADO

User avatar
treehead
Posts: 159
Joined: Wed Aug 17, 2005 3:20 pm
Location: detroit metro, usa

Re: Swap Partition

Post by treehead » Mon Oct 31, 2005 5:14 pm

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
"It is a widely accepted notion among painters
that it does not matter what one paints, as long as
it is well painted. This is the essence of
academicism. There is no such thing as a good
painting about nothing." --Mark Rothko

User avatar
snarkout
Site Admin
Posts: 1342
Joined: Tue Aug 16, 2005 9:35 pm

Post by snarkout » Mon Oct 31, 2005 10:38 pm

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.
Shared pain is lessened, shared joy is increased; thus do we refute entropy.
--Spider Robinson

User avatar
mrben
Posts: 124
Joined: Thu Apr 29, 2004 6:25 am
Location: Glasgow
Contact:

Post by mrben » Tue Nov 01, 2005 4:53 am

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.
mrBen

Carpe Aptenodytes

JediMoose.org

User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

Post by Mortuis » Tue Nov 01, 2005 9:29 am

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?

User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

Post by Mortuis » Tue Nov 01, 2005 9:31 am

Never mind then, I followed your link and scrolling up answered my questions.

User avatar
Gomer_X
Posts: 901
Joined: Fri Jun 03, 2005 1:31 pm
Location: Cincinnati, Ohio, USA
Contact:

Post by Gomer_X » Tue Nov 01, 2005 11:24 am

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.

Post Reply