Now that the filesystem has been created, you can mount the partition. Initially, it will be empty. The command to mount filesystems is the mount command, and its syntax is as follows:
mount [options] <-t type> [-o mount options] <device> <mounting point> |
In this case, we want to temporarily mount our partition on /mnt (or any other mount point you have chosen – remember that it must exist); the command for mounting our newly created partition is:
$ mount -t ext2 /dev/hdb1 /mnt |
The -t option is used to specify what type of file system the partition is supposed to host. Among the filesystems you will encounter most frequently are ext2fs (the GNU/Linux file system), VFAT (for all DOS/Windows partitions: FAT 12, 16 or 32) and iso9660 (CD-ROM filesystem). If you do not specify any type, mount will try and guess which filesystem is hosted by the partition by reading the superblock. It rarely fails at doing so.
The -o option is used to specify one or more mounting options. These options depend on the filesystem used. Refer to the mount(8) man page for more details.
Now that you mounted your new partition, you need to copy the entire /usr directory into it:
$ (cd /usr && tar cf - .) | (cd /mnt && tar xpvf -) |
Now that the files are copied, we can unmount our partition. To do this, use the umount command. The syntax is simple:
umount <mount point|device> |
$ umount /mnt |
$ umount /dev/hdb1 |