Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ancillary Exercise 4.b: Maintaining a Linux Filesystem Use a Red Hatbased distribution, such as CentOS. An additional two disks (or disk partitions) of at least

Ancillary Exercise 4.b: Maintaining a Linux Filesystem

Use a Red Hatbased distribution, such as CentOS. An additional two disks (or disk partitions) of at least 1 GB each is required.

If you are not already logged in, press Ctrl+Alt+F2 and log in as the superuser or a user with superuser privileges.

Create two new partitions on two separate drives and make each partition the same size with at least 1023 MiB of space.

Take a Screenshot

record the device file name of the first new partition here (insert answer): ____________.

Record the device file name of the second new partition here(insert answer): _________.

Format the first new partition as an ext4 by typing mkfs.ext4 device-name and pressing Enter. (Dont actually type device-name. Instead, substitute the first new partitions device filename you recorded in the step 3.)

Format the second new partition also as an ext4, but this time type mkfs -t ext4 device-name and pressing Enter. (Dont actually type device-name. Instead, substitute the second new partitions device filename you recorded in the step 4.)

Take a Screenshot

View your new filesystems by typing blkid -t TYPE=ext4 and pressing Enter. Do you see your two new ext4 filesystems? Yes or No (circle one). (Notice that they have both been assigned UUID numbers.)

Try the fsck utility on your first new partition by typing fsck device-name and pressing Enter. (Dont actually type device-name. Instead, substitute the first new partitions device filename you recorded in the step 3.) Record the information display by the fsck utility here (insert answer):

Determine your second new partition's UUID by typing lsblk -f device-name and pressing Enter. (Dont actually type device-name. Instead, substitute the second new partition's device filename you recorded in the step 4.)

Take a Screenshot

Record the partitions UUID you saw in the preceding step here (insert answer):

Create a new UUID value for the second new partition by typing uuidgen and pressing Enter. Record the new UUID here (insert answer):

