CIT 210-Operation Systems Management Part 3 & Part 4 Lab Report- CSUN .
CIT210/L OP. SYS. MANAGE (Lab Assignment 2) (80 Points) Lab 2: Linux Directory Structure, Linux and Windows File Server, Windows Server Disk and Storage (Important Note: Some of the Tasks or Steps may not work, You need to Research, Troubleshoot and Modify Configurations to make it work for your Network Environment to get Full Credit) Task 1: Explore Linux Commands (20 Points) Open Terminal window. Enter each of the following commands in turn and write the output Command Explain Output dmesg | more(you may need to press q to quit) passwd date hostname arch uname -a uptime whoami who id finger wc /etc/passwd Department of Computer Science Fall 2021 top (you may need to press q to quit) echo $SHELL clear history head /etc/passwd tail /etc/passwd more /etc/passwd less /etc/passwd lost Task 2: Explore Linux Directory Structure (10 Points) 1. Continue to explore the filesystem tree using cd, ls, pwd and cat. Look in /bin, /usr/bin, /sbin, /tmp and /boot. Summarize information you see in these directories? 2. Explore /dev. Can you identify what devices are available? 3. Explore /proc. Display the contents of the filesinterrupts, devices, cpuinfo, meminfo and uptime using cat. why /proc considered is a pseudo-filesystem which allows access to kernel data structures? 4. Use grep to isolate the line in /etc/passwd that contains your login details. Department of Computer Science Fall 2021 Task 3: Configure File Server Connecting Windows and Linux ( Samba) (30 Points) One of the most common ways to network Linux (Ubuntu or Centos) and Windows computers is to configure Samba as a File Server. This section covers setting up a Samba server to share files with Windows clients. The server will be configured to share files with client on the network. Step 1: Installation The first step is to install the samba package. Step 2: Configuration Configuration The main Samba configuration file is located in /etc/samba/smb.conf. The default configuration file has a significant number of comments in order to document various configuration directives. (File location may be different for different distribution) 1. First, edit the following key/value pairs in the [global] section of /etc/samba/smb.conf: workgroup = EXAMPLE security = user The security parameter is farther down in the [global] section, and is commented by default. Also, change EXAMPLE to better match your environment. (Workgroup Match the windows system) 2. Create a new section at the bottom of the file, or uncomment one of the examples, for the directory to be shared: [share] comment = File Server Share path = /srv/samba/share browsable = yes guest ok = yes read only = no create mask = 0755 • comment: a short description of the share. Adjust to fit your needs. • path: the path to the directory to share. This example uses /srv/samba/sharename because, according to the Filesystem Hierarchy Standard (FHS), /srv3 is where site-specific data should be served. Technically Samba shares can be placed Department of Computer Science Fall 2021 anywhere on the filesystem as long as the permissions are correct, but adhering to standards is recommended. • browsable: enables Windows clients to browse the shared directory using Windows Explorer. • guest ok: allows clients to connect to the share without supplying a password. • read only: determines if the share is read only or if write privileges are granted. Write privileges are allowed only when the value is no, as is seen in this example. If the value is yes, then access to the share is read only. • create mask: determines the permissions new files will have when created 3. Now that Samba is configured, the directory needs to be created and the permissions changed. From a terminal enter: sudo mkdir -p /srv/samba/share sudo chown nobody:nogroup /srv/samba/share/ (Change the commands according to distribution) The -p switch tells mkdir to create the entire directory tree if it doesn’t exist. 4. Finally, restart the samba services to enable the new configuration: sudo systemctl restart smbd.service nmbd.service (Change the commands according to distribution) Once again, the above configuration gives all access to any client on the local network. From a Windows client you should now be able to browse to the Linux file server and see the shared directory. If your client doesn’t show your share automatically, try to access your server by its IP address, e.g. \\192.168.1.1, (Replace with your IP) in a Windows Explorer window. To check that everything is working try creating a directory from Windows. To create additional shares simply create new [dir] sections in /etc/samba/smb.conf, and restart Samba. Just make sure that the directory you want to share actually exists and the permissions are correct. The file share named “[share]” and the path /srv/samba/share are just examples. Adjust the share and path names to fit your environment. It is a good idea to name a share after a directory on the file system. Another example would be a share name of [qa] with a path of /srv/samba/qa. Department of Computer Science Fall 2021 Task 4. Disks and Volumes (Windows Server) (20 Points) Creating Disks:This section includes tasks such as configuring sector sizes appropriate for various workloads, configuring GUID partition table (GPT) disks, creating VHD and VHDX files using Server Manager or Windows PowerShell, and mounting virtual hard disks. This part of the text also discusses the NTFS and ReFS file systems. NFS and SMB Shares: This section details the creation of these shared using tools like Server Manager and PowerShell. File and Folder Permissions: This section ensures that you are comfortable controlling important file and folder permissions in Windows Server. Configuring GUID Partition Table (GPT) Disks Windows Server can use the older Master Boot Record (MBR) partition style or the new and improved GUID Partition Table (GPT) partition style. GPT is very common these days as it allows the use of disk space beyond 2 TB. GPT uses the new and improved UEFI boot mode. It is super simple to check your partition style in Windows Server. Use the following steps to check your settings using Disk Management: Step 1. Right-click the Start button. Step 2. Choose Disk Management from the shortcut menu. Step 3. Right-click your disk. Step 4. Choose Properties. Step 5. Click the Volumes tab and check the Partition Style field. Windows Server allows the conversion of disks to GPT from MBR and vice versa. A disk must be empty and can hold no partitions or volumes. Obviously, it is important to back up your data before performing such a conversion. Follow these steps to convert within Disk Management: Step 1. Right-click the Start button. Step 2. Choose Disk Management from the shortcut menu. Step 3. Right-click the existing partition(s) and choose Delete Volume. Step 4. Right-click the disk and choose Convert to GPT Disk. Note : Third-party tools can perform this conversion without the deletion of data. You can also use the diskpart command prompt tool to perform the conversion, using the following steps: Step 1. Right-click the Start menu. Step 2. Choose the Command Prompt (Admin). Step 3. Type diskpart and press Enter. Step 4. Type list disk and press Enter. Step 5. Type select disk # and press Enter. Step 6. Type clean and press Enter. Department of Computer Science Fall 2021 Step 7. Type convert gpt and press Enter. Creating and Mounting VHD and VHDX Files Using Server Manager or Windows PowerShell Virtual hard disks are growing in popularity in our heavily virtualized datacenter environments, and it is no surprise that their creation is simple both in the GUI of Windows Server 2016 and in PowerShell. Using Server Manager is an easy way to access Disk Management and create VHD or VHDX files. Here is how it works: Step 1. In Server Manager, select Tools > Computer Management. Step 2. In Computer Management, under Storage, choose Disk Management, as shown in Figure Step 3. Select an active volume and then, from the Action menu in Disk Manager, choose Create VHD to open the Create and Attach Virtual Hard Disk window, as shown in Figure Departm
ent of Computer Science Fall 2021 Step 4. Specify the location of the VHD or VHDX, the size of the disk, the format of the disk (Gen 1 VHD or Gen 2 VHDX) and whether the VHD is of a fixed size or dynamically expanding. Step 5. Confirm that the VHDX appears in Disk Management, as shown in Figure Department of Computer Science Fall 2021 Step 6. Right-click the disk identifier on the left and choose Initialize Disk, as shown in Figure Step 7. Choose the MBR or GPT partition method and click OK. Step 8. Right-click your VHDX and choose New Simple Volume to create and mount your virtual hard disk to a drive letter. PowerShell offers cmdlets to make these storage manipulations as well. Here are some key cmdlets you should know: New-VHD: Creates a new VHD or VHDX: Mount-VHD: Mounts one or more virtual hard disks: Get-Disk: Gets one or more disks visible to the operating system: Initialize-Disk: Initializes a RAW disk for first time use, enabling the disk to be formatted and used to store data: New-Partition: Creates a new partition on an existing Disk object: Department of Computer Science Fall 2021 Format-Volume: Formats one or more existing volumes or a new volume on an existing partition: Get-Partition: Returns a list of all partition objects visible on all disks, or optionally a filtered list using specified parameters: Add-PartitionAccessPath: Adds an access path such as a drive letter or folder to a partition: Dismount-VHD: Dismounts a virtual hard disk: SMB and NFS Shares Creating and managing SMB or NFS shares for a network can be critical for your Windows Server requirements. The following sections examine these topics. Remember that SMB shares are used in Windows environments, while NFS shares are found in UNIX environments. Configuring SMB and NFS Shares Using Server Manager NFS and SMB shares of various complexity are simple to create directly from within Server Manager. Follow these steps: Step 1. Launch Server Manager. Step 2. Choose File and Storage Services in the left column. Step 3. Select Shares. Step 4. In the Shares area, right-click an empty space and choose New Share to launch the New Share Wizard, as shown in Figure Notice that this wizard offers many options for share creation, including the following: SMB Share – Quick: This choice is for the simple creation of shares for mainly Windows-based computers. SMB Share – Advanced: This option creates the SMB share with many more advanced options, including the following: Setting the shares’ owners: This can be critical when users are denied access to the share. Configuring the default classification of data in the share: This assists in the creation of management and access policies. Enabling quotas: This allows restrictions on the space that users can consume. SMB Share – Applications: This choice creates SMB shares with settings designed for Hyper-V, certain databases, and other server applications. Department of Computer Science Fall 2021 NFS Share – Quick: This option provides the fastest method of creating basic shares to be used primarily by UNIX-based systems. To use this option, you must install Server for NFS, found under the File and Storage Services – Files and iSCSI Services node of Roles and Features. NFS Share – Advanced: This choice creates the NFS share with advanced options. Note that it requires the installation of Server for NFS as well as the File Server Resource Manager. Advanced options include the following: Setting the shares’ owners: This can be critical when users are denied access to the share. Configuring the default classification of data in the share: This can aid in the creation of management and access policies. Enabling quotas: This allows restrictions on the space that users can consume. Department of Computer Science Fall 2021 Server Storage Follow these steps to configure the Storage Spaces functionality in various configurations: Step 1. In Server Manager, select File and Storage Services and then Storage Pools, as shown in Figure Step 2. Create a new Storage Pool by using the Tasks drop-down menu. Step 3. Provide values for Storage Pool Name and Available Disk Group, and choose Physical Disks for the pool. Step 4. Create a new virtual disk and specify the following values: Storage Pool Virtual Disk Name Enclosure Awareness Storage Layout Resiliency Settings Provisioning Type Size of the Virtual Disk Step 5. When the virtual disk is created, select Create a volume when this wizard closes. Department of Computer Science Fall 2021 Step 6. In the New Volume Wizard, complete the following: Virtual Disk Volume Size Drive Letter File System Volume Label Expanding a Storage Pool is simple. Follow these steps: Step 1. Add a new virtual disk by navigating to iSCSI in Server Manager. Step 2. Create a new iSCSI virtual disk by specifying the following values: Storage location Disk name Size ISCSI target Step 3. In Server Manager, click the Refresh button and wait for all the panes to refresh. Step 4. In the STORAGE POOLS pane, right-click your Storage Pool and then add the new physical disk to the Storage Pool. Step 5. In the VIRTUAL DISKS pane, right-click Mirrored vDisk and then extend your virtual disk to the desired size. Department of Computer Science Fall 2021