mkfs & mount
mkfs is used to format a disk partition, similar to DOS format.
mount is used to insert or remove a partition from the file structure.
Lets say that you have three partitions on your hard drive. One is native Linux, one is your swap file, and the third is unformatted. Lets make a little chart....
| Filesystem | Device | Mount Point |
| Linux | /dev/hda4 | / |
| Swap | /dev/hda6 | swap |
| Unformatted | /dev/hda5 | none |
So - you want to be able to use your other partition. Well - pick a file system first. Want it to be VFAT? How about MSDOS? Or another Linux native partition? Well, you need to know which file systems your kernel will support. Do a man mkfs for more information on that.
Lets say you want to make is a DOS partition. Type in the following:
mkfs -t msdos /dev/hda5
A few minutes later it is done. This is basically like typing 'format' at a dos prompt. But now that it is formatted, how do you get to it? 2 ways...
First, create a directory to manually mount the drive on.....
mkdir /mnt/dos
mount
/dev/hda5 /dos
or you can edit the /etc/fstab file and add in your new partition, then reboot.
It will look something like this:
| /dev/hda1 | / | ext2 | defaults | 1 1 |
| /dev/hda5 | /dos | msdos | defaults | 0 0 |
| /dev/hda6 | swap | swap | defaults | 0 0 |
| /dev/fd0 | /mnt/floppy | ext2 | noauto | 0 0 |
| /dev/cdrom | /mnt/cdrom | iso9660 noauto,ro | 0 0 | |
| none | /proc | proc defaults | 0 0 |
So - going by the fstab file, if you insert a CDROM and you need to read it, what do you do?
mount /dev/cdrom /mnt/cdrom
then cd to /mnt/cdrom and ls to view.
What about the floppy?
mount /dev/fd0 /mnt/floppy