Problem

In this hands-on project, you work with standard hard disk partitions. You will first cr...

In this hands-on project, you work with standard hard disk partitions. You will first create a hard disk partition using the fdisk utility. Next, you create an ext4 filesystem on the partition and mount it to the directory tree. Finally, you use the /etc/fstab file to automatically mount the partition at boot time.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type fdisk device_file and press Enter, where device_file is the device file for your first hard disk (/dev/sda if you have a SCSI or SATA hard disk, or /dev/hda if you have a PATA hard disk). At the fdisk prompt, type m and press Enter to view the various fdisk commands.

3. At the fdisk prompt, type p and press Enter to view the partition table on your hard disk. Which two partitions are present? When were they created? What are their types?

4. At the fdisk prompt, type n and press Enter to create a new partition. Next, type p to select a primary partition and press Enter. When prompted for the partition number, type 3 and press Enter. When prompted for the start cylinder, observe the valid range within the brackets and press Enter to select the default (the first available cylinder). When prompted for the end cylinder, type +10GB and press Enter to create a 10GB partition.

5. At the fdisk prompt, type p and press Enter to view the partition table on your hard disk. How many partitions are present? What type of partition is /dev/hda3 or /dev/ sda3?

6. At the fdisk prompt, type l and press Enter to view the different partition types. Which character would you type at the fdisk prompt to change the type of partition?

7. At the fdisk prompt, type w and press Enter to save the changes to the hard disk and exit the fdisk utility.

8. At the command prompt, type reboot and press Enter to reboot your machine and ensure that the partition table was read into memory correctly. After your Linux system has been loaded, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

9. At the command prompt, type mke2fs –t ext4 device_file and press Enter, where device_file is the device file for the third partition on your first hard disk (/dev/sda3 if you have a SCSI or SATA hard disk, or /dev/hda3 if you have a PATA hard disk).

10. At the command prompt, type mkdir /newmount and press Enter to create a mount point directory underneath the / directory for mounting the third partition on your first hard disk.

11. At the command prompt, type mount –t ext4 device_file /newmount and press Enter, where device_file is the device file for the third partition on your first hard disk (/dev/sda3 if you have a SCSI or SATA hard disk, or /dev/hda3 if you have a PATA hard disk). This will mount your third partition to the /newmount directory. Next, type the mount command and press Enter to verify that the filesystem was mounted correctly.

12. At the command prompt, type ls –F /newmount and press Enter. Is the lost+found directory present? Next, type cp /etc/hosts /newmount at the command prompt and press Enter to copy the hosts file to the new partition. Verify that the copy was successful by typing the ls –F /newmount command at the command prompt again, and press Enter.

13. At the command prompt, type umount /newmount and press Enter. Next, type the mount command and press Enter to verify that the filesystem was unmounted correctly.

14. At the command prompt, type vi /etc/fstab and press Enter. Observe the contents of the file. Add a line to the bottom of the file, as shown here, where device_file is the device file for the third partition on your first hard disk (/dev/sda3 if you have a SCSI or SATA hard disk, or /dev/hda3 if you have a PATA hard disk): device_file /newmount ext4 defaults 0 0

15. Save your changes and quit the vi editor.

16. At the command prompt, type reboot and press Enter. After your Linux system has been loaded, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

17. At the command prompt, type mount and press Enter. Is the third partition on your hard disk mounted? Why?

18. At the command prompt, type umount /newmount and press Enter. Next, type the mount command to verify that the filesystem was unmounted correctly.

19. At the command prompt, type mount -a and press Enter. Next, type the mount command and press Enter. Is the third partition on your hard disk mounted? Why?

20. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5