First, I'd recommend that you read 7DS's NHF on the basic filesystem
stuff - knowing that will be a great help with this NHF, and I'm
going to assume from this point on that you have read it. It's
located at:
http://linuxnewbie.internet.com/nhf/intel/filesys/filesysintro.html
Well, now that we know the way the filesystem in Linux is generally
organized and the way partitions are set up on drives, you need to
go read my
NHF on using fdisk to create and delete partitions, and then my
NHF on creating filesystems on existing partitions, and you should be
done. The only other thing we need to cover is laying out your
multi-partition plan. This is something you should do before messing with
partitions in fdisk.
Now what? Well, if you are doing this from a drive that already
has stuff on it, then that has a little bit of a different
approach than if you were simply planning on building a multi-
partition system when you install. Both are possible, of course,
but installing on a clean system is easier.
Either way, the first thing you will want to do is create a plan
for how you want your partitions laid out. This is not something
I can really give you a formula for. You have to play around
with it (and, after this NHF, you shouldn't be too scared to play
around with partitions) in order to get it to your liking. As
an example, though. Here's what all those Linux partitions
represent to me - my partition scheme is:
/dev/hdb1 = 1.49GB - (FreeBSD sits here)
/dev/hdb2 = 133MB - my swap partition
/dev/hdb3 = (extended partition)
/dev/hdb5 = 2GB - /home
/dev/hdb6 = 251MB - /var
/dev/hdb7 = 204MB - /tmp
/dev/hdb8 = 1GB - /
/dev/hdb9 = <unused>
/dev/hdb10 = <unused>
/dev/hdb11 = 2GB - /usr
/dev/hdb12 = 2GB - /usr/local
(plus 1141 unused cylinders at the end of the drive)
I also have partitions containing Windows stuff on /dev/hda,
but that's unimportant to this NHF. You may be asking why I
picked such weird numbers like 1.49GB and 133MB. Well, actually
I didn't. A partition has to begin and end on a cylinder, and
since my cylinders are locked in at a certain size, any and all
of the partitions I create have to be a multiple of that size,
so this was close as I could get to the sizes I requested. I
actually wanted 1.5GB, 128MB, 250MB, and 200MB for the BSD,
swap, /var, and /tmp partitions respectively. In fact, the 1GB
and 2GB partitions aren't exactly 1GB and 2GB either.
For those of you who have an existing installation, you actually
have an advantage in this area. You can simply take a look at
how much space your directories take and then plan your strategy
for partitioning accordingly. To see how much space a specific
directory takes on your system, simply issue this command:
du -s -H
For example, I want to see how much space all of the stuff I have
in /usr takes up, so I do this:
du -s -H /usr
and I get back this:
1.6G /usr
That's the size of all the files in that directory. If
you do this as a normal user, you may get a bunch of permissions
errors, and you might get a wrong answer, so su to root to do
this first.
For those of you who don't have an existing installation, you
can either use mine above as an example or ask around (or just
wing it, I suppose).
Now, go plan out your partition strategy and then come back and
we'll continue. Before going, though, I'd suggest that you
leave space at the end of the drive (like I did) for further
shifting around. For now I'd only make partitions a little
bigger than you think you NEED.
[- next page: I've got my plan! -]
Would you like to have your article published online? Send them in to newfiles@linuxnewbie.org