Disk Partition Flashcards

1
Q

What are different disk partition utilities you familiar with?

A

fdisk, gdisk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can we update the kernel partition table manually?

A

partprobe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why we need Swap space?

A

Swap space is virtual memory that is used in case RAM gets full.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you check swap space utilization?

A

free -h, top, cat /proc/meminfo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Is swapping good or bad thing?

A

swap is good because it frees up RAM and freeing up RAM allows the CPU to run faster and avoid crashing.
disadvantage: if you continuously swap, then your system will start to freeze up. Also swap resides on the hard disk, so it slows the system when the swap is being utilized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is paging out and paging in?

A

paging out: RAM to swap
paging in: swap to RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is purpose of command fdisk –l?

A

lists the disk partition table and provides more information on memory size and path to the partitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How you will arrange the LUN in your environment and walk me through how you will partition on assigned LUN?

A

LUN (logical unit number) is a hard drive. It is arranged (attached/provisioned) by editing the settings or assigned by the data storage team. Once the disk is assigned, it can be scanned using the scsi scan and listed with lsblk. Finally we can use fdisk to partition it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is basic difference between gdisk and fdisk partition utility?

A

fdisk - older method of partitioning, create partitions on disks upto 2TB size, maximum of 4 partitions
gdisk - can create partitions on disks greater than 2TB size, maximum of 128 partitions, uses guided partition table.”fdisk - create partitions upto 2TB size, maximum of 4 partitions
gdisk - create partitions greater than 2TB size, maximum of 128 partitions”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which partition schemes fdisk supports?

A

MBR and GPT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is basic points of consideration while choosing MBR / GPT partition table?

A

MBR is older version and has limited space to store partition info, with a max of 15 partitions (with 3-4 standard partitions). MBR is store up to 2 TB. MBR is used in BIOS.

For larger disks, we have to use GPT. GPT can support up to 128 partitions. GPT is also used for UEFI.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which partition schemes fdisk supports?

A

MBR and GPT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between primary and logical partition?

A

primary - what we can use for /boot, they are standard (fixed size, static) partitions that cannot be changed later
logical - can be changed later and are flexible and extendable, sizes can be edited later

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why do we mount a file system?

A

To creat an access point to look into the block devices, easier to access data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is fstab file in Linux?

A

fstab - stands for file system table, shows which the filesystems are automatically mounted on the filesystem after reboot. By adding an entry, we can make a mount point boot persistent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you list the mount points?

A

“lsblk -f
df -h
mount
cat /proc/mounts”

17
Q

Which command do you use to get UUID?

A

blkid

18
Q

How Does the Linux System Determine Which File Systems to Mount at Boot Time?

A

system reads the /etc/fstab file

19
Q

What is the command for scanning newly attached block devices?

A

echo “- - -“ > /sys/class/scsi_host/host0/scan

20
Q

What command do you use to view existing partitions on your block devices?

A

lsblk or fdisk -l

21
Q

The storage team has allocated a 100 GB Logical Unit Number (LUN). You are tasked with making it available as a 100 GB standard partition with the XFS file system for the /app directory. Could you please guide me through the process?

A

Since the whole 100GB is being used, we do not need to partition the disk with fdisk /dev/sdx.
Instead we go straight to making the filesystem and mounting it:
mkfs.xfs /dev/sdx
mkdir /app
mount /dev/sdx /app

22
Q

What are the key differences between the Ext4 and XFS file systems?

A

ext4 - default for RHEL 6, better supports small files, can be reduced/shrunk. better choice for files that are frequently deleted and created. less CPU intensive. has journaling, supports 2 EB of data. uses fsck or e2fsck to maintain integrity of the hard drive.
xfs - default for RHEL 7, better supports larger files, cannot be reduced/shrunk. more CPU intensive. has enhanced journaling, supports 8 EB of data. uses xfs_repair to maintain integrity of the hard drive.”ext4 - default for RHEL 6, small in size, can be reduced
xfs - default for RHEL 7, big in size, cannot be reduced”

23
Q

Could you explain the concept of journaling in file systems?

A

Mechanism that saves the filesystem metadata and data in case of unexpected system crashes or power failures

24
Q

What are the consequences of errors in the /etc/fstab file?

A

Depending on the error, there could be boot failure, system hanging, kernel panic, or the filesystem will simply fail to mount.

25
Q

What is a UUID, and which command can you use to retrieve it?

A

Universal Unique ID can be found with blkid, or lsblk -f.

26
Q

Why might du -h and df -h yield different results? What could be the issue?

A

df-h shows broader spectrum system/device utilization. du-h shows specific file utilization. If a file is deleted, but still open by some other process, du-f will show real-time updates to disk utilization, but df-h (high level usage) will not reflect the changes immediately because the file might still be open somewhere on the system (perhaps in the cache). So df-h may show a higher utilization than du-h.

27
Q

du -h and df -h are showing the same results, but you are unable to write to the filesystem. What could be causing this problem?

A

You may have run out of inode numbers. The filesystem could also just be read-only, so you would be unable to write anything inside that filesystem.

28
Q

If there is still 60% free space, yet you cannot save any files in the filesystem, what could be the possible reason?

A

Check inode numbers with df -i. You might have run out of inode numbers, and therefore cannot save any more files to the system. The filesystem could also just be read-only, so you would be unable to write anything inside that filesystem.

29
Q

What is the command to obtain the total number of available and used inodes for the / file system?

A

df -hi /

30
Q

What happens if you run out of the maximum number of inodes? What are the consequences, and how can you resolve this issue?

A

If you run out, you cannot create new files. This stymies the system from growing. You can resolve this with additional space, or by deleting/archiving files to free up inode numbers (as long as those files don’t have a hard link).