UNIX MCQs – Disk Management (Part – 1)

UNIX Question and Answer – Disk Management

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

1. What command is commonly used to create and modify disk partitions in UNIX?

a) fdisk

b) mkfs

c) mount

d) umount

Answer: a) fdisk

Explanation: The fdisk command is commonly used to create and modify disk partitions in UNIX.


2. Which utility allows for creating and resizing disk partitions with more flexibility compared to fdisk?

a) mkfs

b) mount

c) umount

d) parted

Answer: d) parted

Explanation: The parted utility provides more flexible options for creating and resizing disk partitions in UNIX.


3. In UNIX, what is the purpose of the mkfs command?

a) Mount a file system

b) Create a file system

c) Resize a file system

d) Check file system integrity

Answer: b) Create a file system

Explanation: The mkfs command is used to create a file system on a disk partition in UNIX.


4. Which command is used to list all currently mounted file systems in UNIX?

a) mount

b) df

c) fdisk -l

d) parted -l

Answer: b) df

Explanation: The df command is used to list all currently mounted file systems along with their disk space usage in UNIX.


5. What is the purpose of the mount command in UNIX?

a) Create a new file system

b) Mount a file system

c) Unmount a file system

d) Check file system integrity

Answer: b) Mount a file system

Explanation: The mount command is used to attach a file system to the system’s directory tree in UNIX.


6. Which option is used with the mount command to specify the file system type?

a) -t

b) -f

c) -m

d) -s

Answer: a) -t

Explanation: The -t option with the mount command is used to specify the file system type to be mounted in UNIX.


7. What is the purpose of the umount command in UNIX?

a) Create a new file system

b) Mount a file system

c) Unmount a file system

d) Check file system integrity

Answer: c) Unmount a file system

Explanation: The umount command is used to detach a mounted file system in UNIX.


8. Which command is used to force an unmount of a file system in UNIX, even if it is busy?

a) umount -f

b) umount -r

c) umount -t

d) umount -o

Answer: a) umount -f

Explanation: The umount command with the -f option is used to force an unmount of a file system in UNIX, even if it is busy.


9. What does the “fdisk -l” command do in UNIX?

a) List all currently mounted file systems

b) Display disk partition information

c) Create a new disk partition

d) Resize a disk partition

Answer: b) Display disk partition information

Explanation: The “fdisk -l” command is used to display information about disk partitions in UNIX.


10. Which command is used to format a disk partition with a specific file system type in UNIX?

a) format

b) fdisk

c) mkfs

d) mount

Answer: c) mkfs

Explanation: The mkfs command is used to format a disk partition with a specific file system type in UNIX.


11. What is the purpose of the fsck command in UNIX?

a) Mount a file system

b) Unmount a file system

c) Check and repair file system integrity

d) Create a new file system

Answer: c) Check and repair file system integrity

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


12. Which command is used to display detailed information about disk partitions and file systems in UNIX?

a) fdisk

b) df

c) mount

d) lsblk

Answer: d) lsblk

Explanation: The lsblk command is used to display detailed information about disk partitions and file systems in UNIX.


13. What is the purpose of the -o option with the mount command in UNIX?

a) Specify file system type

b) Mount file system read-only

c) Mount file system read-write

d) Force unmount

Answer: b) Mount file system read-only

Explanation: The -o option with the mount command is used to mount a file system read-only in UNIX.


14. Which command is used to display the disk space usage of a specific directory in UNIX?

a) ls

b) df

c) du

d) stat

Answer: c) du

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


15. What does the “-r” option with the umount command do in UNIX?

a) Remove the file system entry from /etc/fstab

b) Unmount recursively all submounts of the specified mount point

c) Restart the system

d) Mount the file system read-only

Answer: b) Unmount recursively all submounts of the specified mount point

Explanation: The “-r” option with the umount command is used to unmount recursively all submounts of the specified mount point in UNIX.


16. Which command is used to display information about the file system type and disk usage for all mounted file systems in UNIX?

a) fstab

b) df -h

c) mount -l

d) fsck -f

Answer: b) df -h

Explanation: The df -h command is used to display information about the file system type and disk usage for all mounted file systems in UNIX in a human-readable format.


17. What is the purpose of the mkswap command in UNIX?

a) Create a swap partition

b) Mount a swap partition

c) Unmount a swap partition

d) Check swap space usage

Answer: a) Create a swap partition

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


18. Which file contains information about disk partitions and their mount points in UNIX?

a) /etc/fstab

b) /etc/mtab

c) /proc/partitions

d) /proc/mounts

Answer: a) /etc/fstab

Explanation: The /etc/fstab file contains information about disk partitions and their mount points in UNIX.


19. What is the purpose of the swapon 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: a) Enable swapping on a device or file

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


20. Which option is used with the mkfs command to specify the file system type?

a) -t

b) -f

c) -m

d) -s

Answer: a) -t

Explanation: The -t option with the mkfs command is used to specify the file system type to be created in UNIX.


21. What is the purpose of the tune2fs command in UNIX?

a) Create an ext4 file system

