Problem

In this hands-on project, you configure the LVM to host two logical volumes. Next, you f...

In this hands-on project, you configure the LVM to host two logical volumes. Next, you format these logical volumes and mount them to the directory tree, as well as edit the /etc/fstab file to ensure that they are mounted 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 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 4 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, press Enter to select the default of the last available cylinder on your hard disk.

4. 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/hda4 or /dev/sda4?

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

6. 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.

7. At the command prompt, type pvcreate device_file and press Enter, where device_file is the device file for the fourth partition on your first hard disk (/dev/sda4 if you have a SCSI or SATA hard disk, or /dev/hda4 if you have a PATA hard disk). What does this command do?

8. At the command prompt, type vgcreate vg00 device_file and press Enter, where device_file is the device file for the fourth partition on your first hard disk (/dev/ sda4 if you have a SCSI or SATA hard disk, or /dev/hda4 if you have a PATA hard disk). What does this command do?

9. At the command prompt, type lvcreate –L 4GB –n volume1 vg00 and press Enter to create a 4GB logical volume called volume1 from the vg00 volume group.

10. At the command prompt, type lvcreate –L 6GB –n volume2 vg00 and press Enter to create a 6GB logical volume called volume2 from the vg00 volume group.

11. At the command prompt, type mke2fs –t ext4 /dev/vg00/volume1 and press Enter to format the volume1 logical volume using the ext4 filesystem. Next, type mke2fs –t ext4 /dev/vg00/volume2 and press Enter to format the volume2 logical volume using the ext4 filesystem.

12. At the command prompt, type mkdir /volume1 and press Enter to create a mount point for the volume1 logical volume. Next, type mkdir /volume2 and press Enter to create a mount point for the volume2 logical volume.

13. At the command prompt, type mount –t ext4 /dev/vg00/volume1 /volume1 and press Enter to mount the volume1 logical volume to the /volume1 directory. Next, type mount –t ext4 /dev/vg00/volume2 /volume2 and press Enter to mount the volume2 logical volume to the /volume2 directory. When finished, type mount and press Enter to verify that both filesystems are mounted.

14. At the command prompt, type ls –F /volume1 /volume2 and press Enter. Is there a lost+found directory underneath each directory? Why?

15. At the command prompt, type vi /etc/fstab and press Enter. Add the following lines to the bottom of the file, as shown here, to ensure that the volume1 and volume2 logical volumes are mounted at boot time:

16. Save your changes and quit the vi editor.

17. 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.

18. At the command prompt, type mount and press Enter. Are volume1 and volume2 mounted? Why?

19. At the command prompt, type the following commands in turn (pressing Enter after each one) and review the information regarding your computer’s physical and logical volumes:

pvdisplay

pvscan

vgdisplay

vgscan

lvdisplay

lvscan

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