First, I'd recommend that you read 7DS's Help File on the basic filesystem
stuff - knowing that will be a great help with this Help File, and I'm
going to assume from this point on that you have read it.
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
Help File on using fdisk to create and delete partitions, and then my
Help File 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 Help File, 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 Help File. 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.
You're back, huh? You better be ready, because here we go...
First of all, I'm now going to diverge this Help File into two parts.
One is for the people with nothing on their hard drive (or at
least nothing they don't mind getting rid of). The other is
for those of you who are tweaking an existing installation to
accomodate a new Multi-Partition style setup.
Creating a Multi-Partition System with a clean (or soon to be
clean) hard drive
You guys have it relatively easy. Basically all you have to
do is:
- remove all of the partitions on the hard drive (somehow -
if you can get it to mount under Linux, then I have a using
fdisk Help File that you will need later anyway)
- create new partitions of the proper size according to your
newly created strategy (I have the using fdisk Help File to help
you on this)
-- now, at this point, if you are going to install a distro --
-- onto your hard drive, go ahead. It will do the rest for --
-- you, pretty much. Just make sure you specify the mount --
-- points according to your strategy and all should go fine --
- create filesystems on those partitions (again, I have an
Help File on this as well)
- mess around with /etc/fstab however necessary
And then you are done! You will then be running a multi-
partition Linux system. Enjoy it!
Creating a Multi-Partition System with an existing Linux
installation already
This is actually not as hard as it sounds. You simply have
to learn one new skill and you'll be well on your way -
archiving. We use archiving to shrink the data down so that
we can create new partitions accordingly, and then we expand
the archive onto the new partition and delete it off of the
old one.
It's hard to explain in words, and it's easier to explain in
an example, so let's do an example.
Well, I already use a multi-partition setup and am happy with
it. But, for the sake of this Help File, i'll make it a little
more multi-partitioned.
Let's say that one of my partitions was supposed to be
mounted at /usr/src (this is an awfully weird and excessively
control-freakish choice, so it shouldn't be one of your
choices). Let's also say that I wanted to give this a 1GB
partition (also a bit high, unless you are a kernel fan).
The first thing I want to do is create a 1GB partition so
that I can move all my stuff from /usr/src over there. Let's
explore two scenarios: