Now that the filesystem has been created, you can mount the partition. Initially, it will of course 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 mount our partition on /mnt (or any other mount point you have chosen -- don't forget that it must exist); the command for mounting our newly created partition is as follows:
$ mount -t ext2 /dev/hdb1 /mnt
The -t option is used to specify what type of filesystem the partition is supposed to host. Among the filesystems you will encounter most frequently, are ext2 (the GNU/Linux filesystem), vfat (for all DOS/Windows partitions: FAT 12, 16 or 32) and iso9660 (CDROM filesystem).
The -o option is used to specify one or more mounting options. These options depend on the filesystem used. Refer to the man 8 mount manual page for more details.
Now that you have mounted your new partition, you need to copy the whole directory /usr into it:
$ (cd /usr && tar cf - .) | (cd /mnt && tar xpvf -)
Now that the files have been copied, we can unmount our partition. To do this the command is umount . The syntax is simple:
umount <mount point|device>
So, to unmount our new partition, we can type:
$ umount /mnt
or else:
$ umount /dev/hdb1
As this partition is going to "become" our /usr directory, we need to tell this to the system. To do this, we fill in: