Unit 07- Disk and File System Management – Flashcards

Unlock all answers in this set

Unlock answers
question
Type the full device file name for the second partition on the hard drive with the lowest ID number? (typed)
answer
/dev/sda2
question
Type the full device file name for the first partition on the hard drive with the third lowest ID number. (typed)
answer
/dev/sdcl (pay attention to partitions vs drives)
question
Which of the following device file names represents the second local terminal on the system?
answer
/dev/tty2 (not ttyS2)
question
What is the file path and name of the directory that contains device files for hard drives, optical drives, and USB devices? (typed)
answer
/dev
question
You have put a new hard disk in your system and created two primary partitions (sdb1 and sdb2) and one extended partition (sdb3). You have just formatted sdb1 with ext3 and sdb2 as a swap area. When you try to format sdb3 as a swap area, you are unable to. What is the problem?
answer
You cannot format an extended partition.
question
You have added a second hard disk to your Linux system. Which of the following commands will allow you to partition the new drive?
answer
fdisk /dev/sdb
question
You want to view partition information for your sda device. Which commands could you use to view the partitions defined on sda? (Select two.)
answer
fdisk /dev/sda, then press p fdisk -I
question
You have a system with a single hard disk. You add a new hard drive to your system. Which of the following commands would you use to partition the new drive?
answer
fdisk /dev/sdb
question
Which hexadecimal code represents an extended partition?
answer
0x85
question
How many logical partitions can you create on an extended partition?
answer
Unlimited
question
How many primary partitions can you create on a single hard disk drive?
answer
4
question
You have installed a new blank hard drive on your Linux system. This is the second drive on the system so it is represented in the file system by the /dev/sdb file. You need to create GUID partitions on this drive. What command do you use to start up the GUID disk management utility to create partitions on the /dev/sdb drive? (typed)
answer
gdisk /dev/sdb
question
With fdisk, you can create a maximum of 4 partitions per disk. What is the maximum number of partitions per disk that can be created using gdisk?
answer
128
question
You have just used the gdisk utility to create 8 partitions on a new hard drive. Which of the following describes the partitions you have just created?
answer
All 8 partitions are the same. They are just partitions. There are no primary, extended, or logical partitions.
question
What is the name of the partition management utility that will both create GUID partitions and create file systems on those partitions? (typed)
answer
parted
question
Which partition management utility can be used to define and change various different GUID partition configurations without committing the configuration to the disk until the w command is used?
answer
gdisk
question
You are preparing to use a logical volume with LVM. Which of the following commands initializes a physical volume?
answer
pvcreate
question
You are preparing to use a logical volume with LVM. Which of the following commands creates a volume group named backup on the third disk in the system?
answer
vgcreate backup /dev/sdc (not: vgcreate /dev/sdc backup)
question
You are using LVM on your Linux system to manage the existing volumes. After adding and initializing the fourth hard drive to the system and creating a physical volume, what command should you use to add it to the backup volume group? (typed)
answer
vgextend ("add")
question
You are using LVM on your Linux system to manage the existing volumes. What command do you enter to scan for logical volumes on the system? (typed)
answer
Ivscan
question
You are using LVM on your Linux system to manage hard disk partitions. What command do you enter to scan for physical volumes on the system? (typed)
answer
pvscan
question
You need to create a logical volume named video in the home volume group and give it 2 TB of disk space. Which command would you use to complete this task?
answer
Ivcreate -L 2T -n video home (-n )
question
After creating logical volumes with LVM, what are the next steps you need to do?
answer
Create file systems on the volumes and mount them.
question
You have added a third hard disk to your Linux system. What command would you use to initialize a physical volume on this disk for later use by the Logical Volume Manager? (typed)
answer
pvcreate /dev/sdc (Don't forget the drive)
question
During the Linux installation process you are asked to choose the file system type for your partitions. Which is the most common Linux file system to choose?
answer
Ext3
question
You are assembling a workstation. The system requirements show that this system will be used primarily to store documents of small size. What is the best Linux file system to install?
answer
Ext4
question
Which of these Linux file systems support journaling? (Choose three.)
answer
Ext3 Ext4 XFS
question
You have successfully partitioned the forth hard drive into 2 primary partitions. You need to format the second partition with the ext3 file system. Which command will work?
answer
mke2fs -j /dev/sdd2 (mke2fs= Ext, -j=ext3 for journaling )
question
Which of the following commands will create an ext2 file system on the first primary partition of the third hard drive? (Choose two.)
answer
mkfs -t ext2 /dev/sdc1 mke2fs /dev/sdc1 (pay attention to spelling... answers are tricky)
question
You created a swap area on sda3, but it is not activated. Which command should you use to activate the swap partition? (typed)
answer
swapon /dev/sda3
question
You have a Linux system with two activated swap partitions: sda3 and sdb2. Which of the following commands can you use to deactivate the sda3 swap partition?
answer
swapoff /dev/sda3 (just sda3)
question
Which file system is a FAT32 file system for Linux? (typed)
answer
VFAT (caps)
question
You need to create an ext4 file system on the first partition on the second hard disk drive. What command should you enter at the command prompt? (typed)
answer
mkfs -t ext4 /dev/sdb1 (pay attention to disk vs partition)
question
Which of the following is not true regarding mount points?
answer
Mount points use the partitions represented by device files located in the /lib directory.
question
You have partitioned and formatted a new hard drive, sdc. You want to mount the first partition on sdc to directory /mnt/newdisk. Which command will perform the mount correctly?
answer
mount /dev/sdcl /mnt/newdisk (pay attention to paths)
question
You are preparing to mount a device local to your system. Which directory holds the device files?
answer
/dev
question
Partition /dev/sdb2 is mounted to /mnt/temp. You need to unmount /dev/sdb2. Which commands would you use? (Choose two.)
answer
umount /mnt/temp umount /dev/sdb2
question
A user is trying to access a file system mounted at /mnt/sdbl but receives an error No such file or directory. Which commands can you use to see the current mount points? (Choose two.)
answer
df mount
question
A number of new file systems have been added to the server and you want them to be active now. You also do not want to bring the server down. Which command makes the changes active?
answer
mount -a (-a forces a reread...?)
question
You want to mount a number of file systems each time the system is brought up. Which configuration file should hold the configuration information for the file systems to be mounted?
answer
/etc/fstab
question
Yesterday you created a new swap area for your system. Today, after rebooting the system, you find the swap area is not mounted. What should you do to ensure the swap area is mounted each time the system boots?
answer
Edit /etc/fstab and add the swap partition.
question
Which file shows the currently mounted volumes?
answer
/etc/mtab (mount tab)
question
You have added several new hard disks to your system. After partitioning and formatting you have modified a configuration file to mount these new file systems automatically. You want to document the change you made. What file would you document?
answer
/etc/fstab
question
You are trying to umount /dev/sdd3 but are receiving a device is busy error message. What can you do to try to unmount the file system? (Choose all that apply.)
answer
Find and close any open files on the file system, and try to unmount again. Make sure your current working directory is not on the file system and try to unmount again.
question
You need to mount the CD-ROM device to the /media/cdrom directory. What command should you enter at the command prompt? (typed)
answer
mount /dev/cdrom /media/cdrom
question
Which of the following directories is specified by Filesystem Hierarchy Standard (FHS) as a mount point for removable media, such as USB storage media, DVDs, CD-ROMs, and Zip disks?
answer
/media (not /mnt)
question
You need to configure your Linux system to allow only the root user account to mount the CD-ROM device. Which of the following options should you add to the /etc/fstab file?
answer
/dev/cdrom /media/cdrom -t iso9660 ro,nouser,noauto (Device, Mount pnt, type, options) (nouser= root only)
question
What is the full path and filename of the file that contains the file system table for a Linux system? (typed)
answer
/etc/fstab
question
You are requested to help a user who reports that he has no more local storage space. You go to his system and log in as root user. Which command will display the available disk space on all partitions? (Choose two.)
answer
df df-h
question
You have created a separate partition for the sales team and mounted it to the /sales directory. The team is about to begin a new project, and they want to make sure there is enough disk space to hold upcoming files. Which command will show you the amount of free space?
answer
df /sales
question
You are asked to help a user who is complaining that file system errors are being reported during boot up. When you reboot the user's system you see errors on sda2. You want to check the file system on sda2 and fix the errors. What can you do?
answer
Change to single user mode and run fsck /dev/sda2. (Have to change to Single User mode)
question
Which command allows you to use an alternative superblock when the primary superblock has been corrupted?
answer
e2fsck -b 16385 /dev/sdal (enhanced fdck)
question
You need to convert the file system of /dev/sdb3 from ext2 to ext3 without affecting the data on the drive. What command and option should you enter at the command prompt? (typed)
answer
tune2fs -j /dev/sdb3 (-j= journaling, not data impact)
question
What is the effect of the tune2fs -j /dev/sdbl command?
answer
Converts the /dev/sdbl device to ext3. (-j= journaling)
question
You suspect your /dev/sda3 partition is in need of repair. Which of the following e2fsck options will repair the errors without any interaction from you?
answer
-p (-p= no questions asked)
question
You have an xfs file system in your Linux computer. You need to display the XFS file system parameters, such as the block size and inode data structures. Which of the following commands should you use? (Select two. Each answer is an independent solution.)
answer
xfs_info xfs_growfs -n
question
You have an XFS file system in your Linux system represented by /dev/sdb1. You need to copy all the filenames on the drive to the /reviewxfs file. You must be able to read the filenames in the /reviewxfs file. Which of the following commands should you use?
answer
xfs_metadump -o /dev/sdbl /reviewxfs (-o= shows filenames)
question
Which command can you enter at the command prompt to list all files and directories in the badams home directory along with a file size and a total amount of space taken up by the directory? (typed)
answer
du -c /home/badams (-c= lists a total amount of space used in dir)
question
Your ext3 file system has experienced a significant amount of corruption. To examine the file system, you want to use the debugfs utility. Which debugfs option should you use to examine the file system?
answer
-c (-c= catastrophic mode)
question
You are inspecting the superblocks and block information on your file system. You need dumpe2fs to display only the blocks that are reserved as bad in the file system. Which option should you use?
answer
-b (-b= bad)
question
You are setting up disk quotas for users and groups on the /home directory. What mount options do you need to include in the entry for mounting the / home directory in the /etc/fstab file?
answer
userjquota=aquota.user and grpjquota=aquota.group (remember the j in the middle = journaling)
question
What is the name of the package that must be installed if you want to use disk quotas on your Linux system? (typed)
answer
quota
question
Which command should you enter at the command prompt to change the quota settings for the gshant user? (typed)
answer
edquota -u gshant
question
Which of the following commands will open the quota file for a specific user?
answer
edquota -u (open = edit file)
question
Which of the following statements best describes the function of the repquota /home -vu command?
answer
A summary of disk usage and quotas is displayed for those users who have files within /home. (not current user's quota limits)
question
After creating the aquota.user and aquota.group files in the /home directory, what command do you enter to enable quotas for the /home directory? (typed)
answer
quotaon /home (home directory)
question
Which command should you enter at the command prompt to display the current user's quota limits and disk usage? (typed)
answer
quota (not rep)
question
Which repquota option will give quota limits and disk usage for all file systems listed in /etc/mtab?
answer
-a
question
You need to implement disk quotas on your Linux system. You need the quotas on the / directory. What is the full path and name of the file that must be edited to implement quotas for users and groups? (typed)
answer
/etc/fstab
question
Which command will display the disk usage and quota limits for the development group?
answer
quota -g development
question
What would you enter at the command prompt to change the group ownership for the devstyle.txt file to rand in the present working directory? (typed)
answer
chown .rand devstyle.txt
question
Which of the following commands make sales the group owner of the /sales/report file? (Select two. Each answer is an independent solution.)
answer
chown :sales /sales/report chown .sales /sales/report (chgrp, not chgroup)
question
You need to see who has permissions to the sales_projection_q2 file. You use Is -I sales_projection_q2 and get this information: drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2 Who is the user shown as owner of this file? (Note: your answer is case-sensitive) What group is shown as owner of this file? (Note: your answer is case-sensitive) (typed 2 parts)
answer
pclark acct
question
You use Is -I /home/sales/sales_projection_q2 and get this information: drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2 Which command will change the user owner to jyoung and the group owner to sales?
answer
chown jyoung:sales /home/sales/sales_projection_q2
question
You must change ownership of a script called myscript so that only the user owner has read/write access to it and only the user owner and group owner have execute permissions. Which of the following commands would accomplish this?
answer
chmod 750 myscript
question
There is a directory called projects owned by the user cmarcela and the group rd. cmarcela has left the company. You need to give ownership of the projects directory, its files, and subdirectories to the user ebates, who is a member of the mgmt group. Which command should you use to change the user ownership?
answer
chown -R ebates projects (just the user)
question
Which set of permissions represent the minimal permissions required to allow a user to list the contents of a directory?
answer
r-x
question
You have a critical file called yearend.xls. You want to set file permissions so that only the owner of the file can modify it and only group owners can read it. Which permission listed below will accomplish that?
answer
-rw-r----- 1 george acctg 26256 June 1 04:16 yearend.xls
question
You are called into the office of a newly hired manager. He has copied a file from his old place of work onto his new workstation, but is now receiving an error message that access is denied each time he tries to access the file. He is not the owner of the file, and not a member of the group the file is associated with. Which of the following represents the least set of file permissions needed for him to be able to read and write to the file?
answer
666 (read + write)
question
A user calls the help desk. Each time he creates a new text file, permissions of 640 are applied to the file and he must use chmod to set them to 644. What command should you enter in the user's profile to set the default permission for newly created files to 644?
answer
umask 0022 (file default is -rw-rw-rw-)
question
While reading about file system permissions in Linux you discover that the default permissions assigned to new files when they are created are rw-rw-rw- (666 octal) and new directories are rwxrwxrwx (777 octal). However, when you create a new file in a directory called /data the permissions assigned are rw-r-r—. Why is this?
answer
The umask must be set to 0022 and therefore block the write permission for the group owner and everyone else.
question
You need to create a large number of files and would like to ensure that you, the user owner, are the only one that has read and write permissions to the files. The files will be located in a number of different directories that already contain files that you don't want their permissions modified. How could you create these files with the correct permissions using the least amount of effort?
answer
Type umask 0066 to change your umask. (you are going to "create them")
question
What is the typical default umask value?
answer
022
question
You need to set the SUID permission on a file named rider. Which of the following commands will accomplish this?
answer
chmod 4777 rider
question
A file named acctg needs to have the SGID permission set on it while keeping all other permissions at their present value. Which of the following commands will accomplish this?
answer
chmod g+s acctg (category+permission: Group+Set ID) (Not s+g)
question
You have an application whose owner is root but you want all users to execute the application with root user permissions. Which of the following examples shows correct usage of the SUID flag?
answer
-rwsr--r-- 3 root sys 73748 Nov 2 2005 /usr/bin/applicationx (instead of -rwx-r--r-- 3... | x -> s)
question
You have an application whose group is sys but you want all users, whether or not they are members of the sysadmin group, to execute the application with sysadmin group permissions. Which of the following examples shows correct usage of the SGID flag?
answer
-rwxr-sr-- 3 root sysadmin 73748 Nov 2 2005 /usr/bin/applicationx (not -rwxr-sr-s... Not sure why...)
question
Setting the SUID flag is a powerful and useful feature. It can have weaknesses associated with its use. Which of the following statements identifies a weakness?
answer
Setting the SUID flag for an application or process owned by the root user is a potential security hole. (They don't become root, just run as root)
question
Which of the following special permissions will prevent a file's deletion by anyone except the file owner?
answer
Sticky Bit (value of 1xxx)
question
You have just installed a new program that will be used by all users on the computer. After installation, you log in as a regular user and you try to run the program. The program stops and displays the following error: Error: not running as root What should you do so that all users can run this program?
answer
Set the SUID on the program.
question
You are the team lead for a marketing project. Only the members of the team3 group should have read/write permissions to a document called project_data.doc, however, you want to ensure that no one on the team will delete the document by accident. Your user name is bsmith. A long listing of the file is as follows: -rwxr-xr-x 1 bsmith team3 7260 June 22 2004 project_data.doc Which of the following commands would accomplish this?
answer
chrnod 1664 project_data.doc
question
You want to archive some configuration files to the floppy drive. You are using the cpio utility. Which line will create the archive on the floppy?
answer
Is /etc/*.conf | cpio -ovd > /dev/rfd0 (has to have the >)
question
You want to restore files with the extension .cfg from an archive called configs.cpio. Which command will perform the restore?
answer
cpio -ivd "*.cfg" < /mnt/hdd2/configs.cpio (cpoi command "file type" < location)
question
You have a tape archive mounted in /dev/rmt12. You need to get a list of the file contents. Which command will list the contents?
answer
tar -tf /dev/rmt12 (-t= lists archive content, -f= file)
question
You have a SCSI tape drive st0. You want to backup the contents of /var/oracle. Which command will perform the backup?
answer
tar -vcf /dev/st0 /var/oracle (tar command "Destination" "Desired Backup")
question
You need to backup Jane's files in her /home/user/jane directory. Which command will create an archive in the /root directory? (Select two.)
answer
tar -czvf /root/jane.tgz /home/user/jane tar -cvf /root/jane.tar /home/user/jane (tar "To" "From") (-z=gz, -j=bz, -J=xz)
question
You need to restore a file, yearend.xls, from the archive 013004.tar.gz'm the backup directory. The file needs to be restored to /home/accounting. Which command will perform the restore?
answer
tar -xzvf /backup/013004.tar.gz /home/accounting/yearend.xls (needs the -z for decompression)
question
Which utility allows you to make an exact copy of a file?
answer
dd (not: tar, cpio, cp)
question
You are compressing a file with the tar utility, but you need to ensure you can uncompress the file with the bzip2 utility. Which tar option should you use during the file compression?
answer
-j (tar -z=gz, -j=bz, -J=xz)
question
You need to view the files within /home/gshant/expfile.bz2 , but you want to leave the compressed file unchanged. What bzip2 option should you use? (typed)
answer
-k (not the entire command) (bzip -k filename= keep orig file unchanged)
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New