UNIX MCQs – Disk Management (Part – 2)

UNIX Question and Answer – Disk Management

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. Which command is used to display detailed information about file systems and their characteristics, including their UUIDs, in UNIX?

a) df

b) fsstat

c) blkid

d) lsblk

Answer: c) blkid

Explanation: The blkid command displays detailed information about file systems and their characteristics, including their UUIDs, in UNIX.


2. What does the “mkfs -t ext3” command do in UNIX?

a) Create a new ext3 file system

b) Check and repair an ext3 file system

c) Mount an ext3 file system

d) Resize an ext3 file system

Answer: a) Create a new ext3 file system

Explanation: The “mkfs -t ext3” command is used to create a new ext3 file system in UNIX.


3. Which command is used to set or change the label of a file system in UNIX?

a) fslabel

b) setlabel

c) e2label

d) tune2fs

Answer: c) e2label

Explanation: The e2label command is used to set or change the label of a file system in UNIX.


4. What is the purpose of the fsck -y command in UNIX?

a) Mount a file system

b) Unmount a file system

c) Check and repair file system integrity, automatically answering ‘yes’ to all prompts

d) Resize a file system

Answer: c) Check and repair file system integrity, automatically answering ‘yes’ to all prompts

Explanation: The fsck -y command is used to check and repair file system integrity in UNIX, automatically answering ‘yes’ to all prompts.


5. Which option is used with the du command to display the disk usage of a directory in a more human-readable format in UNIX?

a) -k

b) -h

c) -m

d) -s

Answer: b) -h

Explanation: The -h option with the du command is used to display the disk usage of a directory in a more human-readable format in UNIX.


6. What does the “mkswap -c” command do in UNIX?

a) Check swap space usage

b) Create a swap partition

c) Mount a swap partition

d) Unmount a swap partition

Answer: b) Create a swap partition

Explanation: The “mkswap -c” command is used to create a swap partition in UNIX.


7. Which command is used to display the UUID of a file system in UNIX?

a) uuidgen

b) blkid

c) tune2fs

d) e2label

Answer: b) blkid

Explanation: The blkid command is used to display the UUID of a file system in UNIX.


8. What is the purpose of the tune2fs -j command in UNIX?

a) Resize an ext2/ext3/ext4 file system

b) Check and repair an ext2/ext3/ext4 file system

c) Enable journaling on an ext2/ext3/ext4 file system

d) Mount an ext2/ext3/ext4 file system

Answer: c) Enable journaling on an ext2/ext3/ext4 file system

Explanation: The tune2fs -j command is used to enable journaling on an ext2/ext3/ext4 file system in UNIX.


9. Which command is used to display information about disk usage and available space on all mounted file systems in UNIX?

a) mount

b) df -a

c) fsusage

d) du -sh

Answer: b) df -a

Explanation: The df -a command is used to display information about disk usage and available space on all mounted file systems in UNIX.


10. What does the “mount -t” command do in UNIX?

a) Mount a file system with specific options

b) Mount a file system read-only

c) Mount a file system read-write

d) Mount a specific file system type

Answer: d) Mount a specific file system type

Explanation: The mount -t command is used to mount a specific file system type in UNIX.


11. Which command is used to check for bad blocks on a disk partition and mark them in UNIX?

a) fsck

b) badblocks

c) blkid

d) mkfs

Answer: b) badblocks

Explanation: The badblocks command is used to check for bad blocks on a disk partition and mark them in UNIX.


12. What is the purpose of the mkfs -c command in UNIX?

a) Check file system integrity

b) Create a new file system

c) Mount a file system

d) Unmount a file system

Answer: b) Create a new file system

Explanation: The mkfs -c command is used to create a new file system in UNIX.


13. Which option is used with the umount command to detach a file system forcefully in UNIX?

a) -f

b) -r

c) -a

d) -l

Answer: a) -f

Explanation: The -f option with the umount command is used to detach a file system forcefully in UNIX.


14. What is the purpose of the mklabel command in UNIX?

a) Create a new disk label

b) Modify an existing disk label

c) Resize a disk partition

d) Check disk label integrity

Answer: a) Create a new disk label

Explanation: The mklabel command is used to create a new disk label in UNIX.


15. Which command is used to display information about file systems, including their types and mount points, in UNIX?

a) df -T

b) mount -l

c) lsfs

d) fsck -f

Answer: a) df -T

Explanation: The df -T command is used to display information about file systems, including their types and mount points, in UNIX.


16. What is the purpose of the fsck -r command in UNIX?

a) Mount a file system

b) Unmount a file system

c) Check and repair file system integrity interactively

d) Resize a file system

Answer: c) Check and repair file system integrity interactively

Explanation: The fsck -r command is used to check and repair file system integrity interactively in UNIX.


