| |
Now you will need to format the actual partitions so that data can
be store on them. The following are the appropriate commands for
formatting several different file systems. It is up to you to decide
on which one is best for you, but here are the commands:
ext2 mke2fs
ext3 mke2fs -j
reiserfs mkreiserfs
xfs mkfs.xfs
jfs mkfs.jfs
The commands to
actually format these filesystem would go with the following syntax:
mkreiserfs /dev/hda1
Once you have formatted the partitions, one thing you will then
need to do is to specify which partition corresponds to where
you want to mount it.
For example, for your swap partition the mounting is fairly straightforward
and different from your other partitions. For swap, you can do:
mkswap /dev/hda1
then
swapon /dev/hda1
Of course this would be true if your swap was on /dev/hda1.
For your other partitions, you will need to create directories
for each of them. Another example is if you want to add a /home/
partition to an existing partition table. Let's say your current
setup is as follows:
swap = /dev/hda1
boot = /dev/hda2
root = /dev/hda3
and you want to add a /home partition so you can have your personal
settings and saved files on a setup partition than your system
or root partition. So, for the entire process (assuming you have
the free space and want to use the reiser file system:
cfdisk 2.12
Disk Drive: /dev/hda
Size: 120034123776 bytes, 120.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 14593
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda1 Primary Linux swap 509.97
hda2 Boot Primary Linux ReiserFS 98.71
hda3 Primary Linux ReiserFS 3997.49
Free Space 115425.36
[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ]
[ Quit ] [ Type ] [ Units ] [ Write ]
So, we see that there is quite a bit of free space so we might
as well create a partition for it to use. The first thing is to
scroll down to where it says Free Space and then select New and
then Primary (I prefer to use Primary as long as it's available
- remember there are four possible primary partitions to each
hard drive). Once it has been selected, you can go to Type and
select Linux. When that is done, dont forget to Write the partition
table! When writing has completed, press Q for quit and you should
be back to your command line.
Now that the Cfdisk steps are done, it is time to create the filesystem
on that partition which according to the above partition table
would be /dev/hda4. In this example, since the /home directory
has already been created and may even be in use right now if you
are doing this on the same hard drive, it is better to just format
the new partition and then add it into your fstab. So, to format
the partition:
mkreiserfs /dev/hda4
when formatting is done, you can just add a line into your /etc/fstab
to activate this partition after rebooting. An example of an fstab
line you would add in this example would be:
/dev/discs/disc0/part4 /home reiserfs defaults 0 0
so after rebooting, you should be able to do:
df -h
in your terminal and you should see that added partition which
should allow you a lot more space to use.
Of course this is just one example, but the same principles can
be used in other situations.
|
|