Using the tune2fs utility, change the second new partitions UUID by typing tune2fs device-name -U new-UUID and pressing Enter. (Dont actually type device-name. Instead, substitute the second new partition's device filename you recorded in the step 4. Also, dont actually type new-UUID. Instead, substitute the new UUID number you obtained in step 11).

Take a Screenshot

See whether you were successful in changing the second new partitions UUID label by typing lsblk -f device-name and pressing Enter. (Dont actually type device-name. Instead, substitute the second new partitions device filename you recorded in the step 4.) Do you see the correct new UUID label for the second new partition? Yes or No (circle one). (If you made a typographical error with the new UUID label, go back to step 12 and try it again.)

Create a new directory by typing mkdir temp and pressing Enter.

Mount the second new partition by typing mount -t ext4 device-name temp and pressing Enter. (Dont actually type device-name. Instead, substitute the second new partitions device filename you recorded in the step 4.)

Take a Screenshot

Type mount -t ext4 and press Enter. Do you see the second new partition mounted at the temp subdirectory? Yes or No (circle one). (You should see that the second new partition is mounted at the temp subdirectory.)

Type mountpoint temp and press the Enter key. You should receive the message temp is a mountpoint.

Create a file within the temp subdirectory by typing cat /etc/passwd > temp/file.dat and pressing Enter.

Double-check that the file is created, properly named, and view its inode number by typing ls -i temp/file.dat and pressing Enter.

Take a Screenshot

Record the files inode number here (its the number to the far left of the screen in the output from the preceding step)(insert answer): _____.

Type debugfs device-name and press Enter. (Dont actually type device-name. Instead, substitute the second new partitions device filename you recorded in step 4.) This starts debugfs, which is an interactive utility.

Check the mapping of the inode number (the number you obtained in step 20) to the files name by typing at the debugfs prompt ncheck inode-number and pressing Enter. (Dont actually type inode-number but instead type the inode number you obtained in step 20). (You should see that the inode is mapped to something similar to //file.dat.)

Look at the filesystem's information by typing stats at the debugfs prompt and pressing Enter. (This will put you into the more pager utility, so you can easily page through the various information provided.)

Record the number of "free inodes" here (insert answer): ________

Find the filesystem's UUID. Is it the same UUID that you recorded in step 11? Yes or No (circle one).

Type q to leave the more pager utility.

Type quit and press Enter to exit the debugfs interactive utility.

Try the dumpe2fs utility. There will be a great amount of information displayed to the screen, so you will be piping the utilitys output into the less pager. Type dumpe2fs -h device-name | less and press Enter. (Dont actually type device-name. Instead, substitute the second new partitions device filename you recorded in the step 4.)

Record the number of free inodes here (insert answer): ________ Is it the same amount that you recorded in step 24? Yes or No (circle one).

Find the filesystems UUID. Is it the same UUID that you recorded in step 11? Yes or No (circle one).

Now unmount the second new partition from the Linux virtual directory structure by typing umount temp and pressing Enter. (Dont make the mistake of typing unmount for the command. It is umount.)

Take a Screenshot

Check to see whether the temp subdirectory is no longer a mount point by typing mountpoint temp and pressing Enter. You should receive the message temp is not a mountpoint.

Check the /proc/mounts file to see whether the second new partition is no longer mounted by typing grep ext4 /proc/mounts and pressing Enter. You should not see the device-name of the second new partition listed.

Even though they are not mounted to the Linux virtual directory structure, you can view information concerning the two new partitions. Do so by typing blkid -t TYPE=ext4 and pressing Enter. Do you see your two new ext4 partitions in the list? Yes or No (circle one).

Now convert your first new partition from ext4 to a btrfs filesystem. Take your time here, and make sure you use the correct device name! Type btrfs-convert -p first-device-name and press Enter. (Dont actually type first-device-name. Instead, substitute the first new partitions device filename you recorded in the step 3.)

Take a Screenshot

Convert your second new partition from ext4 to a Btrfs filesystem. Take your time here also, and make sure you use the correct device name! Type btrfs-convert -p second-device-name and press Enter. (Dont actually type second-device-name. Instead, substitute the second new partition's device filename you recorded in the step 4.)

Type blkid -t TYPE=ext4 and press Enter. You should no longer see the two new partitions listed (because they have been converted to Btrfs filesystems).

Type blkid -t TYPE=btrfs and press Enter. Now you should see the two new partition listed. Notice that they have subUUIDs as well as UUIDs now.

Mount the second partition by typing mount -t btrfs second-device-name temp and pressing Enter. (Dont actually type second-device-name. Instead, substitute the second new partitions device filename you recorded in the step 4.) (This will mount only one partition.)

Take a Screenshot

Add the first partition to the mounted Btrfs filesystem by typing btrfs device add -f first-device-name temp and pressing Enter. (Dont actually type first-device-name. Instead, substitute the first new partitions device filename you recorded in the step 3.)

View the Btrfs filesystem configuration by typing btrfs filesystem df temp and pressing Enter. (Notice there is no "RAID1" shown in output.)

Convert the Btrfs filesystem to a RAID 1 configuration. Take your time in typing in this command, and double-check it before you press the Enter key: btrfs balance start -dconvert=raid1 -mconvert=raid1 temp. (Youll get a prompt back when the conversion is completed.)

View the modified Btrfs filesystem configuration by typing btrfs filesystem df temp and pressing Enter. Do you see RAID1 somewhere in output? Yes or No (circle one).

See whether your original file.dat file (from step 18) still exists (its OK if it no longer exists) by typing ls temp and pressing Enter.

Take a Screenshot

Unmount the btrfs RAID 1 partition by typing umount temp and pressing Enter.

Remove the subdirectory you created earlier by typing rmdir temp and pressing Enter.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

At what level(s) was this OD intervention scoped?

Answered: 1 week ago