Linux partitioning
Moderators: snarkout, Patrick, dann
-
Anonymous
Linux partitioning
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.
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 /.
/
/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 /.
Swap Partition
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?
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?
- Wally Balljacker
- Posts: 1227
- Joined: Fri Jul 29, 2005 3:32 am
- Location: University of Massachusetts - Lowell
- Contact:
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.
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
Shared pain is lessened, shared joy is increased; thus do we refute entropy.
--Spider Robinson
--Spider Robinson
Partitioning
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?
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
Re: Swap Partition
;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.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>
;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;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
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
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
--Spider Robinson
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?
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?
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.
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.
/
/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.
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.