17. Which command is used to display the number of disk blocks and available disk space for a file system in UNIX?

a) statfs

b) fsstat

c) df

d) du

Answer: c) df

Explanation: The df command is used to display the number of disk blocks and available disk space for a file system in UNIX.


18. What does the “mkfs -L” command do in UNIX?

a) Create a new file system

b) Check file system integrity

c) Mount a file system

d) Set the label of a file system

Answer: d) Set the label of a file system

Explanation: The mkfs -L command is used to set the label of a file system in UNIX.


19. Which command is used to display information about disk devices and their partitions in UNIX?

a) lsblk

b) fdisk -l

c) du -sh

d) df -h

Answer: a) lsblk

Explanation: The lsblk command is used to display information about disk devices and their partitions in UNIX.


20. What is the purpose of the mkswap -p command in UNIX?

a) Check swap space usage

b) Create a swap partition

c) Mount a swap partition

d) Unmount a swap partition

Answer: b) Create a swap partition

Explanation: The mkswap -p command is used to create a swap partition in UNIX.


21. Which command is used to display information about disk partitions, including their sizes and types, in UNIX?

a) lsblk

b) fdisk -l

c) df -h

d) du -sh

Answer: b) fdisk -l

Explanation: The fdisk -l command is used to display information about disk partitions, including their sizes and types, in UNIX.


22. What does the “tune2fs -c 5 -i 1m” command do in UNIX?

a) Create a new ext2/ext3/ext4 file system

b) Check and repair an ext2/ext3/ext4 file system

c) Change the maximum mount count and interval between checks for an ext2/ext3/ext4 file system

d) Mount an ext2/ext3/ext4 file system

Answer: c) Change the maximum mount count and interval between checks for an ext2/ext3/ext4 file system

Explanation: The tune2fs -c 5 -i 1m command is used to change the maximum mount count and interval between checks for an ext2/ext3/ext4 file system in UNIX.


23. Which option is used with the fsck command to automatically repair file system errors without user intervention in UNIX?

a) -f

b) -p

c) -y

d) -r

Answer: c) -y

Explanation: The -y option with the fsck command is used to automatically repair file system errors without user intervention in UNIX.


24. What is the purpose of the fsstat command in UNIX?

a) Display information about file system statistics

b) Display information about disk space usage

c) Display information about file system types

d) Display information about disk partitions

Answer: a) Display information about file system statistics

Explanation: The fsstat command is used to display information about file system statistics in UNIX.


25. Which command is used to create a new ext2/ext3/ext4 file system in UNIX?

a) mkfs.ext2

b) mkfs.ext3

c) mkfs.ext4

d) mkfs

Answer: c) mkfs.ext4

Explanation: The mkfs.ext4 command is used to create a new ext2/ext3/ext4 file system in UNIX.


26. What is the purpose of the fsstat -f command in UNIX?

a) Display file system statistics

b) Display disk space usage

c) Display file system types

d) Display disk partition information

Answer: a) Display file system statistics

Explanation: The fsstat -f command is used to display file system statistics in UNIX.


27. Which command is used to check the integrity of a file system and repair any errors found in UNIX?

a) fsck

b) df

c) mount

d) du

Answer: a) fsck

Explanation: The fsck command is used to check the integrity of a file system and repair any errors found in UNIX.


28. What does the “mkswap -p” command do in UNIX?

a) Check swap space usage

b) Create a swap partition

c) Mount a swap partition

d) Unmount a swap partition

Answer: b) Create a swap partition

Explanation: The mkswap -p command is used to create a swap partition in UNIX.


29. Which command is used to display the disk usage of a file or directory in UNIX?

a) df

b) fsusage

c) du

d) diskusage

Answer: c) du

Explanation: The du command is used to display the disk usage of a file or directory in UNIX.


30. What is the purpose of the tune2fs -j command in UNIX?

a) Check file system integrity

b) Mount a file system

c) Enable journaling on a file system

d) Resize a file system

Answer: c) Enable journaling on a file system

Explanation: The tune2fs -j command is used to enable journaling on a file system in UNIX.


31. Which option is used with the mkswap command to specify the number of blocks to be reserved for swap space in UNIX?

a) -b

b) -c

c) -r

d) -n

Answer: a) -b

Explanation: The -b option with the mkswap command is used to specify the number of blocks to be reserved for swap space in UNIX.


32. What does the “mount -o remount” command do in UNIX?

a) Remount a file system read-only

b) Remount a file system read-write

c) Remount a file system with specific options

d) Remount a specific device

Answer: b) Remount a file system read-write

Explanation: The mount -o remount command is used to remount a file system read-write in UNIX.


33. Which command is used to display the list of available file systems in UNIX?

a) lsfs

b) df -T

c) mount -l

d) cat /proc/filesystems

Answer: d) cat /proc/filesystems

Explanation: The cat /proc/filesystems command is used to display the list of available file systems in UNIX.


34. What is the purpose of the mklabel command in UNIX?

a) Create a new disk label

b) Modify an existing disk label

c) Resize a disk partition

d) Check disk label integrity

Answer: a) Create a new disk label

Explanation: The mklabel command is used to create a new disk label in UNIX.


35. Which command is used to display information about disk partitions and their sizes in UNIX?

a) lsblk

b) fdisk -l

c) df -h

d) du -sh

Answer: b) fdisk -l

Explanation: The fdisk -l command is used to display information about disk partitions and their sizes in UNIX.


36. What does the “mkfs -c” command do in UNIX?

a) Check file system integrity

b) Create a new file system

c) Mount a file system

d) Unmount a file system

Answer: b) Create a new file system

Explanation: The mkfs -c command is used to create a new file system in UNIX.


37. Which option is used with the umount command to detach a file system recursively, unmounting all submounts of the specified mount point in UNIX?

a) -r

b) -f

c) -s

d) -a

Answer: a) -r

Explanation: The -r option with the umount command is used to detach a file system recursively, unmounting all submounts of the specified mount point in UNIX.


38. What is the purpose of the swapoff command in UNIX?

a) Enable swapping on a device or file

b) Disable swapping on a device or file

c) Display information about swap space usage

d) Check and repair swap space integrity

Answer: b) Disable swapping on a device or file

Explanation: The swapoff command is used to disable swapping on a device or file in UNIX.


39. Which command is used to display information about disk devices in UNIX?

a) lsblk

b) fdisk -l

c) blkid

d) du -sh

Answer: a) lsblk

Explanation: The lsblk command is used to display information about disk devices in UNIX.


40. What does the “mkfs -L” command do in UNIX?

a) Check file system integrity

b) Create a new file system

c) Mount a file system

d) Set the label of a file system

Answer: d) Set the label of a file system

Explanation: The mkfs -L command is used to set the label of a file system in UNIX.


41. Which option is used with the fsck command to automatically repair file system errors without user intervention in UNIX?

a) -f

b) -p

c) -y

d) -r

Answer: c) -y

Explanation: The -y option with the fsck command is used to automatically repair file system errors without user intervention in UNIX.


42. What is the purpose of the fsstat command in UNIX?

a) Display information about file system statistics

b) Display information about disk space usage

c) Display information about file system types

d) Display information about disk partitions

Answer: a) Display information about file system statistics

Explanation: The fsstat command is used to display information about file system statistics in UNIX.


43. Which command is used to create a new ext2/ext3/ext4 file system in UNIX?

a) mkfs.ext2

b) mkfs.ext3

c) mkfs.ext4

d) mkfs

Answer: c) mkfs.ext4

Explanation: The mkfs.ext4 command is used to create a new ext2/ext3/ext4 file system in UNIX.


44. What is the purpose of the dumpe2fs command in UNIX?

a) Display information about disk devices

b) Display information about file system usage

c) Display information about file system structure

d) Display information about file system integrity

Answer: c) Display information about file system structure

Explanation: The dumpe2fs command is used to display information about file system structure in UNIX.


45. Which command is used to display information about disk usage and available space on all mounted file systems in UNIX?

a) mount

b) df -a

c) fsusage

d) du -sh

Answer: b) df -a

Explanation: The df -a command is used to display information about disk usage and available space on all mounted file systems in UNIX.


46. What does the “mount -t” command do in UNIX?

a) Mount a file system with specific options

b) Mount a file system read-only

c) Mount a file system read-write

d) Mount a specific file system type

Answer: d) Mount a specific file system type

Explanation: The mount -t command is used to mount a specific file system type in UNIX.


47. Which command is used to display information about disk partitions and their sizes in UNIX?

a) lsblk

b) fdisk -l

c) df -h

d) du -sh

Answer: b) fdisk -l

Explanation: The fdisk -l command is used to display information about disk partitions and their sizes in UNIX.


48. What is the purpose of the mklabel command in UNIX?

a) Create a new disk label

b) Modify an existing disk label

c) Resize a disk partition

d) Check disk label integrity

Answer: a) Create a new disk label

Explanation: The mklabel command is used to create a new disk label in UNIX.


49. Which command is used to check the integrity of a file system and repair any errors found in UNIX?

a) fsck

b) df

c) mount

d) du

Answer: a) fsck

Explanation: The fsck command is used to check the integrity of a file system and repair any errors found in UNIX.


50. What does the “mkswap -p” command do in UNIX?

a) Check swap space usage

b) Create a swap partition

c) Mount a swap partition

d) Unmount a swap partition

Answer: b) Create a swap partition

Explanation: The mkswap -p command is used to create a swap partition in UNIX.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...