Linux LPI 117-101 # 7 Of 9

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tobyyy
T
Tobyyy
Community Contributor
Quizzes Created: 10 | Total Attempts: 1,406
Questions: 60 | Attempts: 109

SettingsSettingsSettings
Linux LPI 117-101 # 7 Of 9 - Quiz


linux lpi testing


Questions and Answers
  • 1. 

    Which of the following syslog identifiers represents the highest priority?

    • A.

      Notice

    • B.

      Warning

    • C.

      Error

    • D.

      Critical

    Correct Answer
    D. Critical
    Explanation
    critical represents the highest priority of any facility.
    mail.info : Lowest priority
    mail.critical : Highest priority of facilitiy.

    Rate this question:

  • 2. 

    Which of the following syslog identifiers represents the highest priority?

    • A.

      Alert

    • B.

      Error

    • C.

      Critical

    • D.

      Emerg

    Correct Answer
    D. Emerg
    Explanation
    critical represents the highest priority of any facility.
    mail.info : Lowest priority
    mail.critical : Highest priority of facilitiy.

    Rate this question:

  • 3. 

    Which of the following syslog identifiers represents the highest priority?

    • A.

      Info

    • B.

      Warning

    • C.

      Notice

    Correct Answer
    B. Warning
    Explanation
    the standard syslog levels are (in descending order of priority): emerg,
    alert, crit, err, warning, notice, info, debug

    Rate this question:

  • 4. 

    Which of the following syslog identifiers represents the highest priority?

    • A.

      Alert

    • B.

      Error

    • C.

      Critical

    • D.

      Emerg

    Correct Answer
    D. Emerg
    Explanation
    the standard syslog levels are (in descending order of priority): emerg,
    alert, crit, err, warning, notice, info, debug

    Rate this question:

  • 5. 

    You run the following commands:           [user@prompt]$ nice -n 1 program1           [user@prompt]$ nice -n 5 program2           [user@prompt]$ nice -n 10 program3           Which of the program started will have the highest priority?

    • A.

      Program1

    • B.

      Program2

    • C.

      Program3

    Correct Answer
    A. Program1
    Explanation
    When process start, it start with default priority value of 0, Priority
    value can be -20 (which is highest ) to 19 (which is lowest). So Answer A is correct.

    Rate this question:

  • 6. 

     You run following commands:           [user@prompt]$ nice -n 1 program1           [user@prompt]$ nice -n 5 program2           [user@prompt]$ nice -n 10 program3           Which of the program started will have the highest priority?

    • A.

      Program 1

    • B.

      Program 2

    • C.

      Program 3

    Correct Answer
    A. Program 1
    Explanation
    hen process start, it start with default priority value of 0, Priority
    value can be -20 (which is highest ) to 19 (which is lowest). So Answer A is correct.

    Rate this question:

  • 7. 

     Which two programs will allow you to change the priority of a program already running?(Choose two)

    • A.

      Top

    • B.

      Nice

    • C.

      Niceit

    • D.

      Renice

    • E.

      Chnice

    Correct Answer(s)
    A. Top
    D. Renice
    Explanation
    Renice alters the scheduling priority of one or more running
    processes.
    Example: # renice -20 -p 3042 : Which sets the -20 priority to process having 3042 PID.

    Rate this question:

  • 8. 

    Which command would you use to change the priority of a running process?

    • A.

      Renice

    • B.

      Nice

    • C.

      Kill

    • D.

      Pstree

    • E.

      Killall

    Correct Answer
    A. Renice
    Explanation
    Renice alters the scheduling priority of one or more running
    processes.
    Example: # renice -20 -p 3042 : Which sets the -20 priority to process having 3042 PID.

    Rate this question:

  • 9. 

    To change the priority of a running process, you use the _____ command. (Specifycommand only with no options)

    Correct Answer
    renice
    Explanation
    Renice alters the scheduling priority of one or more running
    processes.
    Example: # renice -20 -p 3042 : Which sets the -20 priority to process having 3042 PID.

    Rate this question:

  • 10. 

    What program would you use to increase or decrease the priority of a commandbefore it is executed?

    Correct Answer
    nice
    Explanation
    nice command helps to run the command by setting different priority.
    #nice -n -20 find / -size +1024k
    Which runs the find command by setting priority value -20.

    Rate this question:

  • 11. 

    What command could be used to get a hierarchical view of all the processes runningon the system without requiring your to provide any switches or options?

    Correct Answer
    top
    Explanation
    The top programs provides a dynamic real-time view of running
    system. It can display system summary information as well as a list of tasks
    currently being managed by the linux kernel.

    Rate this question:

  • 12. 

    You have created a really long letter and after you are done you notice that youused the name "Bob" many times but you forgot to capitalize it in many instances.Which command would replace "bob" with "Bob" in all instances and generate anew letter for printing?

    • A.

      Sed '/bob/Bob' letter > newletter

    • B.

      Sed s/bob/Bob/ leter < newletter

    • C.

      Sed 's/bob/Bob/' letter> newletter

    • D.

      Sed 's/bob, Bob/' letter > newletter

    Correct Answer
    C. Sed 's/bob/Bob/' letter> newletter
    Explanation
    sed is called the stream editor command, which is used to find and
    replace the string pattern.
    Example:
    #sed 's/cat/dog/' testfile >testfile1 : Which replace the cat to dog from testfile and redirect
    the output into testfile1 file.
    Similaly Answer C is correct.

    Rate this question:

  • 13. 

    A user needs to search a file for lines that contain the asterisk (*) character. Whichgrep search command will accomplish this? Choose all that apply.

    • A.

      Grep \* textfile

    • B.

      Grep '*' textfile

    • C.

      Grep "*" textfile

    • D.

      Grep \ textfile

    • E.

      Grep "'*'" textfile

    Correct Answer(s)
    A. Grep \* textfile
    B. Grep '*' textfile
    C. Grep "*" textfile
    Explanation
    grep, sed, tail, head, less, sort, cut etc are string processing tools,
    which uses different symbls to match the pattern.
    Whildcard Charaacter:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with
    So grep search the pattern and displays all lines matching the pattern. But * is the
    meaningfull character so to kill the meaning of meaningfull characters should use \.

    Rate this question:

  • 14. 

    You want to search the file myfile for all occurances of string containing at least fivecharacters, where character number 2 and 5 are 'a' and character number 3 is NOT'b'. Which command would you use?

    • A.

      Grep a*^b*a myfile

    • B.

      Grep .a[^b].a myfile

    • C.

      Grep .[a].*.[a] myfile

    • D.

      Grep .a*^b..a myfile

    Correct Answer
    B. Grep .a[^b].a myfile
    Explanation
    grep, sed, tail, head, less, sort, cut etc are string processing tools,
    which uses different symbls to match the pattern.
    Whildcard Charaacter:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with

    Rate this question:

  • 15. 

    Which of the following commands would display the lines containing capital lettersform the file "turkey.txt"?

    • A.

      Cat turkey.txt|wc -|

    • B.

      Grep -n [A-Z] turkey.txt

    • C.

      Cat turkey.txt|wc -w [A-Z]

    • D.

      Grep -v [A-Z] < turkey.txt

    • E.

      For [A-Z] in turkey.txt | count

    Correct Answer
    B. Grep -n [A-Z] turkey.txt
    Explanation
    grep, sed, tail, head, less, sort, cut etc are string processing tools,
    which uses different symbls to match the pattern.
    Whildcard Charaacter:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with

    Rate this question:

  • 16. 

    You wish to list all files within your current working directory that are of the typeASCII, showing just a single line for each of those files. Type in the command stringthat would accomplish this.

    Correct Answer
    file * | grep ASCII
    file * | grep -i ascii
    Explanation
    file command determines the type of file,
    #file filename
    File type can be ASCI, directory, HTML file etc.
    # file * | grep ASCII : Displays the all ASCII files

    Rate this question:

  • 17. 

    You are writing text in vi. Now you want to save your changes and exit.Which two sequence of inputs will accomplish this? Select two.

    • A.

      Esc XX

    • B.

      Ctrl :w!

    • C.

      Esc zz

    • D.

      Esc :wq!

    • E.

      Esc ZZ

    Correct Answer(s)
    D. Esc :wq!
    E. Esc ZZ
    Explanation
    Shortcuts Description
    :wq or ZZ Save and Exit
    :w Write into Disk
    :q! Quit without Save

    Rate this question:

  • 18. 

    You want to save vi changes to the file myfile with :w!, but vi complains it can notwrite to the file. Therefore, you want to check the write permissions on the file. Todo this without leaving vi, you type:

    • A.

      :!ls -l myfile

    • B.

      :\ls -l myfile

    • C.

      Esc :ls -l myfile

    • D.

      :?ls -l myfile

    Correct Answer
    A. :!ls -l myfile
    Explanation
    You can execute the external commands in vi editor using :! command
    Example: :!ls -l à displays all contents of current directory.

    Rate this question:

  • 19. 

    You wish to match instances of the word 'Many' that are at the begining of a line inthe vi editor. What is the key combination to do this? Include the character toindicate a search in VI, and type the command as if you were in Command Mode inVI.

    Correct Answer
    /^Many
    Explanation
    In vi Editory we can search any pattern in forward directory using /
    and backward direction using ?. As well as can use different string processing
    symbols.
    Whildcard Charaacter:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with
    So /^Many search all lines beginning by Many word.

    Rate this question:

  • 20. 

    You wish to match the character string v2.1 v2.2 v2.3 through to v2.9 within VI.Type the search string to achieve this.

    Correct Answer
    /v2\.[1-9]
    Explanation
    In vi Editory we can search any pattern in forward directory using /
    and backward direction using ?. As well as can use different string processing
    symbols.
    Whildcard Charaacter:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with

    Rate this question:

  • 21. 

    How can you print an entire file to standard output?

    • A.

      Printfile

    • B.

      Cat

    • C.

      Ls

    • D.

      Pr2stdout

    Correct Answer
    B. Cat
    Explanation
    Cat allows you to look, modify or combine a file. The ls command will
    list the files and directories within the current working directory (the directory you
    are currently in). Pr2stdout does not exist.

    Rate this question:

  • 22. 

    Select all the ways of exiting and saving a vi session.

    • A.

      :wq

    • B.

      :w

    • C.

      :ZZ

    • D.

      Shift ZZ

    • E.

      :x

    Correct Answer(s)
    A. :wq
    D. Shift ZZ
    E. :x
    Explanation
    The given options are different commands used in the vi editor to exit and save a session. The command ":wq" is used to write the changes and exit the session, while "Shift ZZ" is a shortcut for the same command. The command ":x" is also used to save and exit the session. Therefore, the correct answer is ":wq, Shift ZZ, :x" as these are the valid ways to exit and save a vi session.

    Rate this question:

  • 23. 

    After starting vi to edit an existing text file, you press 'A' (shift +a). This will let you:

    • A.

      Insert text at the end of the current file.

    • B.

      Insert text at the end of the current sentence.

    • C.

      Insert text after your current cursor position.

    • D.

      Insert text at the end of the file.

    • E.

      Insert text at the end of your current paragraph.

    Correct Answer
    B. Insert text at the end of the current sentence.
    Explanation
    Pressing 'A' in vi (text editor) after starting to edit an existing text file will let you insert text at the end of the current sentence.

    Rate this question:

  • 24. 

    Type in the VI command line that would open the file mytestfile.txt and line numberit?

    Correct Answer
    vi +"set number" mytestfile.txt
    -vi mytestfile.txt +"set number"
    --vi mytestfile.txt "+set number"
    --vi "+set number" mytestfile.txt
    Explanation
    set number option set the line number in vi editor. If you want to open
    the file in vi editor, you can use one of above command.

    Rate this question:

  • 25. 

    You wish to edit the file 'mytextfile' with the VI editor and search for the string' Certkiller '. Type in the command line to open the file and highlight the first instanceof Certkiller , (and any others).

    Correct Answer
    vi +/Certkiller mytextfile
    vi mytextfile +/ Certkiller
    Explanation
    To search in vi editor:
    / à Search in Forward Directtion
    ? à Search in Backward Direction
    n à find Next in forward Direction
    Nà Find Next in previous Direction
    So vi +/ Certkiller mytextfile will search the Certkiller in mytextfile.

    Rate this question:

  • 26. 

    Using the VI editor you wish to paste the contents of the b buffer to the position ofthe cursor. What key combination would you type.

    Correct Answer
    bp
    Bp
    Explanation
    "bp paste the contents of the b buffer to the postion of the cursor.

    Rate this question:

  • 27. 

    You wish to search for lines in VI that end with the string ' Certkiller ' Input thekeystrokes to achive this, including the vi search character.

    Correct Answer
    /Certkiller$
    Explanation
    In vi Editory we can search any pattern in forward directory using /
    and backward direction using ?. As well as can use different string processing
    symbols.
    Wildcard Character:
    . àAny Single Character
    * àzero or more character
    [abc] àAny Single Character from the range
    [^abc] àAny Single Character except from the range
    Similarly Anchors
    ^ àLine beigns with
    $ àLine ends with
    \< àWord beigns with
    \> àWord ends with
    $ symbol is used to search the pattern ended the lines with.

    Rate this question:

  • 28. 

    In the vi editor, which of the following commands will delete thecurrent line at the cursor and the 16 lines following it (17 lines total)?

    • A.

      17d

    • B.

      17dd

    • C.

      17x

    • D.

      D17d

    • E.

      16d

    Correct Answer
    B. 17dd
    Explanation
    dd option is used to delete the current line. To delete more than one
    line, we should pass the number of lines from current line.

    Rate this question:

  • 29. 

    While using the vi editor, you wish to move ahead one page. You should press thecontrol key and

    • A.

      A

    • B.

      D

    • C.

      F

    • D.

      U

    Correct Answer
    C. F
    Explanation
    To move screen in vi Editor,
    F à go forward one full screen
    B à go back one full screen
    D à go down half screen
    U à go up half screen

    Rate this question:

  • 30. 

    Using vi, you want to save changes to the file myfile with :w!, but vi complains itcannot write to the file. Therefore, you want to check the write permissions on thefile. To do this without leaving vi, you type:

    • A.

      :!ls -l myfile

    • B.

      :\ls -l myfile

    • C.

      Esc :ls -l myfile

    • D.

      :?ls -l myfile

    Correct Answer
    A. :!ls -l myfile
    Explanation
    A is correct because if you want to execute the bash commands on vi
    editor, use :!command . If you want to list the details of specified files, use :!ls -l
    filename. Similarly to display the date use :!date. To write the output of command
    in opened file in vi editor use !!date, !!ls -l etc.

    Rate this question:

  • 31. 

    What is the most popular file system choice?

    • A.

      Ext2

    • B.

      Bsdf

    • C.

      Jfs

    • D.

      Ext3

    Correct Answer
    A. Ext2
    Explanation
    Ext3 is the newer filesystem in linux having more advantages the older
    ext2 filesystem.
    What are the advantages of ext3?Why do you want to migrate from ext2 to ext3? Four
    main reasons: availability, data integrity, speed, and easy transition.
    Availability
    After an unclean system shutdown (unexpected power failure, system crash), each ext2
    file system cannot be mounted until its consistency has been checked by the e2fsck
    program. The amount of time that the e2fsck program takes is determined primarily by
    the size of the file system, and for today's relatively large (many tens of gigabytes) file
    systems, this takes a long time. Also, the more files you have on the file system, the
    longer the consistency check takes. File systems that are several hundreds of gigabytes in
    size may take an hour or more to check. This severely limits availability.
    By contrast, ext3 does not require a file system check, even after an unclean system
    shutdown, except for certain rare hardware failure cases (e.g. hard drive failures). This is
    because the data is written to disk in such a way that the file system is always consistent.
    The time to recover an ext3 file system after an unclean system shutdown does not
    depend on the size of the file system or the number of files; rather, it depends on the size
    of the "journal" used to maintain consistency. The default journal size takes about a
    second to recover (depending on the speed of the hardware).
    Data Integrity
    Using the ext3 file system can provide stronger guarantees about data integrity in case of
    an unclean system shutdown. You choose the type and level of protection that your data
    receives. You can choose to keep the file system consistent, but allow for damage to data
    on the file system in the case of unclean system shutdown; this can give a modest speed
    up under some but not all circumstances. Alternatively, you can choose to ensure that the
    data is consistent with the state of the file system; this means that you will never see
    garbage data in recently-written files after a crash. The safe choice, keeping the data
    consistent with the state of the file system, is the default.
    Speed
    Despite writing some data more than once, ext3 is often faster (higher throughput) than
    ext2 because ext3's journaling optimizes hard drive head motion. You can choose from
    three journaling modes to optimize speed, optionally choosing to trade off some data
    integrity.
    1. One mode, data=writeback, limits the data integrity guarantees, allowing old data to
    show up in files after a crash, for a potential increase in speed under some circumstances.
    (This mode, which is the default journaling mode for most journaling file systems,
    essentially provides the more limited data integrity guarantees of the ext2 file system and
    merely avoids the long file system check at boot time.)
    2. The second mode, data=ordered (the default mode), guarantees that the data is
    consistent with the file system; recently-written files will never show up with garbage
    contents after a crash.
    3. The last mode, data=journal, requires a larger journal for reasonable speed in most
    cases and therefore takes longer to recover in case of unclean shutdown, but is sometimes
    faster for certain database operations.
    The default mode is recommended for general-purpose computing needs. To change the
    mode, add the data=something option to the mount options for that file system in the
    /etc/fstab file, as documented in the mount man page (man mount).
    Easy Transition
    It is easy to change from ext2 to ext3 and gain the benefits of a robust journaling file
    system, without reformatting. That's right, there is no need to do a long, tedious, and
    error-prone backup-reformat-restore operation in order to experience the advantages of
    ext3. There are two ways to perform the transition:
    1. The Red Hat Linux installation program offers to transition your file systems when
    you upgrade your system. All you have to do is select one checkbox per file system.
    2. The tune2fs program can add a journal to an existing ext2 file system. If the file
    system is already mounted while it is being transitioned, the journal will be visible as the
    file .journal in the root directory of the file system. If the file system is not mounted,
    the journal will be hidden and will not appear in the file system. Just run tune2fs -j
    /dev/hda1 (or whatever device holds the file system you are transitioning) and change
    ext2 to ext3 on the matching lines in /etc/fstab. If you are transitioning your root file
    system, you will have to use an initrd to boot. Run the mkinitrd program as described
    in the manual and make sure that your LILO or GRUB configuration loads the initrd. (If
    you fail to make that change, the system will still boot, but the root file system will be
    mounted as ext2 instead of ext3 - you can tell this by looking at the output of the
    command cat /proc/mounts.) More information on tune2fs can be found in the
    tune2fs man page (man tune2fs).

    Rate this question:

  • 32. 

    What steps need to be performed, to make a new disk accessible to users? Select three.

    • A.

      Fdisk

    • B.

      Mkfs

    • C.

      Mount

    • D.

      Stat

    • E.

      Quotaon

    Correct Answer(s)
    A. Fdisk
    B. Mkfs
    C. Mount
    Explanation
    One large disks convert into multiple small paritions using fdisk,
    sfdisk, GNU parted etc tools. After creating the small partitions needs to create the
    filesystem into the partitions. After creating the filesystem needs to mount on
    directory only after user can use the partition.

    Rate this question:

  • 33. 

    Which THREE of the following commands are used when setting up and accessing anew filesystem on the hard drive?

    • A.

      Fsck

    • B.

      Mkfs

    • C.

      Mount

    • D.

      Fdisk

    • E.

      Format

    Correct Answer(s)
    B. Mkfs
    C. Mount
    D. Fdisk
    Explanation
    One large disks convert into multiple small paritions using fdisk,
    sfdisk, GNU parted etc tools. After creating the small partitions needs to create the
    filesystem into the partitions. After creating the filesystem needs to mount on
    directory only after user can use the partition.
    Create the partitionàCreate the filesystemà Mount the filesystem

    Rate this question:

  • 34. 

    Type in the command line that will display the partitions on just the SecondarySlave drive in your system.

    Correct Answer(s)
    fdisk -l /dev/hdd
    Explanation
    fdisk is the partition management tool use to create, format, delete the
    partitions. fdisk -l /dev/hda displays the all partitions created in /dev/hda

    Rate this question:

  • 35. 

    Type the full command line to begin partitioning the second SCSI drive on yoursystem using the most common disk partitioning tool.

    Correct Answer(s)
    fdisk /dev/sdb
    Explanation
    Device Name Convention
    IDE Disk:
    Primary Master: /dev/had
    Primary Slave: /dev/hdb
    Secondary Master: /dev/hdc
    Secondary Slave: /dev/hdd
    SCSI Disk:
    /dev/sda
    /dev/sdb
    fdisk is the disk management tool use to create, delete the partitions.
    #fdisk -l : Displays all partitions
    #fdisk -l /dev/hda : Displays all partitions created in /dev/had
    #fdisk /dev/hda : fdisk mode can create partition on hda
    #fdisk /dev/sdb : fdisk mode can create partition on /dev/sdb

    Rate this question:

  • 36. 

    According to version 2.2 of the Fliesystem Hierarchy Standard, which of thefollowing is an optional directory in / (the root file system)? Select all that apply

    • A.

      /boot

    • B.

      /tmp

    • C.

      /mnt

    • D.

      /home

    • E.

      /var

    Correct Answer(s)
    A. /boot
    B. /tmp
    D. /home
    E. /var
    Explanation
    When you try to install the linux into your system, you need to create
    at least / and swap (Virtual Memory) filesystems. As well as some important
    directories which can't separate from / like dev, lib, bin, sbin, etc. Other are called
    the Optional filesystem.

    Rate this question:

  • 37. 

    You have written a custom tool on your local system. Following the File HierarchyStandard (FHS), where should you install the binaries to be available to all users onyour system?

    Correct Answer(s)
    /bin
    Explanation
    The Linux File system Hierarchy

    Rate this question:

  • 38. 

    According to the Linux File System Hierarchy Standard, which one of the followingdirectories is shareable and for static application files?

    • A.

      /opt

    • B.

      /var

    • C.

      /var/log

    • D.

      /etc

    • E.

      /usr

    Correct Answer
    E. /usr
    Explanation
    The Linux File system Hierarchy

    Rate this question:

  • 39. 

    If you want your system to be FHS-compliant, you must ensure that the /usr/localdirectory contain (choose all that apply):

    • A.

      Bin

    • B.

      Lib

    • C.

      Man

    • D.

      Sbin

    Correct Answer(s)
    A. Bin
    B. Lib
    C. Man
    D. Sbin
    Explanation
    /usr/local directory contains bin, etc, info, man, lib, sbin, share, src
    directories.

    Rate this question:

  • 40. 

    Which of the following Linux filesysterns pre-allocates a fixednumber of inodes at filesysterns make/creation time, and does NOTgenerate them as needed?

    • A.

      Ext3

    • B.

      Jfs

    • C.

      Reiserfs

    • D.

      Xfs

    Correct Answer
    A. Ext3
    Explanation
    What are the advantages of ext3?Why do you want to migrate from ext2 to ext3? Four
    main reasons: availability, data integrity, speed, and easy transition.
    Availability
    After an unclean system shutdown (unexpected power failure, system crash), each ext2
    file system cannot be mounted until its consistency has been checked by the e2fsck
    program. The amount of time that the e2fsck program takes is determined primarily by
    the size of the file system, and for today's relatively large (many tens of gigabytes) file
    systems, this takes a long time. Also, the more files you have on the file system, the
    longer the consistency check takes. File systems that are several hundreds of gigabytes in
    size may take an hour or more to check. This severely limits availability.
    By contrast, ext3 does not require a file system check, even after an unclean system
    shutdown, except for certain rare hardware failure cases (e.g. hard drive failures). This is
    because the data is written to disk in such a way that the file system is always consistent.
    The time to recover an ext3 file system after an unclean system shutdown does not
    depend on the size of the file system or the number of files; rather, it depends on the size
    of the "journal" used to maintain consistency. The default journal size takes about a
    second to recover (depending on the speed of the hardware).
    Data Integrity
    Using the ext3 file system can provide stronger guarantees about data integrity in case of
    an unclean system shutdown. You choose the type and level of protection that your data
    receives. You can choose to keep the file system consistent, but allow for damage to data
    on the file system in the case of unclean system shutdown; this can give a modest speed
    up under some but not all circumstances. Alternatively, you can choose to ensure that the
    data is consistent with the state of the file system; this means that you will never see
    garbage data in recently-written files after a crash. The safe choice, keeping the data
    consistent with the state of the file system, is the default.
    Speed
    Despite writing some data more than once, ext3 is often faster (higher throughput) than
    ext2 because ext3's journaling optimizes hard drive head motion. You can choose from
    three journaling modes to optimize speed, optionally choosing to trade off some data
    integrity.
    1. One mode, data=writeback, limits the data integrity guarantees, allowing old data to
    show up in files after a crash, for a potential increase in speed under some circumstances.
    (This mode, which is the default journaling mode for most journaling file systems,
    essentially provides the more limited data integrity guarantees of the ext2 file system and
    merely avoids the long file system check at boot time.)
    2. The second mode, data=ordered (the default mode), guarantees that the data is
    consistent with the file system; recently-written files will never show up with garbage
    contents after a crash.

    3. The last mode, data=journal, requires a larger journal for reasonable speed in most
    cases and therefore takes longer to recover in case of unclean shutdown, but is sometimes
    faster for certain database operations.
    The default mode is recommended for general-purpose computing needs. To change the
    mode, add the data=something option to the mount options for that file system in the
    /etc/fstab file, as documented in the mount man page (man mount).
    Easy Transition
    It is easy to change from ext2 to ext3 and gain the benefits of a robust journaling file
    system, without reformatting. That's right, there is no need to do a long, tedious, and
    error-prone backup-reformat-restore operation in order to experience the advantages of
    ext3. There are two ways to perform the transition:
    1. The Red Hat Linux installation program offers to transition your file systems when
    you upgrade your system. All you have to do is select one checkbox per file system.
    The tune2fs program can add a journal to an existing ext2 file system. If the file system is
    already mounted while it is being transitioned, the journal will be visible as the file
    .journal in the root directory of the file system. If the file system is not mounted, the
    journal will be hidden and will not appear in the file system. Just run tune2fs -j /dev/hda1
    (or whatever device holds the file system you are transitioning) and change ext2 to ext3
    on the matching lines in /etc/fstab. If you are transitioning your root file system, you will
    have to use an initrd to boot. Run the
    mkinitrd program as described in the manual and make sure that your LILO or GRUB
    configuration loads the initrd. (If you fail to make that change, the system will still boot,
    but the root file system will be mounted as ext2 instead of ext3 - you can tell this by
    looking at the output of the command cat

    Rate this question:

  • 41. 

    The command mkfs -t ext3 /dev/hdb1 -T largefile creates what size of inode?

    • A.

      4 kilobyte

    • B.

      1 megabyte

    • C.

      2 megabyte

    • D.

      4 megabyte

    Correct Answer
    B. 1 megabyte
    Explanation
    -T fs-type : Specify how the filesystem is going to be used, so that
    mke2fs can choose optimal filesystem parameters for that use. Some Filesystem type
    are:
    news : One inode per 4kb block
    largerfile : one inode per megabyte
    largerfile4 : one inode per 4 megabytes

    Rate this question:

  • 42. 

    Which command (without options) would you use to display how much space isavailable on all partitions?

    Correct Answer
    df
    Explanation
    df displays the amount of disk space available on the filesystem
    containing each file name argument. If no file name is given, the space available on
    all currently mounted filesystems is shown.
    # df -h : Disk free space in human readable format.

    Rate this question:

  • 43. 

    Which command will show the number of free and used inodes for your system'smounted file systems?

    • A.

      Du -i

    • B.

      Df -i

    • C.

      Ls -iR /

    • D.

      Freeinodes

    Correct Answer
    B. Df -i
    Explanation
    df - report file system disk space usage
    -i, --inodes, list inode information instead of block usage

    Rate this question:

  • 44. 

    What command with switches will display the disk utilization for all mounted file systems?

    • A.

      Df

    • B.

      Vmstat

    • C.

      Du

    • D.

      Top

    • E.

      Free

    Correct Answer
    A. Df
    Explanation
    df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown.
    # df -h : Disk free space in human readable format.

    Rate this question:

  • 45. 

    What command with options will show the currently mounted filesystems usage inkilobytes?

    • A.

      Df -k

    • B.

      Df -h

    • C.

      Du -k

    • D.

      Du -h

    • E.

      Du -s

    Correct Answer
    A. Df -k
    Explanation
    df displays the amount of disk space available on the filesystem
    containing each file name argument. If no file name is given, the space available

    on
    all currently mounted filesystems is shown.
    # df -k : Disk free space in kilobytes.

    Rate this question:

  • 46. 

    Which utility on a system will report any excessive file system space remaining with very few inodes still available?

    • A.

      Fsck

    • B.

      Debugfs

    • C.

      Sync

    • D.

      Showfiles

    • E.

      Softlinks

    Correct Answer
    A. Fsck
    Explanation
    fsck checks and repair the Linux File system. While checking the
    filesystem it returns the error code
    0 : No Errors
    1 : File System Errors corrected
    2 : System should be rebooted
    4 : File system errors left uncorrected
    8 : Operational error
    16 : Usage or Syntax error
    32 : Fsck canceled by user request
    # fsck /dev/hda1 : It will check the filesystem error of /dev/hda1

    Rate this question:

  • 47. 

    You are preparing to mount a new ext3 partition.What command would you use to check the filesystem for errors before mounting it?(Include only the command without path, options, or arguments)

    Correct Answer
    e2fsck
    Explanation
    e2fsck is used to check alinux second extended file system as well

    as
    third extended file jystem (containing journal in ext2 filesystem). After the

    journal
    has been applied a filesystem will normally be marked as clean. Hence, for ext3

    filesystems, e2fsck will normally run the journal and exit, unless its superblock
    indicates that further checking is required.

    Rate this question:

  • 48. 

    What utility is used to verify the integrity of a filesystem? (Do not specify path or parameters)

    Correct Answer
    fsck
    Explanation
    fsck checks and repair the Linux File system. While checking the
    filesystem it returns the error code
    0 : No Errors
    1 : File System Errors corrected
    2 : System should be rebooted
    4 : File system errors left uncorrected
    8 : Operational error
    16 : Usage or Syntax error
    32 : Fsck canceled by user request
    # fsck /dev/hda1 : It will check the filesystem error of /dev/hda1

    Rate this question:

  • 49. 

    What is the simplest and most direct command to check the integrity of an Ext2 file system?

    • A.

      Fsck.ext2

    • B.

      Fsck -t ext2

    • C.

      E2fsck

    • D.

      Ext2fsck

    • E.

      None of the above

    Correct Answer
    C. E2fsck
    Explanation
    e2fsck is used to check alinux second extended file system as well

    as
    third extended file jystem (containing journal in ext2 filesystem). After the

    journal
    has been applied a filesystem will normally be marked as clean. Hence, for ext3
    filesystems, e2fsck will normally run the journal and exit, unless its superblock
    indicates that further checking is required.

    Rate this question:

  • 50. 

    You are preparing to mount a new ext3 partition that is the second partition onyour first IDE drive. How can you check the integrity of the filesystem first without having to answer "y" to a bunch of Questions?

    • A.

      E3fsck -y /dev/hda2

    • B.

      E2fsck -y /dev/hda2

    • C.

      E3fsck -r /dev/hda2

    • D.

      E2fsck -r /dev/hda2

    Correct Answer
    B. E2fsck -y /dev/hda2
    Explanation
    e2fsck is used to check alinux second extended file system as well as third

    extended
    file jystem (containing journal in ext2 filesystem). After the journal has been
    applied a filesystem will normally be marked as clean. Hence, for ext3

    filesystems,
    e2fsck will normally run the journal and exit, unless its superblock indicates

    that
    further checking is required.
    Where -y means assumes an answer of 'yes' to all #######*******QUESTIONs; allows

    e2fsck to be used
    non-interactively.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 15, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 10, 2009
    Quiz Created by
    Tobyyy
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.