b) Resize an ext4 file system

c) Check and repair an ext4 file system

d) Mount an ext4 file system

Answer: b) Resize an ext4 file system

Explanation: The tune2fs command is used to resize an ext4 file system in UNIX.


22. Which command is used to display detailed information about file systems and their characteristics in UNIX?

a) fsck

b) fdisk -l

c) tune2fs

d) blkid

Answer: d) blkid

Explanation: The blkid command is used to display detailed information about file systems and their characteristics, including UUIDs, in UNIX.


23. What is the function of the dumpe2fs command in UNIX?

a) Display detailed information about an ext2/ext3/ext4 file system

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

c) Resize an ext2/ext3/ext4 file system

d) Mount an ext2/ext3/ext4 file system

Answer: a) Display detailed information about an ext2/ext3/ext4 file system

Explanation: The dumpe2fs command is used to display detailed information about an ext2/ext3/ext4 file system in UNIX.


24. Which command is used to check for bad blocks on a disk partition in UNIX?

a) badblocks

b) fsck

c) blkid

d) mkfs

Answer: a) badblocks

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


25. 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.


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

a) df

b) lsblk

c) du

d) fsck

Answer: b) lsblk

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


27. What is the purpose of the resize2fs command in UNIX?

a) Resize an ext2/ext3/ext4 file system

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

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

d) Mount an ext2/ext3/ext4 file system

Answer: a) Resize an ext2/ext3/ext4 file system

Explanation: The resize2fs command is used to resize an ext2/ext3/ext4 file system in UNIX.


28. Which option is used with the df command to display disk space usage in a human-readable format in UNIX?

a) -h

b) -a

c) -m

d) -s

Answer: a) -h

Explanation: The -h option with the df command is used to display disk space usage in a human-readable format in UNIX.


29. What does the “mkfs -t ext4” command do in UNIX?

a) Mount an ext4 file system

b) Check and repair an ext4 file system

c) Create a new ext4 file system

d) Resize an ext4 file system

Answer: c) Create a new ext4 file system

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


30. Which command is used to display the UUID (Universally Unique Identifier) 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.


31. What is the purpose of the e2label command in UNIX?

a) Resize an ext2/ext3/ext4 file system

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

c) Change the label of an ext2/ext3/ext4 file system

d) Mount an ext2/ext3/ext4 file system

Answer: c) Change the label of an ext2/ext3/ext4 file system

Explanation: The e2label command is used to change the label of an ext2/ext3/ext4 file system in UNIX.


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

a) fslist

b) df -T

c) lsfs

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.


33. What is the purpose of the fsck -f command in UNIX?

a) Create a new file system

b) Check and repair file system integrity forcefully

c) Mount a file system

d) Resize a file system

Answer: b) Check and repair file system integrity forcefully

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


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

a) setlabel

b) fslabel

c) tune2fs

d) e2label

Answer: d) e2label

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


35. What is the purpose of the dumpe2fs -h command in UNIX?

a) Display detailed information about an ext2/ext3/ext4 file system

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

c) Resize an ext2/ext3/ext4 file system

d) Mount an ext2/ext3/ext4 file system

Answer: a) Display detailed information about an ext2/ext3/ext4 file system

Explanation: The dumpe2fs -h command is used to display detailed information about an ext2/ext3/ext4 file system in UNIX.


36. Which command is used to display information about the disk space usage of a specific file or directory in UNIX?

a) ls

b) df

c) du

d) stat

Answer: c) du

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


37. What is the purpose of the mkswap command in UNIX?

a) Create a swap partition

b) Mount a swap partition

c) Unmount a swap partition

d) Check swap space usage

Answer: a) Create a swap partition

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


38. 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.


39. What is the function of the mount -a command in UNIX?

a) Mount all file systems listed in /etc/fstab

b) Mount a specific file system

c) Mount file systems read-only

d) Mount file systems read-write

Answer: a) Mount all file systems listed in /etc/fstab

Explanation: The mount -a command is used to mount all file systems listed in /etc/fstab in UNIX.


40. 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.


41. 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.


42. Which command is used to display the total number of disk blocks, used and available disk space in UNIX?

a) fsstat

b) diskinfo

c) statfs

d) df

Answer: d) df

Explanation: The df command is used to display the total number of disk blocks, used and available disk space in UNIX.


43. What is the purpose of the blkid -p command in UNIX?

a) Display information about disk partitions

b) Display information about file systems

c) Display UUIDs of file systems

d) Display information about disk devices

Answer: d) Display information about disk devices

Explanation: The blkid -p command is used to display information about disk devices in UNIX.


44. 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.


45. 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.


46. Which command is used to display information about the disk usage of all mounted file systems in UNIX?

a) fsusage

b) df -a

c) mount

d) lsblk

Answer: b) df -a

Explanation: The df -a command is used to display information about the disk usage of all mounted file systems in UNIX.


47. 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.


48. 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.


49. 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.


50. Which command is used to display information about file systems, including their mount points and types, 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 mount points and types, in UNIX.

Related Articles

Linux MCQ

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