Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Hello, I was wondering if I can get help with Linux, mostly with how to write the commands on a terminal.The following are the questions:

Hello, I was wondering if I can get help with Linux, mostly with how to write the commands on a terminal.The following are the questions:

5-2

In this hands-on project, you mount DVDs to the directory tree and view their contents.

In VirtualBox settings for your VM, attach the ISO image for Fedora Linux to the virtual CDROM drive as you did when we first installed Fedora. You can do this while your Fedora system is running.

Your desktop environment should prompt you that the ISO was inserted and you can open this up with the Files application. If you are not prompted, go to your activities screen and search for Files.

Take a few moments to explore the contents of the DVD within the Files application.

-Open up a terminal and change to the rootuser with password of LNXrocks!.

-At the command prompt, type mount and press Enter. Note the line at the bottom that lists your mounted DVD. Notice that it has been mounted to the expected mount point /run/media/user1/Fedora-*.

-Type umount /dev/sr0 at the command prompt and press Enter to unmount the Fedora ISO image.

-At the command prompt, create the /mymountdirectory to create the directory we will utilize for mounting the installation disk.

Next, create some files and directories within the /mymount directory. Type mount -r /dev/cdrom /mymount at the command prompt, and press Enter. We have mounted the ISO file as read only using the provided option to the /mymount directory.

At the command prompt, provide a long listing of the /mymountdirectory. You should see 4 directories that are provided from the Fedora ISO image.

At the command prompt, type mount and press Enter. Note the line at the bottom that lists your mounted DVD. Now pipe the output of the mount command to grep and grep for the string: sr0

Next, type umount /mymount at the command prompt and press Enter. Type the mount command at a command prompt utilizing the grepcommand for string: sr0.

At the command prompt, provide a long listing of the /mymount file. You will now see the files and directories you previously created in step 6. Recall that these files and directories are inaccessible when mounted over. Ideally you utilize an empty directory such as /mnt or /media.

In your virtualization software, detach the DVD ISO image for Fedora Linux to the DVD drive for the virtual machine. This performs the same action as ejecting the DVD from the physical DVD drive.

Provide screenshot(s) of steps 2 through 13.

Project 5-3

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.

At the terminal, become root by typing su - and press enter and provide LNXrocks! as the password.

Your hard drive should be referenced by /dev/sda but to double-check type fdisk -l and press Enter in a terminal. You should see /dev/sda as the disk and 2 partitions /dev/sda1 and /dev/sda2. /dev/sda2 should be Linux LVM.

At the command prompt, type fdisk /dev/sda and press Enter. You are now in the fdisk utility. Type m and press Enter to view the options of the fdisk utility. We should have at least 5GB of disk space free so we want to create 2 new partitions with this free space.

At the command prompt, type n and press Enter. You should have 2 free primary partitions to use. The default should say p so hit Enter to take the default. Otherwise, type p and press Enter. Your partition number should default to 3 press Enter to proceed. PressEnter to take the default first sector. Type +4Gfor the last sector and press Enter. You should see that output that you created your 3rd partition.

Now we will create the last partition we need. At the command prompt, type n and press Enter. You should have 1 free primary partitions to use. Type p and press Enter. Your partition number should default to 4 press Enter to proceed. Press Enter to take the default first sector. Type +1G for the last sector and press Enter. You should see that output that you created your 4th partition.

Type p to print the partitions. You should have sda1 through 4 created. Typew to write the changes we just made and to exit the fdisk utility. Note the output stating the kernel is not aware of these new partitions.

At the command prompt, type partprobe and press Enter to inform the kernel of the partition table changes.

We now have our partitions created. Next step is to create a filesystem on the partition. At the command prompt, type mkfs t ext4 /dev/sda4 and press Enter.

Create a directory named ewmount for use as a mount point directory underneath the / directory for mounting the new filesystem we created.

Copy the/etc/hosts to theewmount directory. Provide a long listing of the ewmountdirectory to confirm the file we just copied.

At the command prompt, type mount -t ext4 /dev/sda4 ewmount and press Enter.Type the mount command at a command prompt utilizing the grepcommand for string: sda4 and you will see that the new filesystem is mounted to ewmount mount point directory.

Provide a long listing of the ewmountdirectory and observe that you no longer see the hosts file. This is because we mounted /dev/sda4 over the ewmount directory and now see the contents of /dev/sda4. The hosts file still exists and we would have to unmount this directory to access it again.

In order to have this filesystem mount to the ewmount directory upon reboot of the system, we need to add this to the /etc/fstab file. Utilize the vim command to edit the /etc/fstabfile. Add the following entry to the bottom of the file and write the contents and exit vim.

/dev/sda4 ewmount ext4 defaults 0 0

Utilize the mount command and the grep command for the string sda4 and press Enter. You should see that /dev/sda4 is mounted. If it is not, review the previous steps to determine why.

-At the command prompt, type umount ewmount and press Enter. Provide a long listing of the ewmountdirectory and you should see the hosts file again.

-At the command prompt, type mount -a and press Enter. Next run the previous command from step 18. The partition should be mounted since the -a option reads the /etc/fstab file and mounts all of the directories defined.

21.Provide screenshot(s) of steps 7 through 20.

For 5-3, I do not have screenshots because I am very confused for that one.

For 5-2, this are some screenshots I took:

image text in transcribed

image text in transcribed

Oracle VM VirtualBox Manage File Machine Help ITMO 456 Fedora24- Settings New Settings Discard General Storage Tools Global Toos ITMO 456 System Display Storage Audio Storage Devices Saved Controller: IDE Empty Controler: SATA ITMO 456 Fedor Runnig Live CD/DVD Type: ITMO 456 Fedora24.vd size: Location: Attached to: Serial Ports USB Shared Folders M and User Interface d VM and OK Cancel Oracle VM VirtualBox Manage File Machine Help ITMO 456 Fedora24- Settings New Settings Discard General Storage Tools Global Toos ITMO 456 System Display Storage Audio Storage Devices Saved Controller: IDE Empty Controler: SATA ITMO 456 Fedor Runnig Live CD/DVD Type: ITMO 456 Fedora24.vd size: Location: Attached to: Serial Ports USB Shared Folders M and User Interface d VM and OK Cancel

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions