[LINUX] - MANAGING STORAGE
[LINUX] - MANAGING STORAGE
Topic A: Create Partitions
Types of File Systems
Virtual File System (VFS): proc, devtmpfs, debugfs
Real File Systems: xfs, ext4
Fdisk
fdisk vs parted: the former for a disk smaller 2TB, the second command for disk bigger than 2TB
partprobe: update the kernel with changes in partition table
mkfs command
Build a Linux file system on a device, which is usually a drive partition.
Syntax: mkfs [options] {device name}
Storage Device Setup Process:
- Partition the storage device using fdisk or parted
- Format the partition with a file system using mkfs tool
- Add the formatted partition to fstab file so that it is configured by the system on boot
Lab
Create two new partitions:
- 1st new partition: hold system data in an XFS file system
- 2nd new partition: hold critical business file and other user data in an ext4 file system
Creating Partition
Create the first new logical partition
Create an XFS file system on the new partition
Create a second new partition with an ext4 file system
Apply new labels to the new partitions
Managing Logical Volumes
Identify the current logical volumes on the system
Scan the system for pv, vg, and lv
Create physical volumes from backup partitions you created previously
Create a volume group from these new physical volumes
Create three logical volumes in the new volume group
Extend the data backup volume and reduce the log volume
Create file systems on the logical volumes
Mounting File System
Create mount points for the logical volumes
Unmount a volume
Ensure the logical volumes are mounted on boot
Managing File System
Query the system for information about block storage devices
Scan logical volumes for errors
Increase the size of an ext4 file system on a volume
Increase the size of an XFS file system on a volume
Standard Directories
/usr SUBDIRECTORIES
Tracking Space Storage Usage
Configuring Storage Data
Configure the user quotas for the data backup file system
Creates necessary quota files for the file system
Start writing to the file system as the ariley user.
- Enter sudo chmod 777 /backup/* to give ariley the appropriate permissions.
Enter su - ariley to switch to the ariley user account.
Enter Pa22w0rd when promopted for the password.
Enter dd if=/dev/zero of=/backup/data/myfile bs=1M count=5 to write a 5 MB dummy file named myfile to the data backup directory.
Generate a quota report.
Enter exit to return to your student account.
Enter sudo repquota /backup/data to display the quota results.
Verify that the report indicates how many blocks and inodes ariley is using, as well as the user's hard and soft limits
Exceed the soft limit quota.
Switch back to the ariley account.
Enter dd if=/dev/zero of=/backup/data/myfile2 bs=1M count=7 to exceed the soft limit quota for ariley.
Verify that the results indicate that the user block quota has been exceeded.
The user has reached the soft limit for storage blocks.
Exceed the hard limit quota.
Enter dd if=/dev/zero of=/backup/data/myfile3 bs=1M count=10 to attempt to exceed the hard quota limit.
Verify that you were unable to write all of the data to the file system because you exceeded the hard limit quota.
Log out as ariley and return to your student01 account.
Comments
Post a Comment