UNIX MCQs – Disk Management (Part – 3)

UNIX Question and Answer – Disk Management

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

1. Which command is used to create a new swap space in UNIX?

a) mkswap

b) swapon

c) swapcreate

d) swapmk

Answer: a) mkswap

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


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


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


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

a) Create a new ext4 file system

b) Check and repair an ext4 file system

c) Mount an ext4 file system

d) Resize an ext4 file system

Answer: a) Create a new ext4 file system

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


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

a) df

b) fsusage

c) du

d) diskusage

Answer: c) du

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


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


7. Which command is used to create a new ext2 file system in UNIX?

a) mkfs.ext2

b) mkfs.ext3

c) mkfs.ext4

d) mkfs

Answer: a) mkfs.ext2

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


8. What does the “mount -a” command do in UNIX?

a) Mount all available file systems

b) Mount a specific file system

c) Mount a file system with specific options

d) Mount a file system read-only

Answer: a) Mount all available file systems

Explanation: The mount -a command is used to mount all available file systems in UNIX.


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


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


11. Which command is used to create a new ext3 file system in UNIX?

a) mkfs.ext2

b) mkfs.ext3

c) mkfs.ext4

d) mkfs

Answer: b) mkfs.ext3

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


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


13. Which option is used with the df command to display file system type information in UNIX?

a) -T

b) -t

c) -f

d) -s

Answer: a) -T

Explanation: The -T option with the df command is used to display file system type information in UNIX.


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


15. 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: b) fdisk -l

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


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


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


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


19. Which option is used with the mount command to remount a file system read-write in UNIX?

a) -r

b) -w

c) -o rw

d) -o ro

Answer: c) -o rw

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


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


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


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


23. Which option is used with the mount command to mount a file system read-only in UNIX?

a) -r

b) -w

c) -o rw

d) -o ro

Answer: d) -o ro

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


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


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


26. Which command is used to display the total number of inodes and their usage for a file system in UNIX?

a) df

b) fsstat

c) tune2fs

d) dumpe2fs

Answer: d) dumpe2fs

Explanation: The dumpe2fs command is used to display the total number of inodes and their usage for a file system in UNIX.


27. What does the “mkfs -t xfs” command do in UNIX?

a) Create a new xfs file system

b) Check and repair an xfs file system

c) Mount an xfs file system

d) Resize an xfs file system

Answer: a) Create a new xfs file system

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


28. Which command is used to create a new ext4 file system with reserved blocks for system use in UNIX?

a) mkfs.ext4 -r

b) mkfs.ext4 -m

c) mkfs.ext4 -R

d) mkfs.ext4 -T

Answer: b) mkfs.ext4 -m

Explanation: The mkfs.ext4 -m command is used to create a new ext4 file system with reserved blocks for system use in UNIX.


29. What is the purpose of the tune2fs -c command in UNIX?

a) Change the maximum mount count for a file system

b) Change the block size for a file system

c) Change the inode size for a file system

d) Change the label of a file system

Answer: a) Change the maximum mount count for a file system

Explanation: The tune2fs -c command is used to change the maximum mount count for a file system in UNIX.


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


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


32. Which option is used with the mkfs command to specify the block size for a new file system in UNIX?

a) -b

b) -s

c) -B

d) -S

Answer: c) -B

Explanation: The -B option with the mkfs command is used to specify the block size for a new file system in UNIX.


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

a) Mount a file system

b) Check file system integrity without repairing

c) Check and repair file system integrity interactively

d) Resize a file system

Answer: b) Check file system integrity without repairing

Explanation: The fsck -n command is used to check file system integrity without repairing in UNIX.


34. Which option is used with the mount command to mount a file system read-write in UNIX?

a) -r

b) -w

c) -o rw

d) -o ro

Answer: c) -o rw

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


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


36. Which command is used to display information about disk devices and their partitions 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 devices and their partitions in UNIX.


37. What is the purpose of the mkfs -L command 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.


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


39. What does the “mkfs.ext4 -N” command do in UNIX?

a) Check file system integrity

b) Create a new ext4 file system without journaling

c) Mount an ext4 file system

d) Resize an ext4 file system

Answer: b) Create a new ext4 file system without journaling

Explanation: The mkfs.ext4 -N command is used to create a new ext4 file system without journaling in UNIX.


40. Which option is used with the mkswap command to specify the UUID of the swap space in UNIX?

a) -U

b) -u

c) -I

d) -i

Answer: a) -U

Explanation: The -U option with the mkswap command is used to specify the UUID of the swap space in UNIX.


41. What is the purpose of the fsck -p command in UNIX?

a) Mount a file system

b) Unmount a file system

c) Check and repair file system integrity automatically

d) Resize a file system

Answer: c) Check and repair file system integrity automatically

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


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

a) fsstat

b) tune2fs

c) df

d) dumpe2fs

Answer: c) df

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


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


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

a) uuidgen

b) blkid

c) tune2fs

d) e2label

Answer: c) tune2fs

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


45. What is the purpose of the mkfs.ext3 -b command in UNIX?

a) Create a new ext3 file system with a specific block size

b) Check file system integrity

c) Mount an ext3 file system

d) Resize an ext3 file system

Answer: a) Create a new ext3 file system with a specific block size

Explanation: The mkfs.ext3 -b command is used to create a new ext3 file system with a specific block size in UNIX.


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


47. What is the purpose of the mkswap -c 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 -c command is used to create a swap partition in UNIX.


48. Which option is used with the fsck command to check and repair file system integrity interactively in UNIX?

a) -f

b) -p

c) -y

d) -r

Answer: d) -r

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


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

a) Check file system integrity

b) Create a new ext2 file system

c) Mount an ext2 file system

d) Set the label of an ext2 file system

Answer: d) Set the label of an ext2 file system

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


50. Which command is used to display information about the journal of an ext3 file system in UNIX?

a) journalctl

b) ext3journal

c) fsck

d) dumpe2fs

Answer: d) dumpe2fs

Explanation: The dumpe2fs command is used to display information about the journal of an ext3 file system in UNIX.

Related Articles

Linux MCQ

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